KatInterview

Building a Flash-Sale Seat Booking Platform

System DesignModel answer
MediumModel answerSystem Designsystem-designconcurrencydistributed-systems

Last updated

Design a booking backend for hot live events that never double-sells a seat, holds seats briefly during checkout, guarantees tickets after successful payment, and fairly offers released seats to a waitlist.

Problem

Design the backend for a platform that sells seats to live events. When a popular event goes on sale, a huge crowd (hundreds of thousands of people) arrives within seconds and competes for a limited number of individually numbered seats.

Requirements

  1. Burst traffic. Tens or hundreds of thousands of users may try to buy for the same event at the same instant. No seat may ever be sold twice, and response times should stay low.
  2. Seat inventory and temporary holds.
    • Events have sections and individually identifiable seats.
    • When a buyer begins checkout, the chosen seats are held for a short window (for example 5 minutes).
    • A hold that is not paid for in time must lapse by itself and return the seats to the available pool.
  3. Payment guarantee.
    • Payment goes through a third-party provider that can take several seconds, or occasionally much longer.
    • If a payment succeeds, the buyer must always end up with the seats they were shown as held.
    • If payment fails or does not complete, the seats must be released.
  4. Sold-out waitlist.
    • When nothing is available, users can join a waitlist.
    • When held seats come back (hold or payment expiry, cancellation), waitlisted users should be offered them automatically in a fair order.
    • Decide how users are notified and how long they have to claim an offer.
  5. Correctness. Describe how you prevent two buyers from getting the same seat across many servers, how you resolve races, and which consistency guarantees you offer.
  6. Scale. The system must scale horizontally. Consider the access patterns for browsing, seat selection, holding, checkout and ticket issuance, and propose a data model and storage strategy for events, seats, holds, and orders.
  7. Components and APIs. Name the main services (e.g. gateway, catalog, inventory/hold service, payment integration, waitlist) and sketch the key endpoints: search events, fetch seat map, create hold, pay, cancel hold, join waitlist.

What to cover

Walk through the design end to end: data modeling, concurrency control, hold expiry, payment-provider integration, waitlist behavior, and how you would test and monitor it in production.

Hints

Hint 1

A 50k-seat venue cannot serve 500k simultaneous buyers. Think about how to throttle or queue users before they ever reach the database that owns seat state.

Hint 2

Make the database row the arbiter: a single conditional update that only succeeds when the seat is free (or its hold has lapsed). Think about what happens if the background expiry job runs late.

Hint 3

Consider what happens when a payment completes right around the hold deadline. A dedicated 'payment in progress' seat state that expiry logic ignores, plus authorize-then-capture and a reconciler for unknown outcomes, closes this gap.