Practice/Meta/Design a Ticket Booking System
Design a Ticket Booking System
Product DesignMust
Problem Statement
Design a comprehensive ticket booking system similar to Ticketmaster that enables users to discover events, purchase tickets, and manage reservations. The system must support multiple event types including concerts, sports games, and theater performances with both assigned seating and general admission ticketing models.
Your design should handle extreme traffic spikes when popular events go on sale, prevent double-booking of seats, provide fair access during high-demand scenarios, and ensure a smooth user experience from event discovery through payment completion. The system should support millions of users browsing events daily, with peak loads of hundreds of thousands of concurrent users attempting to purchase tickets when major events launch. Consider how to maintain consistency guarantees while providing low-latency responses during these critical booking windows.
Key Requirements
Functional
- Event Management -- organizers can create events with venue layouts, pricing tiers, and sale dates
- Search and Discovery -- users can search events by location, date, category, and artist/team
- Seat Selection -- for reserved seating, display available seats and allow selection with temporary holds
- Booking Flow -- handle ticket locks during checkout, payment processing, and confirmation
- Queue Management -- implement waiting rooms for high-demand events to control traffic
- Order History -- users can view past purchases and receive digital tickets
Non-Functional
- Scalability -- support 500K concurrent users during peak sales, 10M+ daily active users
- Reliability -- 99.9% uptime with no double-booking under any failure scenario
- Latency -- seat availability checks under 200ms, booking completion under 2 seconds
- Consistency -- strong consistency for inventory management, eventual consistency acceptable for search
- Fairness -- ensure equitable access during high-demand sales without favoritism
What Interviewers Focus On
Based on real interview experiences, these are the areas interviewers probe most deeply:
1. Concurrency Control and Inventory Management
This is the core challenge of any booking system. Interviewers want to see how you prevent race conditions when thousands of users try to book the same seat simultaneously. Your approach to locking, timeouts, and handling abandoned carts directly impacts user experience and revenue.
Hints to consider:
- Discuss optimistic vs pessimistic locking strategies and when each applies
- Consider time-based locks on seats during checkout with automatic release mechanisms
- Explore database-level approaches like SELECT FOR UPDATE vs application-level distributed locks
- Think about how to handle partial failures where locks succeed but payment fails
2. Traffic Management for Flash Sales
When a Taylor Swift concert goes on sale, you might see 1M+ users hitting your system in seconds. Interviewers expect you to discuss queue systems, rate limiting, and how to provide transparent wait time estimates without overwhelming backend services.
Hints to consider:
- Virtual waiting room patterns with token-based entry to the actual booking system
- CDN strategies for serving queue pages vs dynamic inventory checks
- Load shedding and circuit breaker patterns to protect core services
- Fair queuing algorithms (FIFO vs randomized selection) and their tradeoffs
3. Data Consistency Across Distributed Services
The system involves multiple services (inventory, payments, notifications) that must stay synchronized. Interviewers probe your understanding of distributed transactions, eventual consistency patterns, and how to handle failures during multi-step booking flows.
Hints to consider:
- Two-phase commit vs Saga pattern for distributed transactions
- Idempotency guarantees for payment operations and ticket generation
- Event sourcing to maintain audit trails of all inventory changes
- Compensation logic when payment succeeds but ticket allocation fails
4. Database Design and Partitioning Strategy
With millions of events and billions of tickets over time, how you structure and partition data determines query performance. Interviewers want to see thoughtful schema design and sharding strategies that support both operational queries and analytics.
Hints to consider:
- Separate hot vs cold data (active events vs historical bookings)
- Partition strategies: by event ID, by venue, or by time range
- Denormalization trade-offs for search performance vs consistency
- Caching layers for seat maps and real-time availability
Suggested Approach
Step 1: Clarify Requirements
Start by understanding the scope and constraints with your interviewer:
- Event types: Are we supporting only seated venues or also general admission festivals?
- Scale expectations: How many events active simultaneously? Peak booking rate?
- Ticket types: Single tickets, group bookings, season passes, or bundle deals?
- Geographic scope: Single region or global with different time zones and currencies?
- Refunds and transfers: Do users need to resell or transfer tickets?
- Mobile vs web: Does the design need to account for mobile app constraints?
- SLA requirements: What's acceptable downtime? Can we drop requests under extreme load?