Skip to content
Low Level Design Mastery Logo
LowLevelDesign Mastery

Design a Movie Ticket Booking System

Design a movie ticket booking system that allows customers to search for movies, view showtimes, select seats, make bookings, and process payments.

Design a movie ticket booking system that allows customers to search for movies, view showtimes, select seats, make bookings, and process payments. The system should handle concurrent seat bookings, manage seat availability with different seat types and pricing, and support booking confirmation and cancellation.

In this problem, you’ll design a system that handles multiple theaters, movies, and shows, while ensuring that seat reservations are fair, atomic, and time-limited.


Design a system where users can browse movies, select shows in nearby theaters, and book specific seats while handling simultaneous requests gracefully.

Functional Requirements:

  • Search & Browse: View movies and available showtimes across different theaters and screens.
  • Seat Layout: Display available seats with row and number for a selected show.
  • Reservation: Temporarily reserve selected seats; prevent double booking through thread-safe operations.
  • Booking & Payment: Complete bookings by processing payment, transitioning seats from Reserved to Booked.
  • Cancellation: Support booking cancellation, releasing seats back to the Available pool.
  • Seat Types: Support different types (Regular, Premium, VIP) with specific pricing strategies.
  • Expiration: Automatically release reserved seats if payment is not completed within a time limit (e.g., 10 mins).
  • Social Features: Provide functionality to find adjacent seats for group bookings.
  • Notifications: Notify customers when previously unavailable seats become available.

Non-Functional Requirements:

  • Modular OOD: Clear separation of concerns between theaters, shows, seats, and bookings.
  • Concurrency: Absolute prevention of race conditions or double-bookings during seat selection.
  • Flexibility: Easy to add new pricing models, loyalty programs, or seat types.
  • Reliability: The core booking logic should be robust, testable, and maintainable.

The system coordinates between the BookingService, TheaterService, and PaymentProcessor.

Diagram
classDiagram
    class Theater {
        -String name
        -List~Screen~ screens
    }
    
    class Show {
        -Movie movie
        -DateTime startTime
        -Map~Seat, SeatStatus~ seats
        +getAvailableSeats()
    }
    
    class Booking {
        -String id
        -Show show
        -List~Seat~ seats
        -BookingStatus status
        +confirm()
        +cancel()
    }

    class Seat {
        -String id
        -SeatType type
        -double price
    }

    Theater "1" *-- "many" Screen
    Screen "1" *-- "many" Show
    Show "1" *-- "many" Seat
    Booking "1" o-- "many" Seat

Diagram

If two users click “Book” on the same seat at the same time, the system must only allow one to proceed.

Solution: Use Optimistic Locking or Distributed Locks. In a single-server setup, use a ConcurrentHashMap of seat locks. For a distributed system, use Redis to set a TTL lock on the seat ID.

If a user reserves a seat but their internet fails or they change their mind, that seat shouldn’t be “stuck” in a reserved state forever.

Solution: Implement a TTL (Time To Live) mechanism. When a seat is reserved, schedule a task (using a ScheduledExecutorService or a TTL in Redis) that releases the seat if the payment isn’t confirmed within 10 minutes.

Seats in the front row should cost more, and prices might increase as the showtime approaches.

Solution: Use the Strategy Pattern. Create a PricingStrategy that takes the SeatType and ShowTime as inputs. This allows you to change pricing logic (e.g., holiday surcharges) without touching the seat or show classes.


By solving this problem, you’ll master:

  • Resource Locking - Managing shared resources in high-contention scenarios.
  • State Management - Coordinating multi-step transaction flows.
  • Timeout Logic - Implementing robust expiration mechanisms.
  • Scalable Inventory - Modeling complex nested entities (Theater > Screen > Show > Seat).

Ready to see the full implementation? Open the interactive playground to access:

  • 🎯 Step-by-step guidance through the 8-step LLD approach
  • 📊 Interactive UML builder to visualize your design
  • 💻 Complete Code Solutions in Python, Java, C++, TypeScript, JavaScript, C#
  • 🤖 AI-powered review of your design and code

After mastering Movie Ticket Booking, try these similar problems: