InterviewLegend

Design a Flash Sale

Frequently asked
Alex Chen28 min readGuide updated
In this lesson
  • Turn a short flash sale prompt into requirements, numbers and a design you can draw on a shared whiteboard
  • Keep a million-person rush off the purchase path with a CDN, a waiting room and controlled admission
  • Go deep on overselling, retries and failed payments, and draw the sold-out path as carefully as the purchase

Understanding the problem

The prompt

Something like this: your company has a hot new product and will sell it in a flash sale. The sale opens at a set time, and purchase requests can far outnumber the stock. Each user can buy one unit, there is no cart, and orders are filled first come, first served. The product goes out of stock the moment the last unit sells. Design it so it holds up at scale, covering both the purchase and the sold-out case.

This is the newest prompt in the Disney system design interview. A staff engineer got a version of it in August 2026, as the high-level design round on HackerRank's diagramming tool. An older telling, from a 2022 senior loop, asked for an online store that sells "5 of the same item". Same problem, smaller stock. The prompt gives no traffic numbers and no stock count. It does show two short animations: a shopper pressing Buy Now on a $499 sneaker, and a shopper getting "Product no longer available. You just missed it." Those two screens are the happy path and the unhappy path, and the interviewer expects both on your diagram.

Picture the minute before the sale. A million people have the page open, thumbs over the button. At 10:00:00 they all press it within a few seconds, and maybe 10,000 of them can win. For 99 out of every 100 people the right answer is "sorry, sold out," and the system has to say that quickly and cheaply. For the lucky 1 percent it has to say "yours" exactly once, with no unit sold twice and nobody charged twice. So the hard part isn't storing orders. Ten thousand orders fit in any database. The hard part is the first ten seconds.

The Disney angle
In the 2026 staff round, the candidate's answer rested on three pieces: stock held in Redis, a waiting service where customers queue, and an idempotency key check so only one customer gets each unit. Expect the interviewer to push on each of them. Disney commerce prompts care more about selling each unit once than about raw scale.

Requirements

Functional requirements

Most of the scope is written into the prompt, which saves time. Read the five rules back to the interviewer, then ask the two questions the prompt leaves open: how many units, and how many people. If they have no numbers, offer your own and move on.

In scope

  • Show the product page and a countdown before the sale opens
  • Let people line up when the sale opens, in order of arrival
  • Let each person buy at most one unit, with no cart
  • Never sell more units than exist, and show sold out the moment stock hits zero
  • Take payment, and handle a payment that fails

Below the line (call it out, then skip)

  • Product catalog management and the admin tool that creates the sale
  • Shipping, returns and customer support
  • Fraud scoring beyond a per-account limit and bot checks at the queue
  • Recommendations, reviews and search

Non-functional requirements

Correctness on stock beats everything. Overselling means telling a customer they bought something that doesn't exist, which is worse than a slow page. So the stock count is the one place we need strong consistency: every buyer must see the same count, and taking a unit must be a single step nobody can interleave with. Availability matters next, but in a specific way. If the purchase path gets overwhelmed, the right failure is a polite "you're in line" or "sold out." It must never be a timeout that makes people refresh, because refreshing doubles the load. Everything outside the purchase can be eventually consistent. A "units left" number that's two seconds stale on the product page is fine. Fairness is a requirement here too, because the prompt says first come, first served. Someone who clicked at 10:00:01 should not lose to someone who clicked at 10:00:05 just because the second request happened to reach a quieter server.

  • People at the start: about 1 million. An assumption to agree with the interviewer. The prompt only says requests can far outnumber stock.
  • Units for sale: 10,000. So about 1 in 100 people can win. The other 99 need a fast, clear sold-out answer.
  • Peak request rate: 100,000 a second. A million clicks spread over the first ten seconds. Refreshes and retries can double or triple it.
  • Orders written: 10,000 in total. Tiny for any database. The write load is small, and the burst of attempts is the real problem.

The object model, in words

Four things carry the design. A sale is one product on sale at one start time with a fixed number of units. It moves from scheduled to live, and from live to sold out or ended. A place in line belongs to one person in one sale. It holds their number in the queue and whether they've been let in yet. An admission pass is what a person gets when their turn comes: a short-lived signed token that says "this user may buy in this sale for the next four minutes." The purchase service checks the signature and trusts nothing else, so nobody can skip the queue by calling the buy endpoint directly.

