Walkthrough: Ticket Booking With a Flash Sale

Topics Covered

Requirements and Numbers

The prompt

Scoping the functional requirements

Non functional requirements

The estimate

What the interviewer notes so far

What a weaker opening looks like

Writing it on the board

Why the interviewer asked about the on sale moment

Questions the candidate did not need to ask

Confirming the numbers with the interviewer

API and Data Model

The API

Why holds are a separate resource

The data model

Partitioning the seat data

General admission

What is deliberately missing

The state of the board

Reading the API back against the requirements

Choosing what the seat map returns

Indexes the store needs

Keeping the step short

The High Level Design

The normal path

Adding the waiting room

The seat map under load

Walking the main flow

What the design leaves for later

Checking in

Where the waiting room state lives

Normal days versus sale days

Static content and the content network

Deep Dive: Contention in the Flash Sale

Comparing the options

How the race is decided

The hottest seats

Hold expiry

What this deep dive showed

A deeper follow up

Measuring whether the design holds

Why not shard one event across partitions

Failures, Trade Offs and Wrap Up

Payment failures

Other failures

The trade offs

Extensions and evolution

The close

Looking back at the session

What made it strong

Common mistakes on this problem

Questions the interviewer might still ask

Practising this walkthrough

Comparing with your own attempt

Variations to try next

One last habit

This lesson and the two after it are worked walkthroughs. Each one takes a common interview problem and runs the whole framework on it, step by step, with the conversation shown as it might happen. The aim is to see how the pieces from earlier lessons fit together in a real session: how scoping leads to numbers, numbers to decisions, decisions to a deep dive and the deep dive to a wrap up. Read the dialogue as an example, not a script. Your own interview will go differently, but the shape should be similar.

The first walkthrough is a ticket booking system with a flash sale. It is a popular prompt because the product is simple to understand but hides one of the most instructive problems in system design: many people competing for a small number of identical resources at the same moment.

The prompt

The interviewer begins: design a ticket booking system, like the sites used to sell concert tickets. Users can browse events, choose seats and buy them. Some events sell out in minutes. The prompt is short and deliberately open. The candidate's first job is to turn it into a problem that can be designed in forty five minutes.

Scoping the functional requirements

Interview Dialogue

CandidateLet me make sure I understand the core flows. A user browses an event, sees a seat map, picks seats, holds them for a few minutes while paying, then completes the purchase. Is that the main path?
InterviewerClick to reveal answer
CandidateThere are a lot of related features: resale, recommendations, venue setup, promoters managing events. I would like to leave those out and focus on browse, hold and pay, especially when a popular event goes on sale. Does that work?
InterviewerClick to reveal answer
CandidateAre seats always assigned, or are there general admission tickets too?
InterviewerClick to reveal answer
Show all answers
Scope the ticketing problem to the flows where the difficulty lives.

In under a minute, the candidate has narrowed the problem to three flows and found out where the interviewer's interest lies: the on sale moment. That single answer shapes the rest of the session, because it tells the candidate that the deep dive will almost certainly be about contention.

Non functional requirements

Interview Dialogue

CandidateFor non functional requirements, the most important one is that no seat is ever sold twice. I would rather a buyer sees an error than two people get the same seat. Is that right?
InterviewerClick to reveal answer
CandidateSecond, during a big sale the system must stay up, even if it means making people wait. A slow, fair queue is better than a crash. Third, browsing should be fast, say the event page and seat map under a few hundred milliseconds normally. Fourth, a hold should last long enough to pay, around five minutes. And fairness: roughly first come, first served, though not necessarily perfect ordering.
InterviewerClick to reveal answer
CandidateThen I will note bot protection as a requirement on the waiting room, though I will not design the detection itself.
Show all answers

The candidate stated correctness first, because it is the requirement that decides the core mechanism. Availability under load came second, and the candidate already hinted at the answer: make people wait rather than fall over. The interviewer's comment about bots added a fairness requirement, which the candidate recorded and scoped.

