Design Movie Ticket Booking System

Difficulty: Hard Source: awesome-low-level-design

Requirements

  1. View movies in different theaters
  2. Select movie, theater, showtime
  3. Display seating, choose seats
  4. Make payment and confirm
  5. Handle concurrent bookings, real-time seat updates
  6. Different seat types and pricing
  7. Admin management of movies/shows
  8. Scalable

Class Diagram

Class Diagram


Classes, Interfaces and Enumerations

Class/Interface Description
Movie Id, title, description, duration
Theater Id, name, location, shows list
Show Id, movie, theater, start/end time, seat map
Seat Id, row, column, type, price, status
SeatType Enum: normal, premium
SeatStatus Enum: available, booked
Booking Id, user, show, seats, total price, status
BookingStatus Enum: pending, confirmed, cancelled
User Id, name, email
MovieTicketBookingSystem Singleton; ConcurrentHashMap

Design Patterns Used

Pattern Application
Singleton MovieTicketBookingSystem ensures centralized booking coordination and prevents double-booking of seats

Code Implementations

Language Source Code
Java View on GitHub
Python View on GitHub
C++ View on GitHub
C# View on GitHub
Go View on GitHub