An order is one unit going to one person. It starts as reserved when the unit is taken, becomes paid when the charge goes through, and becomes released if payment fails or the hold runs out. Two rules sit on the order table as unique keys. One person gets at most one order per sale, and each unit number appears at most once. The database refuses anything that breaks either rule, whatever the code upstream got wrong.

Where each record lives
TableFields
sales (Postgres)sale_id · product_id · starts_at · total_units · state
orders (Postgres)order_id · sale_id · user_id · unit_number · idempotency_key · state · created_at
queue (Redis)line position per user · "now serving" number · admitted count
stock (Redis)units left per sale · set of users who already bought
Postgres holds the durable truth with two unique keys on orders: sale plus user, and sale plus unit number. Redis holds the fast, hot state the first seconds of the sale hammer.

The API

Five calls cover it. Only two of them change anything, the buy and the pay, so those are the two that take an idempotency key. The client makes up the key once per click and sends the same one on every retry.

The interface
Request
Shopper appCDNproduct page and sale state
GET /sales/{sale_id}
product, starts_at, state, now_serving
Cached at the edge for a second or two, so a million refreshes never reach our servers.
Shopper appWaiting roomget a place in line
POST /sales/{sale_id}/queue
position, estimated_wait
Joining twice returns the same place.
Shopper appWaiting roomcollect the pass when it is your turn
GET /sales/{sale_id}/queue/me
state, admission_pass when admitted
Shopper appPurchase servicebuy one unit
POST /sales/{sale_id}/buy { admission_pass, idempotency_key }
order_id, state (reserved or sold out)
A retry with the same key returns the same order.
Shopper appPurchase servicepay for the reserved unit
POST /orders/{order_id}/pay { payment_method, idempotency_key }
state (paid or payment failed)

The architecture end to end

The shape is a funnel. At the wide top, the CDN absorbs the crowd with cached pages. In the middle, a waiting room turns a stampede into an orderly line and lets people through at a rate the back end can handle. Down at the narrow bottom sits the purchase service, which only ever sees people holding a pass. In the diagram, blue is outside our system (the shopper and the payment provider), violet is a service we run, amber is a queue that moves work, and green is state we store.

Loading diagram...

1) Before the sale. The Shopper app loads the product page and a countdown from the CDN. Nothing reaches our servers yet. We create the sale in Postgres ahead of time, load the unit count into the Stock counter, and scale out the services ten or fifteen minutes before the start. Autoscaling that reacts to load is too slow for a spike that arrives in one second, so we scale on the calendar.

2) Join the line. At the start time the app posts to the Waiting room through the API gateway. The waiting room hands out the next number from Queue state and returns it. That's one fast Redis increment per person, with no database involved. A million joins in ten seconds is still 100,000 increments a second, right at the limit of one Redis key, and the first deep dive deals with that.

3) Get let in and buy. The waiting room raises "now serving" by, say, 2,000 every second. Each app sees its number come up in the cached sale state, collects its signed pass, and posts the buy with an idempotency key. The Purchase service takes one unit from the stock counter, inserts a reserved order into the Order database, and answers "yours." All of that takes tens of milliseconds. Payment comes next, but off the request path.

4) The unhappy path. When units left minus passes outstanding reaches zero, the waiting room stops admitting and sets the sold-out flag in the cached sale state. Within a second or two, every app still waiting shows "Product no longer available. You just missed it." Nobody is left polling a spinner, and nobody hits the purchase service to find out. A buyer who somehow arrives with a stale pass after the last unit is gone gets the same screen from the purchase service.

5) Pay, or give the unit back. The order and an event are written in one transaction, and the Order events queue hands the event to the Payment worker. It charges the card through the Payment provider and marks the order paid. If the charge fails, the worker marks the order released and adds the unit back to the stock counter, and the waiting room can let one more person in. What "sold out" means while a payment is still pending is its own deep dive.

