Design a Flight Ticket Booking System
Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2023-10-15
Problem Statement
Design a scalable, highly available, and fault-tolerant Flight Ticket Booking System that enables users to search, compare, and book flights across multiple airlines. The system must handle real-time seat availability, payments, and cancellations, while ensuring consistency across distributed services and the ability to scale for peak travel demand.
🔶 Functional Requirements
1.Search & Discovery
•Users can search for flights by origin, destination, date, passengers, and class.
•Support filters (price, duration, airline, layovers).
•Display real-time pricing and seat availability.
2.Booking Flow
•Select a flight and reserve seats.
•Passenger details entry and validation.
•Payment gateway integration (cards, wallets, UPI, BNPL, loyalty points).
•Generate and issue booking confirmation (PNR).
3.Ticket Management
•View, download, and share e-tickets.
•Modify bookings (date change, upgrade).
•Cancellations & refunds.
•Handle overbooking scenarios.
4.Airline & Partner Integration
•Connect with multiple airline APIs/GDS (Amadeus, Sabre, etc.) for live inventory.
•Support for codeshare flights and partner airlines.
5.User & Profile Management
•User accounts with saved preferences, loyalty programs, and past bookings.
•Notifications for reminders, cancellations, reschedules.
6.Admin & Operations
•Airline/agency dashboards for managing schedules, fares, and cancellations.
•Fraud detection in bookings and payments.
🔶 Non-Functional Requirements
•Scalability: Must handle millions of daily searches and bookings.
•Availability: 99.99% uptime SLA, especially during peak holiday seasons.
•Consistency: Seat inventory and payments must be strongly consistent.
•Latency: Search results should load in <2 seconds.
•Reliability: Ensure booking confirmation even under airline API delays/failures.
•Security: PCI-DSS compliance for payments, PII encryption, fraud detection.
🔶 Constraints
•Inventory must remain real-time synchronized with airline systems.
•Large query load during peak times (sales, holidays).
•Must support multiple payment providers for global customers.
•Cancellations and refunds may involve asynchronous workflows.
•Data privacy laws (GDPR, etc.) must be adhered to.
🔶 Example Use Cases
1.A user searches for flights from Delhi → New York with 2 stops, filtered by price.
2.A traveler books a round-trip ticket and pays using a credit card.
3.A family modifies their return flight due to schedule changes.
4.A traveler cancels a booking and gets a partial refund.
5.During peak hours (Black Friday sale), the system handles millions of concurrent searches.
👉 Summary:
"Design a highly available, scalable Flight Ticket Booking System that supports real-time flight search, booking, cancellations, payments, and partner airline integrations, while ensuring consistency, fault tolerance, and secure handling of sensitive data."