The estimate

Interview Dialogue

CandidateLet me size a big on sale. Say a stadium with fifty thousand seats, and two hundred thousand people trying to buy in the first minute. If each buyer tries a hold two or three times as they lose races, that is about half a million hold attempts in a minute, or roughly eight thousand a second at the start, and much more concentrated on the best sections.
CandidateStorage is trivial: fifty thousand seat rows per event, maybe a hundred bytes each, so a few megabytes. Even thousands of events a year is small.
CandidateSeat map reads are the other heavy load. If every waiting buyer refreshes the map every few seconds, that is tens of thousands of reads a second for one event.
InterviewerClick to reveal answer
CandidateThat this is not a storage problem or a general scale problem. It is a contention problem: thousands of writes a second aimed at a few thousand rows, plus a read spike on one event. The design has to protect the seat store and decide races correctly.
Show all answers
The numbers show the problem is contention, not storage.

This is the estimate doing its job. The candidate did not compute daily active users or annual storage in detail, because those numbers would not change any decision. Instead they computed the numbers that matter for this problem: hold attempts per second during the sale and seat map reads per second. The conclusion, that this is a contention problem, sets up every decision that follows.

What the interviewer notes so far

After about six minutes, the interviewer has seen a candidate who scoped quickly, confirmed the area of interest, stated correctness and availability requirements precisely, added a requirement from a hint and produced an estimate that identified the core difficulty. That is a strong opening at any level. It also leaves plenty of time for the design and a deep dive, which is where most of the evaluation will happen.

What a weaker opening looks like

For contrast, a weaker opening might spend ten minutes listing features, including resale and promoter dashboards, compute total yearly ticket sales in detail and never say that the problem is contention. Nothing in it would be wrong. But the candidate would have used a quarter of the interview without producing a single decision, and the interviewer would still not know whether they understand the hard part.

Writing it on the board

Throughout this opening, the candidate writes the agreed points in a corner of the board: browse, hold, pay; no double selling; stay up under load, waiting is fine; seat map fast; hold five minutes; fairness and bots; fifty thousand seats, two hundred thousand buyers, about eight thousand holds a second peak. That short list will be pointed at again and again, whenever a decision needs justifying.

Why the interviewer asked about the on sale moment

The interviewer's answer, the on sale moment is what I care about, is a strong signal and worth reading carefully. It means the rubric for this problem almost certainly has a line about handling contention and load spikes, and that the deep dive will be judged mostly on that topic. A candidate who hears it should plan the session around it: keep browsing and account features brief, size the sale carefully in the estimate and protect at least ten minutes for the contention discussion. Hints like this one are the most valuable information you get in the first five minutes, and acting on them is a large part of what makes the rest of the interview go smoothly.

Questions the candidate did not need to ask

It is also instructive to notice which questions the candidate skipped. They did not ask about the number of registered users, the number of venues, the mobile platforms supported or the languages the site must serve. Each of these could matter in some version of the problem, but none affects how seats are held during a sale. Every question in the opening should either narrow the scope or produce a number or requirement that decides something. Questions that do neither use time and can make the candidate seem unsure where the problem lies.

Confirming the numbers with the interviewer

After the estimate, the candidate could add a short check: does fifty thousand seats and two hundred thousand buyers in the first minute sound like the right scale? Interviewers often have a scale in mind, and occasionally it is very different, such as a hundred thousand seats or a million buyers. Confirming takes five seconds, and if the interviewer gives a different number, the candidate can rerun the arithmetic quickly. The conclusion, a contention problem rather than a storage one, would hold at any of these scales, which is worth saying too.

Let the estimate name the problem

In ticketing, the useful numbers are hold attempts per second during the sale and seat map reads per second, not yearly totals. When the estimate ends with a sentence like this is a contention problem, it has done its job: every later decision now has a reason.