Technology choices

  • The CDN is CloudFront, Akamai or similar. The product page and sale state are identical for everyone, which is the case caching is made for. If the CDN serves a stale "now serving" number for a second, people wait a second longer. Nothing breaks. If the edge is cut off from our origin entirely, it keeps serving the last cached page while we fix it.
  • Queue state and the Stock counter live in Redis, kept in memory and replicated to a standby. We need many tiny reads and increments a second, and Redis handles them on one server. Replication is asynchronous, meaning the primary answers before the standby has the write, so a failover can lose the last few changes. That gap is why Postgres, with its unique keys, stays the final word on who bought what.
  • The Order database is Postgres with a synchronous replica, so a committed order is on two machines before the buyer sees "yours." We want transactions and unique keys more than raw write speed here. Total writes are tiny, and the unique keys make a double sale impossible even when other parts misbehave.
  • Order events can be SQS or a Kafka topic. A work queue fits, since each reserved order needs exactly one payment job, and a job that fails goes back on the queue. After a few failures it moves to a dead-letter queue, a side queue someone looks at by hand. The outbox makes the order and its event a single write, so neither can exist without the other.
  • The API gateway, Waiting room, Purchase service and Payment worker are stateless containers, so any instance can serve any request and adding instances is safe. We scale them up before the sale on a schedule. The gateway's rate limits use counters in Redis that refill over time, so every gateway instance shares one limit per user.

Name the popular tool and defend the category. If the interviewer's team uses Memcached or DynamoDB, the point they want is that you need an atomic check-and-take on the stock and a database that refuses duplicates.

Potential deep dives

How do we survive the surge at the start time?

Do the arithmetic first. A million people clicking in the first ten seconds is 100,000 requests a second. People who see a spinner refresh, so plan for two or three times that. Behind it, the purchase path does real work: a signature check, a Redis script, a Postgres insert with a synchronous replica. Even generously scaled, that path handles a few thousand buys a second, so most of the crowd has to be answered somewhere cheaper.

BadSend every click straight to the purchase service

Approach

Scale the purchase service and the database as large as the budget allows, and let every Buy Now click run the full purchase.

Challenges

At 100,000 clicks a second, every one of them queues for the same stock row or key. Response times climb, clients time out, and timed-out clients retry, which adds load just as the system is struggling. The database spends the first minute serving people who were never going to win. Even if nothing falls over, which request wins depends on which server it happened to land on, so first come, first served is lost too.

GoodCache everything you can, and rate limit the rest

Approach

Serve the product page and images from the CDN with a countdown in the page, so nothing hits the origin before the start. Put a per-user and per-IP rate limit at the API gateway, say one buy attempt per second per account. Scale the services up ahead of the start time. Return a fast "try again" when the purchase service is full instead of letting requests wait.

Challenges

The crowd is calmer but still unfair. A "try again" turns the sale into a lottery of who retries at the right millisecond, and scripts retry faster than people do. The purchase service still sees tens of thousands of legitimate attempts a second from real users, each costing a stock check, and nobody waiting knows whether they have a chance.

GreatA virtual waiting room with controlled admission

Approach

Put a Waiting room in front of the purchase path. At the start time everyone gets a place in line, which is one Redis increment. The waiting room admits people at a fixed rate, say 2,000 a second, by raising a "now serving" number and issuing signed passes. The purchase service only accepts requests with a valid pass. Waiting clients read "now serving" from a file the CDN caches for a second, so a million waiting people cost our servers almost nothing.

Challenges

The waiting room is now the front door, so it has to be the sturdiest piece we run. Passes need an expiry, a few minutes, so someone who walks away doesn't hold a unit's worth of admission forever. And the admission rate needs tuning: too slow and the sale feels stuck, too fast and the purchase service is overloaded again.

The waiting room earns its place because it changes what most requests are. Without it, every request is an attempt to buy. With it, almost every request is "is it my turn yet?", which a cached file answers. Only about 10,000 people, plus a small buffer for people who drop out, ever reach the purchase service. The scaling playbook on handling contention covers the general pattern.

How does the virtual queue stay fair, and when does it stop?

First come, first served needs a single ordering everyone agrees on. Client clocks can't provide it: they drift, and anyone can change theirs. The server has to assign the order, and the simplest way is a counter. Each join runs one Redis increment, and the number that comes back is the person's place in line. The waiting room also records that number against the user, so a second join from the same account returns the first number instead of a better one.

One Redis key can take roughly 100,000 increments a second, and our peak is right there. The usual fix is to hand each waiting-room server a block of numbers, say 1,000 at a time, so Redis sees one increment per block instead of one per person. Two people who joined within the same few milliseconds on different servers can end up in a slightly different order. Say that out loud. At human click speeds nobody can tell, and the interviewer will want to hear that you noticed.

Then there are people who arrive early. If the queue opens at exactly 10:00, the winners are whoever has the lowest network latency, which tends to mean bots. Some sales open the waiting room a few minutes early and give everyone who arrived before the start a random place, then switch to arrival order after it. That breaks strict first come, first served, so ask the interviewer which they want rather than deciding alone.

