KatInterview

Seat Reservation Platform for High-Demand Ticket Sales

System DesignModel answer
MediumModel answerSystem Designsystem-designconcurrencybooking

Last updated

Design a ticketing backend where thousands of buyers compete for the same seats, with temporary holds, safe checkout, and a firm guarantee that no seat is sold twice.

Seat Reservation Platform for High-Demand Ticket Sales

Design the backend for a ticketing service covering concerts, plays, and similar live events. Buyers browse events, look at a venue's seat map, pick particular seats, pay, and receive confirmed tickets. When a popular event goes on sale, a very large crowd arrives at once and goes after a limited set of seats.

What the system must do

  • Show a list of events and the seat map for each venue.
  • Let a buyer temporarily hold chosen seats (for example, 10 minutes) while they pay.
  • Let the buyer complete payment to turn the hold into a confirmed booking.
  • Once a seat is sold, no other buyer may obtain it.

Quality targets

  • Stay available and scale during sale-start spikes.
  • Seat ownership must be strongly consistent: the same seat can never go to two buyers.
  • Seat selection and checkout must feel fast.

What to cover in your answer

  1. The main components and how a request flows through them.
  2. The API for viewing seats, holding them, and checking out.
  3. A data model for events, seats, holds, and bookings.
  4. Your concurrency approach: what happens when two buyers try to take the same seat at the same instant?
  5. Failure handling: what happens when a buyer abandons checkout or payment fails?

State your assumptions about scale (venue size, peak traffic, hold duration) and explain the trade-offs behind your choices.

Hints

Hint 1

Treat this as a contention problem rather than a CRUD problem: reads of the catalog and seat map are easy to cache, while a small number of hot seat rows decide correctness.

Hint 2

Let the database be the single arbiter of seat ownership: use a conditional atomic update (only change a seat if it is available or its hold has expired) and check the number of rows affected. Any cache or lock in front of it is only an optimization.

Hint 3

Make holds time-limited and idempotent, and make expiry safe in two ways: reclaim expired holds lazily inside the update condition, and run a background sweeper so the seat map shows seats as free again.

Hint 4

Do not block on the payment gateway. Return quickly from checkout, process payment asynchronously with an idempotency key, and make the final confirmation conditional on the hold still being yours.