Interview Bootcamp

0% completed

Designing Ticketmaster

1. What is an online movie ticket booking system?

A movie ticket booking system provides its customers the ability to purchase theatre seats online. E-ticketing systems allow the customers to browse through movies currently being played and to book seats, anywhere anytime.

Try it yourself

Before looking at the solution, try designing it:

Designing Ticketmaster (video)

Here is a video discussing how to design Ticketmaster:

2. Requirements and Goals of the System

Our ticket booking service should meet the following requirements:

Functional Requirements:

1

.....

.....

.....

Like the course? Get enrolled and start learning!
V

Viktoria

· 3 years ago

How will ActiveReservationService know that some reservation has expired? Will it have some job scheduled to do regularly check?

J

Joe

· 3 years ago

As soon as I read:

Users should be able to put a hold on the seats for five minutes before they make a payment to finalize the booking.

The user should be able to wait if there is a chance that the seats might become available, e.g., when holds by other users expire.

Waiting customers should be serviced in a fair, first come, first serve manner.

I would of immediately asked if we could implement this a different way and would have almost taken this as a test as in: will the candidate give critical feedback to a design he sees as being flawed and/or overcomplicated.

My argument would be: From the clients side, the seats are either booked or they are not. When a client enters checkout, they purchase the tickets, then anyone that had those tickets in their cart are alerted that t

Show 1 reply
Dan Parrella

Dan Parrella

· 10 months ago

How is it possible to shard the database based on ShowID when there are so many other tables like Seats, Hall, and Movie? If we are sharding database servers, and we are using a relational database, then how would any of the entity relationships work?

Perhaps there are just missing details in the explanation?

P

Pramod Kumar

· 5 years ago

Hi Team, Like the way we are storing reservation first in booking table and then in the ActiveReservationService memory, Why cant we do the same for WaitingUsersService i.e have a new table for waiting service and then maintain the same in WaitingUserService memory. That way even if waiting user service crashes we can rebuild from table.

Show 1 reply
F

Furquan Amanat

· 5 years ago

Hello, I think I have confused myself a bit so needed clarification. The System Design is based off RDBMS DB like MySQL, correct? While the Reservation/Waiting service is looking up data in Key:Value pairing is in memory. Am I correct in the assumption?

if its SQL DB, how are we strengthening the availability? can this design be implemented in NoSQL db with normalized database, I understand that we may have to code for consistency exclusively; but would that be a good design decision if at all ?

Show 2 replies
H

harsha

· 3 years ago

The solution describes using transactional DB to ensure ACID properties for the transaction, especially isolation. However, the two services are working on in-memory maps to hold the seats. How can we ensure no two service instances are working on the same seats in the Map?

Show 1 reply
Andrew Sologor

Andrew Sologor

· a year ago

Store string statuses in your tables/documents, and use string enums. Do not use integers. A few bytes of optimization are not worth bad human readability.

I remember a dialogue I heard at the office at one of my past jobs:

- Did you find that broken order? - Yes. - What status does it have? - 5