The Disney angle
Disney's parks already run virtual queues for some of their busiest rides: guests join in the My Disney Experience app and get called back by boarding group instead of standing in line. The sale's waiting room is the same idea, handing out boarding groups of 2,000 a second. One sentence comparing them shows you know the business.

The stopping rule is the part that makes the unhappy path work. The waiting room keeps two numbers: units left, and passes handed out but not yet used. It only admits someone while units left exceeds outstanding passes, so every admitted person has a unit waiting for them. Once that gap reaches zero, it stops and sets the sold-out flag. A hundred thousand people get "You just missed it" from the cached file within a couple of seconds, and none of them ever touched the purchase service.

A pass that expires unused gives its slot back, and the waiting room admits the next person. If a payment fails later and a unit returns to stock, the same rule lets one more person in. In both cases the sold-out flag has to come off again. Decide with the interviewer whether that's acceptable or whether "out of stock the moment stock runs out" means the sale should end there. The next two dives change that answer.

How do we make sure we never oversell?

Overselling comes from one race. Two buyers read "1 unit left" at the same moment, both decide there is stock, and both write "0 left." Two orders, one sneaker. Any design that reads the count in one step and writes it in another has this bug, however fast it runs.

BadRead the count, then write it back

Approach

The purchase service reads units left from the database. If it's above zero, it writes the new value and creates the order.

Challenges

Two requests can read the same value before either writes. Under a flash sale's concurrency this isn't a rare edge case. It happens many times in the first second. Adding a cache in front makes it worse, because the cached count is staler than the database.

GoodA conditional update in Postgres

Approach

Make the check and the write one statement: subtract one from units left only where units left is above zero, and see whether a row changed. If none did, the sale is sold out. Wrap it in the same transaction as the order insert, and the unique key on sale plus user enforces one unit per person. It's correct, simple and durable.

Challenges

Every buyer updates the same row, so every buyer waits for the row lock held by the one before. With a synchronous replica each commit takes a few milliseconds, so one row manages a few hundred to maybe a thousand buys a second. Splitting the stock across ten rows of 1,000 units each spreads the lock, at the cost of hunting for a row that still has units near the end.

For 10,000 units behind a waiting room that admits 2,000 people a second, the Good tier may well be enough, because the line already took the surge off the database. The Great tier earns its place when admission is faster, when one sale has hundreds of thousands of units, or when several sales run at once against one database.

GreatAn atomic script in Redis, with Postgres as the guard

Approach

Keep units left and the set of users who already bought in the Stock counter. One short Lua script, a small program Redis runs as a single step, checks that the user hasn't bought, checks there is stock, takes a unit and records the user. Redis runs one script at a time, so no two buyers interleave, and it handles tens of thousands of scripts a second. The count left after taking a unit becomes the order's unit number, and the order insert into Postgres carries it.

Challenges

Redis replication is asynchronous, so a failover can lose the last few decrements and hand the same unit number out twice. The unique key on sale plus unit number in Postgres rejects the second insert, and that buyer simply retries and gets the next unit. Redis can still lose the "already bought" record, which is why the unique key on sale plus user exists too. The count is fast in Redis and final in Postgres.

Here it is in five lines. Both checks and both writes happen inside one call, and that single call is what stops two buyers sharing a unit.

if redis.call('SISMEMBER', buyers, user) == 1 then return 'already bought' end
if tonumber(redis.call('GET', units_left)) <= 0 then return 'sold out' end
local left = redis.call('DECR', units_left)
redis.call('SADD', buyers, user)
return left + 1 -- this buyer's unit number

Before the sale, check that the two stores agree. After it, run a reconciliation job: count the paid and reserved orders in Postgres and compare them with the total units minus what Redis says is left. Any difference means a lost write somewhere, and Postgres is the one to believe. The Redis toolbox page covers scripts and persistence settings in more depth.

How does each unit go to exactly one buyer when requests retry?

The network will retry for you whether you like it or not. A shopper double-taps Buy Now. On a train, a phone sends the buy, the response gets lost, and the app sends it again. Somewhere a load balancer times out a slow request and the client retries against another server. Each of those is the same purchase arriving twice, and without protection it can take two units or charge one card twice.