With the requirements and numbers agreed, the candidate moves to the API and the data model. In this walkthrough both are short, because the problem is not about complex queries or many entities. But they matter, because the data model is where the core mechanism, the seat hold, is defined.

The API

Interview Dialogue

CandidateI will keep the API to the core flows. GET events slash id returns event details. GET events slash id slash seats returns the seat map with each seat's status. POST holds with the event, the seat identifiers and an idempotency key creates a hold and returns a hold identifier and its expiry. POST holds slash id slash purchase with payment details and an idempotency key completes the purchase. DELETE holds slash id releases a hold early.
InterviewerClick to reveal answer
CandidateBecause buyers on bad connections, especially during a sale, will retry. Without a key, a retried hold might create two holds, and a retried purchase might charge twice. With the key, the server recognises the retry and returns the original result.
Show all answers

The API is five endpoints, stated in about thirty seconds. The interesting part is not the format but the semantics: holds are explicit resources with an expiry, and both writes carry idempotency keys. The interviewer's question gave the candidate a chance to explain why, which they did in two sentences tied to the conditions of a sale.

Why holds are a separate resource

Making the hold its own resource, rather than a flag on an order, has several benefits. It has a clear lifecycle: created, then either purchased, released or expired. It can carry an expiry time. It can hold several seats together, so a buyer choosing four seats in a row either gets all four or none. And it gives the purchase step something to refer to, so the purchase can check that the hold is still valid before charging.

The data model

Interview Dialogue

CandidateThe core table is seats: event id, seat id, section, row, number, price tier, status, hold id and hold expires at. Status is available, held or sold. The primary key is event id and seat id.
CandidateThen holds: hold id, event id, user id, seat ids, expires at, status and the idempotency key. And orders: order id, hold id, user id, amount, payment status and payment reference.
CandidateEvents and venues have their own tables, but they are read mostly and simple, so I will not detail them.
InterviewerClick to reveal answer
CandidateSo that the hold decision can be made by looking at one row. When someone tries to hold a seat, the update checks status is available, or status is held and the expiry has passed. That way an expired hold does not need to be cleaned up before the seat can be taken again.
Show all answers
Each seat is one row with a status and a hold expiry.

That last answer is the key insight of the data model. By storing the expiry on the seat row, the candidate made the availability check a single condition on a single row, which is what makes the conditional update in the high level design possible. Expired holds are effectively available the moment they expire, without waiting for a background job.

Partitioning the seat data

Interview Dialogue

InterviewerClick to reveal answer
CandidateBy event id. All seats for an event live together, which suits the seat map read and keeps each hold's rows on one partition, so a multi seat hold can be a single transaction. The total data is small, so the reason to partition is spreading write load across events, not size.
CandidateThe risk is that one huge event becomes one hot partition. I will come back to that in the deep dive, because it is the core of the flash sale problem.
Show all answers

The candidate chose the partition key from the access pattern, explained the benefit for multi seat holds and named the risk, a hot partition for a big event, without trying to solve it yet. Deferring it explicitly to the deep dive keeps the data model step short and signals that the candidate knows where the difficulty lies.

General admission

Interview Dialogue

CandidateFor general admission, there are no individual seats, just a count. I would model it as an inventory row per event and tier with a remaining count, and a hold decrements it with a conditional update that requires remaining to be at least the quantity. Expired holds add back to the count in a background job, since there is no per seat expiry to check.

The interviewer had mentioned general admission as a special case, and the candidate handled it in one breath, showing that the same pattern, a conditional update, applies with a different data shape. That brief mention covers the requirement without spending time on it.

What is deliberately missing

The candidate did not design tables for promoters, venues in detail, pricing rules or user accounts. Each could be discussed, but none affects the core mechanism. Saying so briefly, I am leaving venue configuration and pricing as simple reference tables, tells the interviewer that the omissions are deliberate.

The state of the board

After about twelve minutes, the board has the requirements and numbers in one corner, five endpoints in another and three tables with their keys. Everything needed for the high level design is visible, and the core mechanism, a conditional update on a seat row with an expiry, has already been introduced. The rest of the interview builds on it.

