FastPrepProcess Airline Seat Requests
Problems/Process Airline Seat Requests

Process Airline Seat Requests

Agoda logoAgoda● MediumFULLTIMEOA

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: We kept the state changes and the example from the report. We chose the order of the output rows.

Our version is about 97% the same as the reported question.

An airline stores the current state of every seat and a sequence of reservation or purchase requests.

  • A request with value 1 reserves a free seat.
  • A request with value 2 purchases a free seat.
  • A person may also purchase a seat that the same person previously reserved.
  • Every other request is ignored.

Process requests from the smallest request_id to the largest and return the final state of every seat.

Table schema

MySQL

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

seats

ColumnTypeNullableDescription
seat_noPKIntegerNoUnique seat number.
statusIntegerNo0 is free, 1 is reserved, and 2 is purchased.
person_idIntegerNo0 for a free seat; otherwise the reserving or purchasing person.

requests

ColumnTypeNullableDescription
request_idPKIntegerNoProcessing order.
requestIntegerNo1 reserves and 2 purchases.
seat_noIntegerNo—
person_idIntegerNo—

Foreign key: seat_no → seats(seat_no)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
seat_noIntegerNo—
statusIntegerNo—
person_idIntegerNo—

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • Every requests.seat_no appears in seats.
  • For this exercise, assume each request_id is unique and return seats in ascending seat_no order.

More Agoda Online Assessment questions

  • Special Diameter EndpointsOA · Seen Nov 2025
  • TV Series in a Production WindowOA · Seen Nov 2025
  • Count One Groups by SizeOA · Seen Jul 2025
  • Minimum Price With Discount CouponsOA · Seen Jul 2025
  • Lexicographically Smallest Task QueueOA · Seen Jul 2025
  • Highest-Ranked University by CountryOA · Seen Jun 2025
  • Jump Game with Prime-3 StepsOA · Seen Jun 2025
  • Team FormationOA · Seen Apr 2025
  • Two-Core Process AssignmentOA · Seen Apr 2025
  • Unique Digits in RangeOA · Seen Apr 2025

Similar questions at other companies

  • Track the Book and Mark Final PnLMillennium · OAMillennium interview questions
  • In-Memory Database Historical LookupAnthropic · OAAnthropic interview questions
  • Nested Transaction Key-Value Store with Value CountsLyft · ONSITE INTERVIEWLyft interview questions
  • Parquet-Like Columnar Format OperationsJump Trading · PHONE SCREENJump Trading interview questions
  • Assign Student Grades from CSV MarksHartford Financial Services · ONSITE INTERVIEWHartford Financial Services interview questions
  • Financial Account LedgerStripe · OA · PHONE SCREENStripe interview questions
  • Organization Reputation After Employee DeparturesHSBC · OAHSBC interview questions
  • Bank Accounts with Balance HistoryMeta · OAMeta interview questions
  • Last Object Exit TimeIBM · OAIBM interview questions
  • Capping Portfolio WeightsCapstone Investment Advisors · OA

Interview reports that mention this question

  • Agoda Staff Backend OA Questions: 5 Experiences
All Agoda interview questionsSee Agoda hiring insights