Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Trip Planning, Booking, and Itinerary Backend

Design the backend of a travel app where a traveler searches stays, flights, and activities, books a small trip in one checkout, and keeps an itinerary that follows partner changes.

Problem statement

For this exercise, assume a consumer travel app where a traveler plans one trip to one destination city.

The traveler searches stays, flights, and activities (such as guided tours) offered by outside partners, puts 1 to 4 of them into a trip, pays once, and later opens an itinerary that lists every booked item by date and stays correct when a partner changes or cancels an item.

Partners answer slowly, accept a booking, a cancellation, or a lookup by the app's own reference, and send changes as callbacks that can be repeated, late, out of order, or missing. Assume an outside payment service that can authorize, capture, void, and refund an amount and accepts an idempotency key.

A traveler must be charged only for a trip whose items are all confirmed, and only for the total they approved. Exclude card-processing internals, loyalty points, reviews, visa advice, and support chat.

What to build

  1. Search stays, flights, and activities for a destination and dates, and return one list of offers with prices.
  2. Price a trip of 1 to 4 items with a quote the traveler approves, then book every item in one checkout and charge only if all items are confirmed.
  3. Show the traveler an itinerary of booked items ordered by date, with each item's state and confirmation reference.
  4. Apply partner changes and cancellations to the itinerary and tell the traveler about them.

At scale

  • Assume 3,000 search requests per second at peak, a 95th-percentile search response under 800 milliseconds, and prices in search results that may be up to 15 minutes old.
  • Assume up to 100 checkouts per second at peak with 1 to 4 items each, partners that answer any call in 2 to 10 seconds, and a checkout that shows a final outcome, or a clear still-confirming state, within 30 seconds.
  • Assume partners honor a quoted price for 10 minutes and let a just-confirmed item be cancelled at no cost for 10 minutes.
  • Assume 2 million upcoming trips, 5,000 itinerary views per second at peak with a 95th-percentile response under 300 milliseconds, and up to 200 partner changes per second that should show in the itinerary and reach the traveler as a push notification within 1 minute.