Reading the API back against the requirements

A quick way to check an API is to read it back against the requirements. No double selling: the hold endpoint creates holds that the store decides atomically, and the purchase endpoint checks the hold. Stay up under load: the endpoints are simple, and the waiting room will gate the hold endpoint. Fast browsing: the event and seat map reads are separate GET endpoints that can be cached. Hold duration: the hold response includes its expiry. Fairness: the waiting room token will be required on holds. Every requirement maps to something in the API or to a component still to come, which tells the candidate that nothing has been forgotten.

Choosing what the seat map returns

The seat map endpoint returns every seat with its status, which for a stadium is fifty thousand entries. At around twenty bytes each, compressed, that is roughly a megabyte, which is acceptable for a page that is loaded once and then refreshed. For refreshes, the endpoint could return only seats whose status has changed since a given version, which cuts the payload dramatically during the sale. Mentioning this in a sentence shows attention to the read load without turning the API step into a performance discussion.

Indexes the store needs

The seats table is accessed by event and seat for holds, and by event for the seat map, both served by the primary key. The holds table needs an index on expiry time for the cleanup worker and on the idempotency key for retries. The orders table needs an index on user for a buyer's order history. Naming these in one sentence confirms that the queries in the API are all efficient, which interviewers sometimes check directly.

Keeping the step short

The whole API and data model step took about six minutes. That is deliberate: the step must be present and correct, but the problem's difficulty lies elsewhere, so the candidate kept it compact and moved on while the interviewer was still engaged. A good sign of the right length is that each part of the step produced something used later.

Anything that did not feed a later decision was left out on purpose, which kept the step brisk and the interviewer's attention on the parts that mattered.

Put the expiry where the decision is made

Storing hold expiry on the seat row lets one conditional update decide availability: available, or held with an expiry in the past. Expired holds become available instantly, with no cleanup job on the critical path.

The high level design brings the requirements, the API and the data model together into a picture of the system. In this walkthrough, the candidate draws the normal path first, then adds what the flash sale needs, so that the interviewer can see which parts exist for everyday use and which exist for the sale.

The normal path

Interview Dialogue

CandidateClients go through a load balancer to a set of stateless booking service instances. Event pages and seat maps are read through a cache in front of the event and seat store. Holds and purchases go straight to the seat store, which is a relational database partitioned by event, with a replica per partition in another zone.
CandidatePayments go to an external payment provider. A small worker releases expired holds in the background and sends confirmation emails through a queue.
InterviewerClick to reveal answer
CandidateBecause a hold of several seats needs a transaction, and the conditional update needs a reliable compare and set on a row. Both are natural in a relational store. The data is small, so we do not need a store built for huge scale.
Show all answers

This is a compact normal path: five or six components, each with a reason. The candidate answered the database question with the two properties that matter, transactions and conditional updates, and noted that the data volume did not require anything more exotic.

Adding the waiting room

Interview Dialogue

CandidateNow the flash sale. If two hundred thousand buyers hit the booking service at once, the seat store for that event gets thousands of hold attempts a second on one partition. Rather than trying to scale that partition, I would put a waiting room in front.
CandidateWhen a big event goes on sale, buyers are placed in a virtual queue. The waiting room admits them to the booking flow at a controlled rate, say two thousand a minute, that we know the seat store can handle. Each admitted buyer gets a short lived token, and the booking service rejects hold requests without one.
InterviewerClick to reveal answer
CandidateIt helps it. The queue order is the fairness mechanism: people who joined earlier are admitted earlier. It is also where bot protection goes, since it is the single entry point. And buyers see their position, which is a much better experience than errors.
Show all answers
A waiting room, a booking service and a seat store, with a cached map.

The waiting room is the most important component in the design, and the candidate introduced it with its reason, the contention on one partition, and its benefits for fairness, bots and experience. Note that the candidate did not try to make the database handle unlimited load. Admission control is the classic answer to a demand spike that exceeds a resource's capacity, and recognising it is a sign of experience.

