BookMyShow App

Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2025-03-30

Problem Statement

BookMyShow is an online platform that allows users to browse movies, select theaters and showtimes, and book movie tickets.


Design the Low-Level Design (LLD) for the core booking module of such a system.


🎯 Problem Statement


Design and implement the core classes and relationships required to support a Movie Ticket Booking Application like BookMyShow.


The system should allow:

1.Users to browse movies currently running in theaters.
2.Users to select a movie, city, theater, showtime, and seat(s).
3.Booking of selected seats and generation of a ticket.
4.Prevention of double-booking the same seat.
5.Optional cancellation and refund flow.


✅ Functional Requirements

Movie Management

•Add, update, and view movies playing in different cities.
•Each movie has attributes like title, genre, language, duration, and rating.

Theater and Show Management

•Each theater can host multiple screens.
•Each screen has multiple shows scheduled at specific times.
•Each show has a defined set of seats.

Seat Selection & Booking

•Users can view available seats for a show.
•Users can select multiple seats and confirm booking.
•System must prevent multiple users from booking the same seat simultaneously (handle concurrency).

Payment

•Once seats are locked, users can make payment to confirm booking.
•Upon successful payment, the booking is finalized, and tickets are generated.

Booking History

•Users can view their past and upcoming bookings.

Cancellation (Optional)

•Users can cancel tickets within allowed policy time and get refunds.


⚙️ Non-Functional Requirements


Aspect with Description


Scalability

Should support large numbers of users booking simultaneously.


Concurrency Control

Prevent race conditions while booking seats.


Consistency

Seat status should accurately reflect real-time availability.


Extensibility

Design should allow adding new features like offers, snack combos, etc.


Performance

Seat lookup and availability should be fast and efficient.


🧱 Key Entities / Classes (for LLD)


•User
•Movie
•City
•Theater
•Screen
•Show
•Seat
•Booking
•Payment
•Ticket
•SeatLockManager (for concurrency)
•PaymentService (stub or interface)


💬 Example Scenario ---------------


A user in Bangalore opens the BookMyShow app → selects “Inception” → chooses PVR Orion Mall → 7 PM show → selects 2 seats → pays → receives booking confirmation and tickets.


💡 Interview Discussion Points

•How to handle seat locking (using SeatLockManager) to avoid double booking?
•How would you model relationships (e.g., Movie → Show → Seat)?
•What are the states of a seat (AVAILABLE, LOCKED, BOOKED)?
•How would you extend the design for concerts or sports events?
•How to ensure atomicity in the booking process?
•How to separate concerns between UI, business logic, and storage layers?


🧠 Sample Extension Ideas

•Add support for discounts or offers.
•Add notifications for successful booking or cancellation.
•Add support for multiple payment gateways.
•Add admin portal to manage shows and theaters.


🧾 Final Interview Prompt

Design the LLD for a movie ticket booking system like BookMyShow.
The system should allow users to browse movies, select shows, choose seats, and book tickets.
Ensure proper modeling of entities, handle concurrency during seat booking, and design the flow for locking, payment, and confirmation.


Solution

Comments