Design Flight Booking and Voting Systems
Hot Agent StartupSoftware Engineer · OnsiteLast updated
This question evaluates system design competencies including large-scale backend architecture, data modeling and indexing, database internals, concurrency control to prevent overselling, and high-throughput real-time streaming and metrics for live updates.
Answer both system design prompts.
Part A: Flight Ticket Booking System
Design the backend for a flight ticket booking product. The system should support searching flights, selecting an itinerary, booking tickets for passengers, and preventing overselling.
Cover the following:
- Data model for entities such as
Flight,Passenger, andFlightTicketorBooking. - Indexes to build and why.
- How B-tree indexes work internally and how that affects query design.
- End-to-end user experience flow and the backend queries for booking a flight.
- How to avoid double booking when many users try to buy the same flight or seat concurrently.
Part B: Real-Time High-QPS Voting System
Design a real-time voting system for a fast-food promotion during a major live event. Users can quickly tap to vote for a taco flavor and should see a live results board.
Requirements:
- Traffic may reach a few million votes per second for a short burst.
- The vote action should have low latency.
- The results board should update in near real time.
- The design should be reliable under sudden traffic spikes.
Cover the following:
- APIs, services, storage, and data flow.
- How to use Kafka or another durable streaming system.
- How to model real-time counters and time-series metrics.
- Relevant Kafka internals and time-series database internals.
- Deployment strategy on Kubernetes or EKS, including autoscaling.
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.