Scrivio Interview library
ScenarioAdvanced6 min read · updated 13 November 2026

A 60,000-seat stadium tour goes on sale at 10:00 with 900,000 people in the waiting room. In the first on-sale, seat-map requests reached 150,000 per second, hold attempts on popular sections failed 80 percent of the time, and row locks piled up in the seats table.

How would you redesign seat selection and inventory for the next on-sale so throughput stays high, contention stays low, and buyers get seats instead of errors?

We stop letting 900,000 people query and fight over the same rows. Buyers are admitted from the waiting room at the measured rate the inventory service can hold seats, the seat map comes from a snapshot refreshed every second or two, buyers choose a section, price and quantity while the server assigns adjacent seats, and each section is owned by a single allocator so holds in different sections never contend. Short holds during the peak and availability shown by tier keep seats moving and stop buyers chasing sold-out sections.

Why this question is asked

A big stadium on-sale is the hardest day a ticketing platform has: demand is fifteen times the supply, everybody arrives in the same minute, and every failed click is a person who blames the company on social media. The first on-sale failed in three connected ways, and the important insight is that they share a cause: too many people looking at and racing for the same few rows. Interviewers ask this to see whether we redesign the interaction, not only add servers. In this answer, we will diagnose the first on-sale, then work through admission control, the snapshot seat map, best-available allocation, partitioned inventory and hold tuning, with numbers for each.

1Diagnosing the First On-Sale

Start with the numbers. The stadium has 60,000 seats, and with an average of four tickets per order that is about 15,000 successful orders. Nine hundred thousand people waited for them, so roughly 98 percent were always going to leave without tickets. The system's job is to serve the 15,000 quickly and tell everyone else early and politely.

Instead, three things went wrong together. Every viewer's seat map ran a query against the seats table, which produced 150,000 queries per second on the same database that had to process holds. Every buyer saw the same attractive seats near the stage and clicked them, so 80 percent of hold attempts failed because somebody else had clicked first. And every one of those attempts took a row lock on the same hot rows, so locks queued behind each other and even successful holds became slow. Reads, collisions and locks all came from letting everyone touch the same data at once.

2Admitting Buyers at the Rate Inventory Can Serve

The waiting room, a queue page that holds people before the sale and lets them in a batch at a time, was admitting buyers based on a guess. We replace the guess with a measurement: in a load test, the inventory service sustains, say, 1,500 holds per second with p99 latency under 200 ms. That number, minus a safety margin, is the admission budget.

Notice what this means in practice. If an admitted buyer makes on average 1.5 hold attempts and spends about 4 minutes in checkout, admitting 600 buyers per second would already exceed the hold budget in the first seconds. So we admit gradually, for example 300 per second at first, and adjust the rate from live metrics of hold latency and remaining stock. When stock in the popular tiers runs out, the waiting room tells the remaining people immediately, which is kinder than letting them in to find nothing.

3Serving the Seat Map From a Snapshot

The seat map is the same for everyone at a given moment, so computing it per viewer is waste. A single process reads the seats table once every one or two seconds, builds a compact availability document per section, and publishes it to Redis and the CDN. Viewers read the snapshot; the database sees one query every second instead of 150,000.

But there is a catch: the snapshot may be two seconds old, so a seat shown as free may already be taken. That is acceptable because the snapshot is only a hint. The hold is still decided atomically at write time by the allocator, so a stale map can cause a polite 'just taken, here is a similar seat' message, never a double sale.

4Best-Available Allocation Instead of Clicking Seats

The biggest change is to the interaction. Instead of everyone clicking specific seats, the buyer chooses a section or price tier and a quantity, and the server assigns the best adjacent block that is free. Two buyers asking for 'four seats in lower bowl, tier 2' no longer collide, because the allocator simply gives them different blocks.

This removes most of the 80 percent failure rate, since failures came from many people aiming at the same visible seats. Buyers who care about a specific seat can still use the map later in the sale, when demand has dropped. The allocator also packs seats better, avoiding the single orphaned seats that remain unsold when buyers pick freely.

5Partitioning Inventory by Section