The seat map under load

Interview Dialogue

CandidateThe seat map is the other hot path. Buyers in the booking flow refresh it constantly. I would serve it from a cache, rebuilt from the seat store every second or two, rather than reading the seat store on every request.
InterviewerClick to reveal answer
CandidateYes, it can show a seat as available that was just held. That is a latency versus freshness choice, and it is safe because the map is only a hint. The hold itself always goes to the seat store with a conditional update, so a stale map can never cause an oversell. The worst case is that a buyer clicks a seat and gets a quick conflict.
Show all answers

This exchange shows a trade off stated in full: the choice, the reason, the cost and why the cost is acceptable. The candidate also separated two concerns that are easy to confuse: how fresh the display is, and how correct the sale is.

Walking the main flow

Interview Dialogue

CandidateLet me walk one purchase. A buyer joins the waiting room and is admitted with a token. They load the seat map from the cache and pick two seats. The booking service runs one transaction with two conditional updates on the event's partition. Both succeed, so it creates a hold with a five minute expiry and returns it.
CandidateThe buyer enters payment details. The booking service checks the hold is still valid, calls the payment provider with an idempotency key and, on success, marks the seats sold and the order paid in one transaction. A confirmation email goes on the queue.

Walking a single request through the design is a quick way to check that every step is connected and to give the interviewer a clear picture. It also surfaces the points where something could go wrong, which sets up the deep dive and the failure discussion.

What the design leaves for later

The candidate has deliberately left three questions open: exactly how contention is handled on the hottest seats, how holds expire and are cleaned up, and what happens when payment times out. Each will be covered in the deep dive or the failure discussion. Leaving them visible, rather than glossing over them, gives the interviewer a natural choice of where to go next.

Checking in

Interview Dialogue

CandidateThat is the high level design: a normal path with a cache and a partitioned relational store, plus a waiting room and a cached seat map for the sale. I would like to go deep on contention during the sale, how holds are decided and expired. Is that the right area, or would you prefer payments?
InterviewerClick to reveal answer
Show all answers

The check in at the end of the high level design confirmed the deep dive and made a plan for the remaining time. The candidate is now about twenty two minutes in, with more than twenty minutes for depth and failure handling.

Where the waiting room state lives

The waiting room needs to track the queue position of every buyer and the rate at which they are admitted. For two hundred thousand buyers, that is small: an ordered list in a fast in memory store, with each buyer's position keyed by a session identifier. Admission is a simple loop that takes the next batch from the head of the list every second. The buyer's client polls the waiting room for its position every few seconds, which at two hundred thousand buyers is tens of thousands of light reads a second, easily served from memory or a cache. If the in memory store fails, the queue can be rebuilt approximately from join times, and the waiting room can pause admission briefly while it recovers.

Normal days versus sale days

Most of the time, the system sells tickets for many small events at a gentle rate, and the waiting room is not needed at all. A sensible design enables it per event, either because the event is expected to be popular or automatically when traffic to an event crosses a threshold. This keeps the normal path simple and avoids making every buyer wait for no reason. Saying so shows that the candidate thinks about the system across its whole life, not only during its hardest minute.

Static content and the content network

Event pages, venue images and the static parts of the seat map, such as its layout, do not change during the sale. They should be served from a content delivery network close to users, leaving the origin to serve only the dynamic seat statuses. This removes a large part of the read load from the system at almost no cost, and it is the kind of easy win that is worth one sentence in the high level design.

Every component on the board now has a stated reason.

Admission control beats unlimited scaling

When demand for a resource exceeds its capacity by orders of magnitude for a short time, scaling the resource is usually the wrong answer. Admit work at a rate the resource can handle and make everyone else wait fairly. A waiting room protects the store, enforces fairness and gives a better experience than errors.

