Most Booked Origin-Destination Route
Updated
Problem statement
Two tables describe users and their listing reservations:
usersstores each user's home city inorigin.user_bookingstores one row per reservation and the booked listing's city indestination.
Find the origin-destination route or routes with the largest number of bookings. Count reservation rows, return every route tied for the maximum, and order tied routes by origin and then destination, both ascending.
Return the columns origin, destination, and booking_count.
Table schema
MySQLPostgreSQLPandas
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.
users
Users and their home cities.
| Column | Type | Nullable | Description |
|---|---|---|---|
| guest_idPK | Integer | No | Unique user identifier. |
| origin | Text | No | The user's home city. |
user_booking
Reservations made by users for listings in destination cities.
| Column | Type | Nullable | Description |
|---|---|---|---|
| reservation_idPK | Integer | No | Unique reservation identifier. |
| guest_id | Integer | No | User who made the reservation. |
| listing_id | Integer | No | Booked listing identifier. |
| destination | Text | No | City of the booked listing. |
| ts_booking | Timestamp | No | Timestamp when the booking was made. |
| ds_booking | Date | No | Calendar date of the booking. |
Foreign key: guest_id → users(guest_id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| origin | Text | No | — |
| destination | Text | No | — |
| booking_count | Integer | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
users.guest_idanduser_booking.reservation_idare unique and non-null.- Every
user_booking.guest_idreferences one row inusers. originanddestinationare non-null city names.- The input tables may be empty.
- Each reservation row contributes exactly one booking to its route.
More Airbnb Online Assessment questions
- In-Memory File SystemOA · Seen Nov 2026
- Task Management SystemOA · Seen Nov 2026
- Recipe Management SystemOA · Seen Nov 2026
- Progressive Banking SystemOA · Seen Nov 2026
- Credit Accounts with Scheduled TransfersOA · Seen Oct 2026
- Parcel Attribute Store with TTLOA · Seen Oct 2026
- Parcel Event TrackingOA · Seen Oct 2026
- Median Home Price by CityOA · Seen Sep 2026
- Worker Management (Promotion Track), Part 4: Full-Shift Double PayOA · Seen Sep 2026
- Worker Management (Promotion Track), Part 3: Promotions and SalaryOA · Seen Sep 2026
Similar questions at other companies
- Bond Holders Above the Cash Flow ThresholdBirla Pivot · OA
- Prepare Taxi Driver Classification DataBoston Consulting Group · OABoston Consulting Group interview questions
- Find the Dominant SellerSquadStack.ai · OA
- Track the Book and Mark Final PnLMillennium · OAMillennium interview questions
- Market Share Ticker with ImbalanceWolverine Trading · OAWolverine Trading interview questions
- Overloaded Game Account InventoriesWells Fargo · OAWells Fargo interview questions
- Transaction Totals and Ranked Failure ReasonsIntuit · OAIntuit interview questions
- Employees Joined per MonthOdoo · OAOdoo interview questions
- Bond Haircut by Ratings and MaturityJane Street · OAJane Street interview questions
- Customer Order FeesAdobe · OAAdobe interview questions
Airbnb interview experiences
- Airbnb OA · November 2026
- Airbnb Campus and Full-Time SWE OA / Interviews: 9 Experiences
- Airbnb Intern Phone Interviews: 21 Experiences (Part 7 of 7)
- Airbnb Intern OA and Phone Screens: 17 Experiences (Part 6 of 7)
- Airbnb Intern OA and Onsite Rounds: 16 Experiences (Part 5 of 7)
- Airbnb Intern OA, Diplomacy Game: 19 Experiences (Part 4 of 7)