Design ticketing system with seat hold
MetaSoftware Engineer · OnsiteLast updated
This question evaluates a candidate's skills in system design, distributed systems, concurrency control, data modeling, and scalability, testing their ability to reason about correctness and performance under high contention and heavy traffic as well as trade-offs between consistency and availability.
Design an online ticketing system (similar to Ticketmaster) that allows users to browse events, select seats, and place a temporary 5-minute hold on seats while they complete the purchase.
The system should:
- Allow users to search for events, view seating charts, and select specific seats.
- Allow a user to place a 5-minute hold on selected seats so they are not sold to others during that time.
- Automatically release held seats if the user does not complete payment within 5 minutes.
- Ensure that no two users can successfully purchase the same seat.
- Scale to handle very high traffic during popular events (e.g., tens of thousands of concurrent users for a big concert).
Describe:
- The main use cases and external APIs.
- The high-level architecture and key components.
- The data model for events, seats, orders, and seat holds.
- How you will implement the 5-minute hold and its expiration.
- How you will handle high concurrency and prevent overselling seats.
- Consistency and availability trade-offs, and how you would scale the system.
Assume this is an internet-scale service deployed across multiple servers and data centers.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.