A Movie Ticket Booking System is a software application that enables users to search for movies, view showtimes, select seats, and book tickets at cinemas or multiplexes.
In this chapter, we will explore the low-level design of a movie ticket booking system in detail.
Let's start by clarifying the requirements:
Before starting the design, it's important to ask thoughtful questions to uncover hidden assumptions and better define the scope of the system.
Here is an example of how a conversation between the candidate and the interviewer might unfold:
Candidate: Should the system support only booking tickets, or should it also manage movie scheduling, theaters, and screens?
Interviewer: It should handle the entire flow—movie listing, show scheduling, screen management, and ticket booking.
Candidate: Can a movie play in multiple theaters and have multiple shows at different times and screens?
Interviewer: Yes, a single movie can run in multiple theaters and across multiple screens with different showtimes.
Candidate: Do we need to support movies in multiple languages.
Interviewer: Lets assume all movies are in the same language (ex. english)
Candidate: Should users be able to select specific seats, or should the system assign them automatically?
Interviewer: Users must be able to select specific seats from a seat map during the booking process.
Candidate: Should the system support different seat types such as ‘Standard’, ‘Premium’, and ‘Recliner’, with variable pricing?
Interviewer: Yes, each screen can have multiple seat types with different pricing.
Candidate: Should we support multiple cities and allow users to filter shows based on location?
Interviewer: Yes, the system should support multiple cities and allow users to search and filter by city, movie, and date.
Candidate: Do we need to handle payment processing and refund flows?
Interviewer: You can assume payment is handled externally. Treat it as a successful step. For this version, we can skip refund logic and just support booking cancellations.
Candidate: How should seat locking be handled to prevent race conditions when multiple users try to book the same seat?
Interviewer: Good question. The system should temporarily lock selected seats during the booking process to avoid double booking. If payment isn't completed within a specific timeout, the seats should be released.
After gathering the details, we can summarize the key system requirements.
After the requirements are clear, lets identify the core entities/objects we will have in our system.