As reported: Zscaler Senior Staff / Staff SDE loop (2026), round 3: a low-level design problem along the lines of "Design BookMyShow". The interviewer wanted design patterns, extensible code and SOLID principles. The same round also covered how you use AI and how you prioritize and estimate work.
Design the core of a movie ticket booking system: shows with a grid of seats, users picking seats, a short hold while they pay, and a confirmed booking — without ever selling a seat twice. Walk through the requirements, entities and classes, then implement the booking core.
The code runner tests this interface (time is passed in explicitly):
BookingSystem(holdTimeout)— a hold keeps its seats forholdTimeouttime units unless confirmed.addShow(showId, rows, cols)→true, orfalseif the id exists or a dimension is not positive.availableSeats(showId, timestamp)→ the number of seats neither booked nor held by an active hold;-1for an unknown show.hold(showId, userId, seats, timestamp)→ a new hold id (1, 2, 3, … in creation order) for the list of[row, col]seats, or-1if the show is unknown, the list is empty, a seat is out of range or listed twice, or any seat is booked or actively held. All or nothing.confirm(holdId, userId, timestamp)→trueif the hold exists, belongs touserId, is still active and not yet confirmed; its seats become booked.cancelBooking(holdId, userId)→trueif that hold is a confirmed booking ofuserId; its seats become free.
A hold created at time t is active while timestamp − t < holdTimeout. An expired hold frees its seats and can no longer be confirmed.
Example
BookingSystem(300); addShow("show1", 2, 3)
hold("show1", "alice", [[0,0],[0,1]], 0) -> 1
hold("show1", "bob", [[0,1],[0,2]], 10) -> -1 ([0,1] is held by alice)
availableSeats("show1", 20) -> 4
confirm(1, "alice", 100) -> true
hold("show1", "carol", [[1,0]], 150) -> 2
availableSeats("show1", 500) -> 4 (carol's hold expired at 450)
hold("show1", "bob", [[1,0],[1,1]], 500) -> 3
cancelBooking(1, "alice") -> true
availableSeats("show1", 510) -> 4
Code runner format: LeetCode design format — the method names and their arguments as two JSON lines; the runner prints every result (null for the constructor).