An idempotency key fixes it. The app generates a random key when the shopper presses the button and sends it with every retry of that press. The purchase service stores the key with the order. When a request arrives with a key it has already seen, it returns the stored result instead of doing the work again. Idempotent means exactly that: doing it twice has the same effect as doing it once.

1

Double tap or retried buy, same key

The service finds the key on an existing order and returns that order, with no new unit taken. Check the key in Redis first for speed, and let the unique key on sale plus user in Postgres catch anything that slips past.

2

Same person, new key, second device

Someone opens the sale on a phone and a laptop and buys on both. The keys differ, so the key check doesn't catch it. The "already bought" check in the stock script does, and the unique key on sale plus user backs it up. On the second device they see "you already bought this."

3

Server dies between taking the unit and writing the order

Redis has the unit taken and Postgres has no order. The client retries with the same key, and the stock script answers "already bought," which leaves the buyer with nothing. So the script also stores each buyer's key and unit number. A retry with a matching key gets its unit number back and writes the missing order.

4

The charge times out

The payment worker doesn't know whether the card was charged. It retries with the order id as the payment provider's idempotency key. Providers such as Stripe return the first result for a repeated key, so the card is charged once.

Draw the third case on the board before you're asked. It's the gap between two stores, and it's where interviewers like to poke. One write lands, the next one doesn't, and the system has to finish the job on retry instead of leaving a unit taken with no order behind it.

What does sold out mean when payment can fail?

The prompt says the product goes out of stock the moment the whole stock is gone. But "gone" can mean taken or paid for, and those happen at different times. If a unit counts as gone once it's reserved, some reserved buyers will fail to pay, and units come back after the sold-out screen has already shown. If a unit only counts as gone once it's paid, the purchase path waits on a payment provider, which can take seconds and fail for reasons that have nothing to do with us.

GoodReserve now, pay within a hold window

Approach

Taking a unit creates a reserved order with a hold of, say, five minutes. The shopper pays in that window. A job looks for expired holds every few seconds, releases them, and puts the units back. The waiting room admits one more person for each unit returned.

Challenges

Sold out isn't final. A sale can flip to sold out, back to available as holds lapse, and back to sold out. The people who saw "you just missed it" may never come back. A five-minute hold also means the last units sit idle while a slow shopper looks for a card.

GreatPay on click with a saved card, and keep a small waitlist

Approach

Require a saved payment method before the shopper joins the line. When they buy, take the unit and authorize the card right away through the Payment worker, so a hold lasts seconds. Authorization reserves the money without moving it, and capture happens when the order ships. Admit a small buffer beyond the stock, a few hundred people, as a waitlist. If a card is declined, the unit goes to the next waitlisted person at once.

Challenges

Requiring a saved card adds friction before the sale, and some shoppers won't bother. The waitlist people need a clear message, something like "you're next in line if a unit frees up," so they aren't told they've won. Authorizations can expire if shipping is slow, so long gaps need a fresh authorization.

Either way, the order state machine is the same: reserved, then paid or released, never back to reserved. The Order events queue and the outbox make sure no reserved order is forgotten. And the reconciliation from the oversell dive checks that every unit is either in stock, in a reserved order, or in a paid one.

Practice the core in code

Shrink the design to one class to practice it. It hands out places in line, admits people in order without ever letting in more people than there are units, sells each admitted person one unit, and treats a retried buy with the same key as the same purchase. A status call covers the unhappy path, telling a waiting person when the sale is sold out.

1

Flash sale: queue, admission and one unit per buyer

Medium
Problem
A flash sale has a fixed number of units. People join a line, get admitted in order, and each admitted person may buy one unit. A buy may be retried with the same key and must not take a second unit.

Write a class FlashSale(stock). join(user_id) puts the user at the back of the line and returns their position, starting at 1. Joining again returns the original position. admit(count) lets in up to count of the earliest people not yet admitted and returns their ids in line order. It never lets in more people than units left minus people already admitted who haven't bought.

buy(user_id, key) returns "not admitted" if the user hasn't been admitted and has no order. For a first buy it takes a unit and returns "order-N", where N counts orders from 1. If the user already has an order, it returns that order id when key matches the first buy's key, and "already bought" otherwise.

status(user_id) returns "bought", "admitted", "unknown" for someone who never joined, "sold out" for a waiting user when no units are left, and "waiting" otherwise.