The deep dive is where the interview is decided. In this walkthrough the interviewer chose contention, which is exactly where the candidate expected the difficulty to be. The candidate now compares the main options for deciding who gets a seat, explains why the chosen one works, handles the hottest seats and covers hold expiry.

Comparing the options

Interview Dialogue

CandidateThere are three common ways to decide who gets a seat. First, pessimistic locks: lock the seat row, check it, update it, release. Second, a single queue per event: all hold requests go into one ordered queue, and one consumer decides each in turn. Third, conditional updates: a single write that succeeds only if the seat is still available.
CandidateLocks are simple to explain, but under heavy contention many requests wait on the same rows, and if a holder is slow, everyone behind it waits. A single queue gives perfect order, but one consumer must make every decision, about eight thousand a second at peak in our estimate, and if it fails the whole event stalls.
CandidateConditional updates decide each race in one write without holding anything, and they spread across seats naturally. So I will use conditional updates, behind the waiting room.

The candidate compared three options on the deciding concerns: behaviour under contention, throughput and failure. This is a compact but complete comparison, and it ends with a clear decision and a reason.

How the race is decided

Interview Dialogue

InterviewerClick to reveal answer
CandidateBoth requests reach the booking service within a millisecond. Each runs the update: set the seat to held by my hold, where the seat is available or its hold has expired. The database applies the two updates one after the other on that row. The first matches the condition and changes the row. The second finds the status is now held with a future expiry, so it matches zero rows.
CandidateThe booking service sees zero rows affected and returns a conflict to the second buyer, with a refreshed view of nearby available seats so they can pick again quickly.
Show all answers
A conditional update decides every race in one write.

The answer is mechanism level: it names the condition, the order in which the database applies the writes and the outcome for each buyer. It also includes a small product touch, returning nearby available seats, which improves the experience for the losing buyer.

The hottest seats

Interview Dialogue

InterviewerClick to reveal answer
CandidateMost of those attempts will lose, and each losing attempt is a cheap write that matches zero rows. The waiting room already caps the total rate. But if the front sections are much hotter than the rest, I would add two things.
CandidateFirst, best available assignment as the default: instead of every buyer racing for specific seats, they ask for two seats in a price tier, and the service picks seats for them. That spreads requests across many rows instead of concentrating them on a few.
CandidateSecond, a short in memory filter in the booking service of seats known to be held, refreshed from the store every second, so obviously taken seats are rejected without touching the database. The store remains the source of truth; the filter only saves work.
Show all answers

This is where the deep dive goes beyond the standard answer. Best available assignment changes the shape of demand, which is often more effective than making the contended path faster. The in memory filter is an optimisation clearly marked as non authoritative, so it cannot cause an oversell.

Hold expiry

Interview Dialogue

CandidateHolds last five minutes. Because the expiry is on the seat row, an expired hold is available to the next conditional update immediately; no job needs to run first.
CandidateA background worker still scans for expired holds every few seconds, marks them expired in the holds table, clears the seat rows and refreshes the seat map cache, so the map shows released seats. If the worker falls behind, nothing breaks: the seats are still holdable through the expiry condition.
InterviewerClick to reveal answer
CandidateThe purchase step checks the hold is still valid before charging, and marks the seats sold with a condition that the hold is still the current hold on those seats. If the hold expired and someone else took the seat, the purchase fails before charging. To avoid that edge case, I would extend the hold by a minute when payment starts, once per hold.
Show all answers
Holds expire so abandoned carts do not lock seats.

The candidate made the important point that correctness does not depend on the cleanup worker, which only keeps the display tidy. The edge case at the end of the hold was handled with a condition on the purchase and a small product fix, a one time extension when payment starts.

What this deep dive showed

In about ten minutes, the candidate compared three approaches with clear reasons, walked through the race at the level of individual writes, reshaped demand for the hottest seats, added a safe optimisation and handled expiry including an edge case. Each step was tied back to the requirements on the board: no double selling, stay up under load, fairness.

