KatInterview

Designing a Flash-Sale Ticketing Platform Without Overselling

System DesignModel answer
HardModel answerSystem Designsystem-designconcurrencydistributed-systems

Last updated

Design a worldwide ticketing service that survives on-sale stampedes, gives fast seat-map reads, and guarantees every seat is sold to at most one buyer.

Design a Ticketing Platform for High-Demand Sales

You are asked to design a worldwide ticketing service for concerts and sporting events. When a popular event opens sales, millions of people arrive at nearly the same moment, but only a small number of seats exist.

What the system must do

  1. Let people discover events by place, date range, and category.
  2. Show which seats are still free, with near-real-time freshness.
  3. Let a buyer place a temporary hold on seats (for example 10 minutes) while they pay.
  4. Never let one seat end up with two buyers.

Quality goals

  1. Seat browsing and selection should be fast and stay available under load.
  2. Booking must be strongly consistent so overselling is impossible.
  3. The platform must absorb sudden surges (the thundering herd) without collapsing.

What to cover

  • The API for selecting seats and completing a purchase.
  • Your choice of storage (relational vs. NoSQL) and the reasoning behind it.
  • How you handle concurrent writers during hold and checkout.
  • How you serve a huge volume of simultaneous seat-map reads.

State your assumptions about scale, call out trade-offs, and explain what happens on failures such as payment errors or expired holds.

Hints

Hint 1

Estimate the numbers first: successful writes are capped by the seat count, while read traffic is effectively unbounded. How does that asymmetry shape the architecture?

Hint 2

Make the hold a single atomic conditional write on the seat row (available or expired-hold becomes held), and let the database's row locking decide the winner. Think about what role a unique constraint plays as a last line of defense.

Hint 3

Separate the paths: serve layouts from a CDN, availability from a cache with short TTLs and pushed deltas, and put a queue or admission token in front of the booking API so only a controlled rate of users reaches the database.

Hint 4

Payment is slow and can fail. Model checkout as a state machine with idempotency keys, and authorize payment before committing inventory, capturing afterwards.