Get your boarding pass

Selling tickets without selling a seat twice: a system design interview question

A ticketing site crashes and double-books seats when a popular show goes on sale. Design for the spike. It is a senior-level question of about 45 minutes, and it starts from a system that already works, which is how many real design interviews begin.

How do I approach the selling tickets without selling a seat twice question?

To design ticket booking, make seat reservation atomic with a conditional update, model seats as available, held with an expiry, or sold, and release expired holds. Protect the system with a virtual waiting room, serve seat maps from a cache, and make payment idempotent.

Practise this design interview

The situation

A ticketing site has a web server and one database. A seats table has a status column (available, sold). When a hit show goes on sale the site slows to a crawl, and twice last month two customers were sold the same seat.

What you are asked to design

Design booking for a sale where 500,000 people arrive within a minute for 20,000 seats. Seats must never be sold twice, people should hold a seat while they pay for a few minutes, the site must stay up under the spike, and the experience should be fair.

Questions worth asking first

Is seating reserved by seat, or general admission by section?

How long can someone hold a seat while paying, and what happens when the hold expires?

Is fairness important (a queue by arrival), or is speed enough?

Can we refuse or delay people to protect the system?

Where interviewers dig

Correctness of a seat reservation under concurrency: transactions, row locks, conditional updates.

Holds with expiry, and releasing seats when payment fails.

A waiting room or queue that sheds load in front of the booking path.

What a strong answer covers

Makes the reservation atomic in the database: a conditional update or a unique constraint, not a read-then-write.

Models three states (available, held with an expiry, sold) and releases holds with a timeout and a background sweep.

Protects the system with a virtual waiting room that admits people at a rate the booking path can serve, and explains fairness.

Separates the heavy read load (seat maps) and serves it from a cache, with the write path small; makes payment idempotent and reconciles after failures.

Traps that cost points

Checking that a seat is free, then marking it sold in a second statement.

Holding a database transaction open while the user pays.

Letting 500,000 people hit the seat map and the booking endpoint at the same time.

How the practice works here

It works on a laptop or desktop, not on a phone: the canvas and the interviewer's view of your drawing need the screen space.

You talk with the interviewer by voice, and the canvas already shows the company's system as it is today. You extend it, and the interviewer sees what you draw. A button pauses your microphone when you want to think or sketch in silence; the interviewer waits.

When the time is up you get a report: a hire or no-hire call for the level, ratings for problem navigation, solution design, technical depth and communication with a quote from your own answer for each, what to fix, and the points a strong answer covered that yours did not. Your first interview on giveinterview, of any kind, is free, and every interview report is free. After that a design interview costs credits at the same per-minute rate as a role interview, and playing duels earns credits you can spend on it.

Frequently asked questions

How long is this design interview?

About 45 minutes, the length of a typical senior-level design round.

Can I do it on my phone?

No. System design practice needs a computer screen for the canvas, so it is for laptops and desktops only.

Do I have to draw?

Yes. The canvas starts with the current system and the interviewer sees what you add, as at a whiteboard. You can pause your microphone to sketch and explain afterwards.

Is it free?

Your first interview on giveinterview, of any kind, is free, and every interview report is free. After that a design interview costs credits at the same per-minute rate as a role interview, and playing duels earns credits you can spend on it.

Keep reading