A deeper follow up

Interview Dialogue

InterviewerClick to reveal answer
CandidateAn in memory store with atomic compare and set would be faster, and for a single event it would handle the load. The cost is durability: if it fails, we lose holds, and possibly sold status if we are not careful. I would keep the sold state in the relational store and could move holds to an in memory store with replication, writing the final sale to the database. That is worth it only if the database partition is still the bottleneck after the waiting room, which I would measure first.
Show all answers

The candidate compared on the deciding concern, durability, found a partial use for the suggestion and made it conditional on measurement, which is exactly how to handle a challenge in a deep dive.

Measuring whether the design holds

The candidate could also say how they would know the design works before the big sale. Load test the booking path against a copy of a large event at the expected peak rate, watching the seat partition's write latency and conflict rate. Set the waiting room's admission rate from the test results, with a margin. During the real sale, watch hold latency, conflict rate, waiting room depth and payment success rate on a dashboard, with an alert if hold latency rises above a threshold so the admission rate can be lowered. These details are not required at mid level, but they are a strong addition at senior and staff level, because they show how the design would be operated rather than just drawn.

Why not shard one event across partitions

An interviewer might ask whether one huge event could be split across several partitions, by section for example, to spread the write load. It could, and it would raise the throughput ceiling. The cost is that a multi seat hold spanning two sections becomes a cross partition transaction, and the seat map must be assembled from several partitions. With the waiting room capping the rate, the single partition is usually enough, so the candidate would mention section level splitting as the next step if load tests showed the partition was still the bottleneck.

Each of these details is optional, but together they turn a correct design into one that a team could actually run.

Correctness must not depend on cleanup

If seats only become available again after a background job runs, a slow or failed job blocks sales. Put the expiry in the condition that decides availability, so expired holds are takeable immediately, and let the cleanup job only tidy the display.

With the deep dive done and about ten minutes left, the candidate covers payments and failure handling, then closes with a summary. This final stretch is where many candidates run out of time, which is one reason the earlier steps were kept tight.

Payment failures

Interview Dialogue

InterviewerClick to reveal answer
CandidateA timeout does not tell us whether the charge happened. So the booking service retries with the same idempotency key. The provider recognises the key and returns the original result, charged or not, so we never charge twice.
CandidateIf retries keep failing, the order stays in a pending state with the hold extended a little. A reconciliation job asks the provider for the status of pending charges by key and either completes the sale or releases the hold. The buyer sees processing, not an error, and gets an email when it resolves.
Show all answers
Idempotency keys make payment retries safe.

The candidate handled the most important payment failure, the ambiguous timeout, with the standard tools: idempotency keys, a pending state and reconciliation. Each piece has a clear purpose, and the explanation took under a minute.

Other failures

Interview Dialogue

CandidateBriefly, other failures. If a booking service instance dies, it is stateless, so the load balancer routes around it; any in flight hold either committed or did not. If the primary for an event's partition fails, the replica in the other zone is promoted in under a minute; during that time holds for that event fail and the waiting room pauses admission. If the cache fails, seat maps fall back to the store at a reduced rate, with the waiting room slowing admission to match.
CandidateIf the waiting room itself fails, the safe behaviour is to stop admitting new buyers rather than let everyone through, since letting everyone through would overload the store.

The candidate covered each major component in a sentence or two, and for each one said what users experience. Choosing to fail closed for the waiting room, with the reason, is a good example of thinking about failure behaviour rather than just redundancy.

The trade offs

Interview Dialogue

CandidateThe main trade offs in this design are three. First, a waiting room over raw scaling: buyers wait, but the store is protected and the sale is fair. Second, conditional updates over locks or a single queue: no global order, but high throughput and no single point of decision. Third, a cached seat map: it can be a second stale, but correctness comes from the hold, not the map.

Three headline trade offs, each in one sentence with its cost. These are the decisions that most shaped the design, and they are exactly what the interviewer will want in the notes.

