Chaturmind
LearnDSASystem DesignDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth

Company

  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Chaturmind. All rights reserved.

Built for engineers who want to go deep.


← Low-Level Design & Design Patterns

OOP Fundamentals & SOLID Principles

  • Object-Oriented Design Refresher
  • Single Responsibility & Open/Closed
  • Liskov Substitution & Interface Segregation
  • Dependency Inversion

Creational Design Patterns

  • Singleton Pattern
  • Factory & Abstract Factory
  • Builder Pattern
  • Prototype Pattern

Structural Design Patterns

  • Adapter & Facade
  • Decorator Pattern
  • Composite & Proxy
  • Bridge & Flyweight

Behavioral Design Patterns

  • Strategy Pattern
  • Observer Pattern
  • Command Pattern
  • Template Method
  • State Pattern
  • Chain of Responsibility
  • Iterator & Mediator
  • Visitor Pattern

Machine Coding Exercises

  • Parking Lot — Requirements & Class Design
  • Parking Lot — Implementation
  • Elevator System — Requirements & Class Design
  • Elevator System — Implementation & Scheduling
  • Library Management System
  • Tic-Tac-Toe / Board Game Design
  • Chess Engine Design
  • Vending Machine Design
  • ATM System Design
  • In-Memory Rate Limiter
  • Thread-Safe LRU Cache
  • Connection Pool Design
  • Producer-Consumer Class Design
  • Movie Ticket Booking System
  • Hotel Reservation System
  • Airline Booking / Seat Selection System
  • Splitwise / Expense Sharing System
  • Design a Logging Framework
  • Design a Notification/Observer-Based Pub-Sub
  • Design a Cache with Pluggable Eviction Policy
  • Design Snake and Ladder
  • Design a Card Game Framework
  • Design an Inventory Management System
  • Restaurant Management System
  • Food Delivery Order Matching
  • Design a Shopping Cart & Checkout Flow
  • Design a Recommendation Engine
  • Design a Job Scheduler
  • Design a Circuit Breaker
  • Design a Distributed ID Generator
  • Design a Pub-Sub Message Broker
  • Design Twitter/X
  • Multi-Pattern Problem: Design a Ride Booking Class Model
  • Multi-Pattern Problem: Design a Food Ordering Class Model
  • Design an Authentication/Authorization Module
  • Design a Form/Survey Builder
  • Design a Meeting Room / Calendar Booking System
  • Design a Search/Filter Engine for an E-Commerce Catalog
  • Design a Voting/Polling System
  • Design a Retry Mechanism with Backoff
  • Design a Health Check Aggregator
  • Design a Feature Flag System
  • Design a Config Management Client
  • Design a Leader Election Algorithm
  • Design a Distributed Counter
  • Design a Bloom Filter
  • Design a Consistent Hashing Ring
  • Design a Distributed Tracing Library
  • Design a Metrics Collection Library
  • Design an Audit Logging Framework
  • Design a Plugin/Extension System
  • Design a Workflow Engine
  • Multi-Pattern Capstone: Design a Food Delivery App
Chaturmind
← Low-Level Design & Design Patterns

OOP Fundamentals & SOLID Principles

  • Object-Oriented Design Refresher
  • Single Responsibility & Open/Closed
  • Liskov Substitution & Interface Segregation
  • Dependency Inversion

Creational Design Patterns

  • Singleton Pattern
  • Factory & Abstract Factory
  • Builder Pattern
  • Prototype Pattern

Structural Design Patterns

  • Adapter & Facade
  • Decorator Pattern
  • Composite & Proxy
  • Bridge & Flyweight

Behavioral Design Patterns

  • Strategy Pattern
  • Observer Pattern
  • Command Pattern
  • Template Method
  • State Pattern
  • Chain of Responsibility
  • Iterator & Mediator
  • Visitor Pattern

