AlgoViz

Design Ticketmaster

hard 55 min

Sell numbered seats to far more people than there are seats.

Explain your choices

Answer first. Then compare your reasoning.

12 questions 0 got it 0 to review12 not marked

Decisions

DecisionChoiceBecausePrice
Hold in Redis or rowRow83 a second, one truthSlower than memory
Wait or open doorWaiting room280 people for each seatPeople wait
Arrival or shuffleShuffle the lobbySpeed wins nothingSome dislike chance
Map fresh or cheapA second oldOne picture for allLost clicks
Charge or authoriseAuthorise firstNo money without a seatTwo provider calls
Keys in cache or databaseDatabaseThey must outlive retriesAbout 250M small values a year
Shard by whatEventA hold stays localMy orders need a copy

When they push back

They sayAnswer with
"A database cannot take this.""Not 1.5 million a second. It sees 83 holds and 28 orders, because the door is in front."
"Why not a distributed lock?""It can forget, and the row must decide anyway. I add it as a filter if tries reach thousands a second."
"Your line is only a nicer error page.""It keeps places and lets all seats sell. The other choice is a crash that sells none."
"Serializable everywhere?""It works. I check row counts instead and avoid retries."
"Ten minutes is long.""It is a number per event. Shorter sells faster and loses slow payers. I would measure abandoned holds."