Now we remove lock contention. We split inventory by event and section, and give each section a single owner: one allocator process that holds that section's seats in memory, applies holds one at a time, and writes each decision to a durable log (for example a Kafka topic or a PostgreSQL table) before answering. Because one thread owns a section, there are no row locks to wait on, and holds in different sections run fully in parallel.

Step throughRedesigned on-sale path
  1. Waiting roomadmits buyers at the measured holds-per-second budget
  2. Seat map snapshotrebuilt every 1 to 2 s, served from Redis and the CDN
  3. Allocation APIsection, tier, quantity -> routed to the section's owner
  4. Section allocatorsone owner per section, in memory, single-threaded
  5. Durable log and databaseevery hold recorded before the reply; source for recovery

5 layers, from the top down. Step through them one at a time.

Each layer removes one cause of the first on-sale's failure.

With around 80 sections, the stadium has 80 independent allocators. If an allocator fails, a standby replays the durable log to rebuild its state in seconds and continues. An alternative with less new code is to shard the seats table by section so that each shard handles one part of the load; it keeps the conditional UPDATE design but spreads the hot rows apart.

6Keeping Seats Moving During the Peak

During the first minutes, holds should be short, for example 5 minutes instead of 8, and expired holds must return to the allocator within seconds, so seats abandoned by slow buyers reach the next buyer while demand is highest. We also show availability per tier ('lower bowl tier 1: sold out, tier 2: limited'), so buyers stop requesting sections that cannot satisfy them.

First on-sale and the redesign
ProblemFirst on-saleRedesign
Seat map load150,000 DB queries/sone snapshot every 1 to 2 s
Hold failures80% on popular sectionsserver assigns blocks, few collisions
Lockspiled up on hot rowsone owner per section, no row locks
Admissiona guessed ratemeasured holds per second
Sold-out tiersbuyers kept tryingtier availability shown

7Follow-up questions

Does best-available make buyers unhappy?

Some fans want a specific seat, so we offer best-available as the default during the peak and map selection later, when contention is low. Most buyers in a high-demand sale care about getting tickets in their price range more than about one seat, and being told 'no tickets' after five failed clicks is a much worse experience.

What happens to the in-memory allocator state if a node dies?

Each hold is appended to a durable log before the buyer is told, so a standby rebuilds the section by replaying the log from the last snapshot. Holds that were never acknowledged are lost, which is safe: the buyer sees an error and retries, and no seat was promised twice.

How do we test this before the next on-sale?

With a full rehearsal: synthetic buyers at the expected admission rate against production-sized inventory, including killing an allocator mid-sale. We confirm the holds-per-second budget, the time to rebuild a section, and that the waiting room adapts its rate from the live metrics.

8Conclusion

In this answer, we traced the first on-sale's failures to one cause: everyone reading and racing for the same rows. We admitted buyers at a measured holds-per-second budget, served the seat map from a snapshot refreshed every second or two, let the server assign best-available blocks so buyers stop colliding, partitioned inventory so each section has one owner without row locks, and kept seats flowing with short peak holds and tier availability.

What to say in the interviewAbout 90 seconds aloud

Open with

The first on-sale failed because 900,000 people were all reading and fighting over the same rows: every seat map hit the seats table, everyone clicked the same visible seats near the stage, and the row locks queued up.

Then, if they want more

With 60,000 seats and around four per order, we only have about 15,000 orders to give, so the goal is to serve those quickly and tell everyone else early. I would change five things.

First, the waiting room admits buyers at the rate the inventory service can actually hold seats, measured in a load test and adjusted from live latency and remaining stock, not a guess.

Second, the seat map is a snapshot rebuilt every one or two seconds and served from Redis and the CDN, so the database sees one query a second instead of 150,000; the hold is still checked atomically, so a stale map only causes a polite retry.

Third, during the peak buyers pick a section, tier and quantity and the server assigns adjacent seats, which removes most collisions. Fourth, inventory is partitioned by section with one owner per section, an in-memory allocator with a durable log, or a shard, so holds in different sections never contend.

Fifth, holds are shorter at peak, expired seats return within seconds, and availability is shown by tier so people stop chasing sold-out sections. Then I would rehearse the whole thing at full load before the sale.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "How would you redesign seat selection and inventory for the next on-sale so throughput...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/8b21edf34f/