Machine Coding Exercises

  • Parking Lot — Requirements & Class Design
  • Parking Lot — Implementation
  • Elevator System — Requirements & Class Design
  • Elevator System — Implementation & Scheduling
  • Library Management System
  • Tic-Tac-Toe / Board Game Design
  • Chess Engine Design
  • Vending Machine Design
  • ATM System Design
  • In-Memory Rate Limiter
  • Thread-Safe LRU Cache
  • Connection Pool Design
  • Producer-Consumer Class Design
  • Movie Ticket Booking System
  • Hotel Reservation System
  • Airline Booking / Seat Selection System
  • Splitwise / Expense Sharing System
  • Design a Logging Framework
  • Design a Notification/Observer-Based Pub-Sub
  • Design a Cache with Pluggable Eviction Policy
  • Design Snake and Ladder
  • Design a Card Game Framework
  • Design an Inventory Management System
  • Restaurant Management System
  • Food Delivery Order Matching
  • Design a Shopping Cart & Checkout Flow
  • Design a Recommendation Engine
  • Design a Job Scheduler
  • Design a Circuit Breaker
  • Design a Distributed ID Generator
  • Design a Pub-Sub Message Broker
  • Design Twitter/X
  • Multi-Pattern Problem: Design a Ride Booking Class Model
  • Multi-Pattern Problem: Design a Food Ordering Class Model
  • Design an Authentication/Authorization Module
  • Design a Form/Survey Builder
  • Design a Meeting Room / Calendar Booking System
  • Design a Search/Filter Engine for an E-Commerce Catalog
  • Design a Voting/Polling System
  • Design a Retry Mechanism with Backoff
  • Design a Health Check Aggregator
  • Design a Feature Flag System
  • Design a Config Management Client
  • Design a Leader Election Algorithm
  • Design a Distributed Counter
  • Design a Bloom Filter
  • Design a Consistent Hashing Ring
  • Design a Distributed Tracing Library
  • Design a Metrics Collection Library
  • Design an Audit Logging Framework
  • Design a Plugin/Extension System
  • Design a Workflow Engine
  • Multi-Pattern Capstone: Design a Food Delivery App
HomeLearnSystem DesignLow-Level Design & Design PatternsMachine Coding Exercises
✓ FreeIntermediate· 6 min read

Airline Booking / Seat Selection System

Flight/Seat/Booking/FareClass classes reusing Movie Ticket Booking's seat-map and hold-expiry patterns, plus the class-design extension needed for multi-leg itineraries.

Published September 23, 2026


Airline Booking / Seat Selection System

Core classes

class Flight { String flightNumber; Airport origin, destination; Instant departure; List<Seat> seats; }
class FareClass { String name; double priceMultiplier; } // Economy, Premium, Business, First
class Seat { String seatNumber; FareClass fareClass; }
class Passenger { String name; String passportNumber; }
class Booking { List<Flight> legs; Map<Flight, Seat> seatAssignments; Passenger passenger; BookingStatus status; }

Reusing the seat-map and locking pattern

Seat selection and the double-booking risk here are structurally identical to Movie Ticket Booking System — seats are per-flight (not a permanent property of Seat), and selection needs the same temporary-hold-with-expiry pattern (a passenger selecting seat 14C shouldn't permanently lock it away if they abandon checkout). Recognizing this as the same underlying problem, not a new one, is worth stating explicitly in an interview — reapplying an already-designed solution is a stronger signal than re-deriving seat-locking from scratch a second time.

Extending to multi-leg itineraries

class Booking {
    List<Flight> legs; // e.g. [JFK->LHR, LHR->CDG] for a connecting itinerary
    Map<Flight, Seat> seatAssignments; // one seat assignment PER LEG — a passenger picks a different seat on each flight
}

The key design change: Booking holds a list of flights (legs), not a single Flight, and seat assignment becomes a map keyed by leg, since a passenger's seat on the first flight of a connection has nothing to do with their seat on the second. The seat-hold-and-confirm flow from a single-leg booking applies per leg independently — holding seat 14C on leg 1 and seat 22A on leg 2 are two separate hold operations, and a booking should only fully confirm once every leg's hold succeeds (an all-or-nothing multi-leg commit, conceptually similar to the atomicity concern Two-Phase Commit discusses at the distributed-systems level, just within a single booking transaction here).

Follow-up questions this topic invites — and their answers

Q: What happens if seat hold succeeds for leg 1 but fails for leg 2 (e.g. the flight fills up between requests)? A: The booking needs to roll back leg 1's hold too — a multi-leg booking should be all-or-nothing, not leaving a passenger with a confirmed seat on one leg of a trip they can't complete, which is exactly why the hold-then-confirm-all-or-release-all pattern matters more here than in the single-leg Movie Ticket case.

Q: How would FareClass pricing interact with dynamic, demand-based airline pricing? A: Similar to Hotel Reservation System's pricing discussion — priceMultiplier as a static field is a simplification; real airline pricing is highly dynamic (demand, days-to-departure, historical booking curves), which argues for a pluggable PricingStrategy rather than a fixed field, following the same Strategy pattern reasoning used throughout this course.

Q: Should seat assignment happen at booking time or be deferrable to check-in? A: Both are legitimate, different product decisions — some airlines assign seats at booking (matching this design directly), others allow booking without a specific seat and assign one at check-in (a different, simpler data model where Booking doesn't need seatAssignments until later) — worth naming as an explicit scope-clarifying question at the start of the exercise, per the Object-Oriented Design Refresher's scoping guidance.

Previous

Hotel Reservation System

Next

Splitwise / Expense Sharing System

AI Tutor

Lesson: Airline Booking / Seat Selection System

Quick actions

AI responses can be inaccurate. Verify critical information.