KatInterview

Event Seat Reservation System with Timed Locks

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsconcurrencyconsistency

Last updated

Design a high-traffic event ticketing platform with temporary seat reservations, automatic expiration, and zero overselling under concurrent access.

You are building a large-scale event reservation platform where users can browse concerts and sporting events, view seating maps, and reserve specific seats.

The platform must support:

  • Event search and browsing with live seat availability
  • Temporary seat reservations: when a user selects seats, they are locked for exactly 5 minutes
  • Automatic lock release if payment is not completed within the time window
  • Guaranteed prevention of double-booking (the same seat cannot be sold to two customers)
  • Performance under extreme load: tens of thousands of users competing for inventory during popular on-sales

Design this system end-to-end. Address:

  1. Core use cases and API surface
  2. Architecture and main components
  3. Data model for events, inventory, reservations, and orders
  4. Reservation mechanism: how locks are acquired, enforced, and expired
  5. Concurrency control: techniques to prevent race conditions and overselling
  6. Consistency vs. availability tradeoffs, and how the system scales across multiple servers

Assume internet-scale deployment with distributed infrastructure.

Hints

Hint 1

Think about the difference between browsing (read-heavy, tolerates staleness) and booking (write-heavy, requires strong consistency).

Hint 2

Database row-level locks and conditional updates can enforce single-seat atomicity. How do you make multi-seat reservations all-or-nothing?

Hint 3

Consider both lazy expiration (check at access time) and active cleanup (background workers) for releasing timed locks.