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
, and
FlightTicket
or
Booking
.
-
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.