Extensions and evolution

Interview Dialogue

CandidateWith more time, I would look at three things. Bot detection in the waiting room, beyond simple rate limits. Multi region for global events, probably keeping each event's seats in one home region and serving maps from caches near users. And resale, which would reuse the hold and purchase flow with a different seller.

Naming extensions with a sentence each shows breadth and judgment about what comes next, without spending time on any of them.

The close

Interview Dialogue

CandidateTo summarise: buyers pass through a waiting room that admits them at a rate the seat store can handle. Holds are decided by a conditional update on a seat row with an expiry, so no seat can be sold twice and abandoned holds free themselves. Payments use idempotency keys and reconciliation so retries never double charge. The seat map is served from a short lived cache, since correctness lives in the hold. The main trade off is making buyers wait in exchange for a sale that stays up and stays fair.
InterviewerClick to reveal answer
Show all answers

The close took about thirty seconds and restated the design in terms of the requirements: no double selling, staying up under load and fairness.

Looking back at the session

Looking back at the whole session, the time split was roughly six minutes on requirements and numbers, six on the API and data model, ten on the high level design, twelve on the deep dive and eight on payments, failures and the wrap up. That split put most of the time into the part of the problem where the difficulty lived, which is what the earlier lessons on time planning recommend.

What made it strong

Several things made this walkthrough strong. The estimate identified the problem as contention. The data model placed the expiry where the decision is made. The high level design added admission control rather than trying to scale a hot partition. The deep dive compared real options and went to the level of individual writes. Failures were handled with what the user experiences. And every major decision was stated as a trade off tied to a requirement on the board.

Common mistakes on this problem

The most common mistakes on this problem are worth knowing. Treating it as a generic web app and never discussing contention. Using a distributed lock service for every seat without considering throughput. Making seats available again only through a cleanup job. Reading the seat map from the database on every request during the sale. Retrying payments without idempotency keys. And spending so long on requirements that there is no time for the deep dive. Each of these appears regularly, and each is avoided by the framework.

Questions the interviewer might still ask

Even after a strong wrap up, an interviewer with a few minutes left may ask one more probing question. How would you stop one user buying all the tickets? Limit tickets per account per event, enforced in the hold service, and tie accounts to verified payment methods. What if a promoter wants to release more seats mid sale? Insert them as available rows and refresh the map; the waiting room admission rate may be raised slightly. How do refunds work? A refund marks the order refunded and the seats available again, through the same conditional update path. Answering each in a sentence or two, using the components already on the board, shows that the design is coherent enough to absorb new questions without being redrawn.

Practising this walkthrough

To practise, try running this problem yourself in forty five minutes without looking at the dialogue, then compare. Pay attention to where your time went, whether your estimate identified contention and whether your deep dive compared real options at the level of individual writes.

Comparing with your own attempt

When you compare your attempt with this one, do not worry if your components differ. Many designs can work. What matters is whether each of your decisions had a reason tied to a requirement, whether you found the contention problem early and whether you left enough time to go deep on it. Those habits, more than any particular component, are what the interviewer is evaluating.

Variations to try next

Once this version feels comfortable, try variations: general admission only, a sale across several venues at once, or a requirement that buyers can hold seats for fifteen minutes. Each variation changes one or two decisions while leaving most of the design intact, which is good practice for the follow up questions interviewers like to ask.

One last habit

Finally, notice that the candidate never apologised for the design or hedged the summary. A confident close, stated in terms of the requirements, leaves the interviewer with a clear picture to write up, and it is the last impression they take into the debrief.

That clarity is worth practising as much as the design itself.

This walkthrough by level

A mid level answer reaches conditional holds with expiry and a cache for the seat map, with some guidance. A senior answer adds the waiting room unprompted, compares locking options with reasons and handles payment timeouts with idempotency and reconciliation. A staff answer also reshapes demand with best available assignment, chooses fail closed behaviour for the waiting room and discusses how the design evolves for global events and resale.