solidcodersolidcoder
Explore Courses
solidcodersolidcoder

Practical courses for software engineering interviews — no gatekeeping, no fluff.

Company-wise Questions

  • Flipkart Machine Coding Questions
  • Swiggy Machine Coding Questions
  • Meesho Machine Coding Questions
  • Razorpay Machine Coding Questions

Machine Coding Tutorial

  • Machine Coding Tutorial

Explore

  • Courses
  • About
  • Privacy Policy
  • Terms

© 2026 solidcoder · Practical courses for software engineering interviews.

Built for the AI era — learn by doing.

Home/Machine Coding/Machine coding Tutorial/Movie Ticket Booking (BookMyShow) — Machine Coding Round
Chapters — Machine coding Tutorial▾

Movie Ticket Booking (BookMyShow) — Machine Coding Round

Machine Coding Round·Machine Coding Questions·Low Level Design5 min read·Sep 11, 2026

Machine coding round — design a BookMyShow-style movie ticket system: city-to-show browsing, timed seat holds, UPI/card/wallet payments and notifications.

Movie Ticket Booking (BookMyShow) — Machine Coding Round — Machine coding Tutorial
Machine coding round — design a BookMyShow-style movie ticket system: city-to-show browsing, timed seat holds, UPI/card/wallet payments and notifications.
Asked inBookMyShow

Design a movie ticket booking system that lets a user browse from city down to a specific show, pick seats visually, hold them briefly while paying, and book — all while staying correct when many users compete for the same seats at once.

What the round tests

This one tests whether you can model the browsing hierarchy (city → movie → cinema → show → seats) cleanly, while getting the trickier real-world behavior right: temporary seat holds that expire, and fair, race-free seat allocation when multiple users try to book the same seat simultaneously.

Objective

The primary objective is to design and implement a movie ticket booking system that supports browsing from city down to a show, visual seat selection with timed holds, and fair, race-free booking when many users compete for the same seats.

Data Model

The browsing flow is a hierarchy that narrows down to a single show's seat map.

Browsing hierarchy
Level
What it represents
City
A city where the system has one or more cinemas.
Movie
A movie currently released in that city.
Cinema
A specific cinema running that movie.
Show
A specific screening (movie + cinema + time).
Seat
An individual seat within a show's hall, either available, held, or booked.

Requirements

Two tiers of scope

The source splits requirements into functional (what the system does) and non-functional (how well it must do it) rather than basic-vs-bonus — kept as Part 1 and Part 2 here for consistency with the rest of this series.

Part 1 — Functional Requirements

Core functionality you must build and get working first.

Core flow
Requirement
Detail
List cities
The system lists every city where its cinemas are located.
Movies by city
Selecting a city shows the movies currently released there.
Cinemas & shows by movie
Selecting a movie shows the cinemas running it and their available shows.
Select a show
The user selects a show from a cinema to begin booking.
Seating arrangement
The system displays the seating layout of that cinema hall for the selected show.
Multi-seat selection
The user can select multiple seats of their choice.
Seat availability distinction
The seating layout must visually or logically distinguish available seats from already-booked ones.
Temporary hold
Selected seats are held for 5–10 minutes while the user completes payment, before the booking is finalized.
Payment
The user pays for held seats via UPI, credit/debit card, or wallet; confirming payment finalizes the booking and records the payment method.
Fairness under contention

The system must serve booking requests for contested seats in First In, First Out order — if two users race for the same seat, whoever's request was received first should win the hold, not whoever's request happens to be processed first by chance.

Part 2 — Non-Functional Requirements

Quality attributes, not features

These describe how the system must behave under load and failure, not new user-facing operations.

Quality attributes
Requirement
Detail
High concurrency
Many booking requests can target the same seat at the same instant; the design must resolve this fairly rather than arbitrarily, without corrupting seat state.
Security & ACID compliance
Booking operations must be secure and behave with atomicity, consistency, isolation, and durability — a seat hold or booking should never be left in a half-applied state.
Booking extensions
Requirement
Detail
Notifications
Notify the user on booking confirmation via email, WhatsApp, or SMS, plus a reminder before the show starts.
Cancellation
Allow cancellation until 30 minutes before the show starts; the cutoff window can differ per movie, with refunds to the original payment source.

Example Usage: Full Walkthrough

The source doesn't specify an exact command syntax, so here's one reasonable walkthrough exercising the browsing flow, seat holding, and concurrent contention.

1. Browse from city down to a show

> listCities()
["Bengaluru", "Mumbai", "Delhi"]

> listMovies(city: "Bengaluru")
["Interstellar Returns", "The Last Byte"]

> listCinemasAndShows(movie: "Interstellar Returns", city: "Bengaluru")
[
  { cinema: "PVR Forum", shows: ["18:00", "21:30"] },
  { cinema: "INOX Mantri", shows: ["19:15"] },
]

2. View the seating layout for a chosen show

> getSeatLayout(showId: "pvr-1800")
Row A: [A1:available, A2:available, A3:booked, A4:available]
Row B: [B1:available, B2:booked,    B3:available, B4:available]

3. Select seats — placed on hold

> holdSeats(showId: "pvr-1800", user: "alice", seats: ["A1", "A2"])
✅ Seats A1, A2 held for alice. Hold expires in 10 minutes.

4. A concurrent request for an overlapping seat is queued fairly

> holdSeats(showId: "pvr-1800", user: "bob", seats: ["A2", "A4"])   // arrives moments after alice's request
❌ Seat A2 is currently held by another user. Only A4 held for bob.
✅ Seat A4 held for bob. Hold expires in 10 minutes.

5. Alice pays via UPI and gets notified

> confirmBooking(showId: "pvr-1800", user: "alice", seats: ["A1", "A2"], payment: "UPI")
✅ Booking confirmed for alice: seats A1, A2 (paid via UPI).
📧 Email + WhatsApp sent to alice: booking confirmed for Interstellar Returns, PVR Forum, 18:00.

6. An expired hold releases its seats automatically

... 10 minutes pass with no confirmBooking call from bob for seat A4 ...

⏱ Hold on seat A4 for bob expired. Seat A4 is available again.
Result

Alice's hold on A1/A2 blocks Bob from holding A2 concurrently — his request is resolved fairly rather than racing silently — and once Alice pays, those seats are permanently booked. Bob's own hold on A4, left unconfirmed, expires cleanly and returns that seat to the pool, demonstrating both the concurrency-fairness and timed-hold requirements together.

Up next9/9
Part 2 · Machine Coding Questions
←
← Prev Chapter
Key-Value Store
5 min
Next Chapter →
Ecommerce Loyalty Program
5 min · continue reading
→

Enroll in machine coding mastery series

₹30,000₹3,00090% OFF
Enroll Now →

Use code SOLID50 · 3 years · 40+ lessons

On this page
  • Objective
  • Data Model
  • Requirements
    • Part 1 — Functional Requirements
    • Part 2 — Non-Functional Requirements
  • Example Usage: Full Walkthrough