Input encoding. A test case is a JSON array of operations. The first entry is ["FlashSale", [stock]] and each later entry is [method, [args]]. The expected array holds each operation's return, with null for the constructor.
  1. FlashSale(2)
  2. join("ana")→ 1
  3. join("ben")→ 2
  4. join("cal")→ 3
  5. admit(5)→ ["ana","ben"]
  6. buy("ana", "k1")→ "order-1"
  7. buy("ben", "k2")→ "order-2"
  8. status("cal")→ "sold out"

Only two units exist, so admit lets in two people even though it was asked for five. Once both buy, cal is told the sale is sold out.

How this uses the pattern

Keep the line as a list plus a map from user to position. Add a pointer to the next person to admit, a set of admitted people who have not bought, and a map of orders.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Flash sale: queue, admission and one unit per buyer

Loading...
Click "Run" to execute your code
The Disney angle
This is the waiting room and the stock counter from the design, small enough to run. The admit cap is the stopping rule: every admitted person has a unit waiting, so nobody is let in only to be turned away. The key check is the idempotency rule. A retry is a read, and a new key from the same person is a refusal.
Take it further
Add release(user_id) for a failed payment: the order is cancelled, the unit goes back, and the next person can be admitted. Then add a pass expiry, so an admitted person who never buys frees their slot after a time limit. Talk about where each map lives in the real system: the line in Redis, the orders in Postgres with unique keys.

Follow-ups to be ready for

Bots and resellers. A per-account limit only helps if accounts are expensive to make. Require a verified account that existed before the sale was announced, put a bot check on joining the line rather than on buying, and rate limit by device and payment card as well as by account. The waiting room helps here too: a bot that joins a millisecond after the start still waits its turn like everyone else.

Five units instead of ten thousand. The 2022 senior prompt was a store selling five of the same item. At that size the conditional update in Postgres is plenty, and the database never becomes the bottleneck. The design still needs the queue, because the crowd doesn't shrink just because the stock did. Showing that you'd drop Redis for a tiny sale tells the interviewer you size the design to the problem.

Several sales at once, or several regions. Every key in Redis is per sale, so different sales can live on different Redis shards without coordination. Shoppers in many regions can join regional waiting rooms, but each sale's stock counter has one primary in one region. Splitting a single sale's stock across regions makes oversell checks much harder, and a few tens of milliseconds of extra latency on 10,000 buys is a fine price.

What to watch on the day. Watch the queue length and admission rate, units left against orders written, the purchase service's error rate, and payment failures by reason. Run the reconciliation check every minute while the sale is live, so a Redis failover that lost writes is found while it still matters.

The Disney angle
Disney design rounds often save time for questions outside the drawing. A 2025 senior system design hour also asked which communication protocols exist besides REST. Be ready to say why the waiting clients poll a cached file over plain HTTP here, and when server-sent events or WebSockets would be worth their cost.

What is expected at each level

Software Engineer II

Breadth over depth, roughly 80/20. You get the requirements straight, sketch the CDN, a queue, the purchase service and the database, and you spot the read-then-write race without being led to it. A conditional update in Postgres plus a unique key on sale and user is a perfectly good answer at this level. The bar: a complete design where no unit is sold twice, and you can explain why.

Senior

Closer to 60/40. You bring up the surge yourself, with numbers, and put a waiting room in front of the purchase path. You handle retries with an idempotency key and can explain how Redis and Postgres split the work, including what happens when Redis fails over. The bar: both the happy and the unhappy path drawn, and the sold-out answer reaches the crowd without touching the purchase service.

Staff

Depth leads, around 40/60, and you drive. Design sits at the center of Disney staff loops. The interviewer expects you to raise the hard questions before they do: what sold out means while payments are pending, the gap between taking a unit and writing the order, fairness against bots, and reconciliation. You also say what you'd cut for a five-unit sale. The bar: every unit can be traced to stock, a reserved order or a paid one, and you can show why at any moment.

Key Takeaways

  • ✓Answer most of the crowd from a CDN and a waiting room, so only people holding a pass reach the purchase service.
  • ✓Take a unit with one atomic check-and-take in Redis, and let unique keys in Postgres refuse any double sale.
  • ✓Give every buy and every charge an idempotency key, so retries return the first result instead of taking a second unit.
  • ✓Draw the sold-out path too: stop admitting when passes cover the stock, and decide what a failed payment does.
Disney interview guide

Know what Disney asks before you walk in.

27 coding · 6 system design · 16 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

What to Expect in a Disney System Design InterviewHad your Disney interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.