ProblemTransactions and payments
Flash sale
Sell a limited product drop to a huge crowd in minutes, fairly, without selling more than there is.
The brief
Limited-edition drop · suggested for Senior
Design a flash sale system
Design the system a store uses to sell a limited-edition product at a set time, such as a sneaker drop or a console launch, when far more people want one than there are units. Shoppers open the launch page, try to buy when the sale opens, have a pair set aside, and pay.
The company sells limited releases a few times a year. The next is a sneaker drop: 10,000 pairs in 8 sizes, one pair per customer, on sale at 10:00:00 on a date announced a week ahead. About 2 million people are expected on the page at 10:00, refreshing. At the last drop the site went down in the first minute, some customers were charged for pairs that didn’t exist, most early requests were automated, and resale listings appeared within minutes. Design the sale so it stays up, never sells more pairs than it has, and gets them to real customers.
Functional requirements
- CoreShoppers see the launch page and when the sale opens.
- CoreFrom 10:00:00, shoppers try to buy one pair in their size.
- CoreA buyer has a set time to pay for a pair set aside for them.
- CoreEveryone learns quickly whether they got a pair or it has sold out.
- CoreEach customer can buy at most one pair.
Non-functional requirements
- ConsistencyNever sell more pairs than exist.
- LatencyThe launch page loads quickly for 2 million people at 10:00.
- AvailabilityCheckout keeps working when the rest of the site is overloaded.
- DurabilityA confirmed order is never lost, and is paid for exactly once.
- SecurityPairs go to real customers, not automated buyers.
- LatencyEveryone still waiting learns within seconds when it sells out.
Scale
- ScaleAbout 2 million people at 10:00:00; hundreds of thousands of requests a second.
- Scale10,000 pairs in 8 sizes; the most popular size has 2,000.
- ScaleCheckout takes about 2,000 orders a second.
- ScaleAbout 10 minutes to pay; the last drop sold out within minutes.
Nice to mention (below the line)
- Below the lineThe payment provider itself.
- Below the lineShipping and returns.
- Below the lineMonitoring resale sites.
Out of scope
- Out of scopePayment processing.
- Out of scopeThe product catalogue and resale monitoring.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Limited-edition dropSuggested for Senior
Sell 10,000 limited-edition pairs to 2 million people at 10:00:00, without selling a pair that doesn’t exist or letting bots take them.
9 steps · 6 must-pass · about 54 min at Senior
What each level is graded on
Limited-edition drop, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Mid-level | Your levelSenior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| What the system records | Graded | Graded | Graded | Graded |
| The API | Graded | Graded | Graded | Graded |
| 10:00:00, from the page to an order | Must-pass | Must-passcan block | Must-passcan block | Must-passcan block |
| Two buyers, one pair left | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| The pair in the abandoned checkout | Must-pass | Must-pass | Must-pass | Must-pass |
| Two million people at 10:00:00 | — | Must-pass | Must-pass | Must-pass |
| The bots got there first | — | — | Must-pass | Must-pass |
| The one count everyone wants | — | — | Must-pass | Must-pass |
| Three regions, one drop | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 33 min | 7 steps 4 must-pass about 40 min | 9 steps 6 must-pass about 54 min | 10 steps 7 must-pass about 62 min |
Entry level6 steps · 3 must-pass · about 33 min
- The numbers that shape the design (optional)Graded
- What the system recordsGraded
- The APIGraded
- 10:00:00, from the page to an orderMust-pass
- Two buyers, one pair leftMust-passcan block
- The pair in the abandoned checkoutMust-pass
Mid-level7 steps · 4 must-pass · about 40 min
- The numbers that shape the design (optional)Graded
- What the system recordsGraded
- The APIGraded
- 10:00:00, from the page to an orderMust-passcan block
- Two buyers, one pair leftMust-passcan block
- The pair in the abandoned checkoutMust-pass
- Two million people at 10:00:00Must-pass
SeniorYour level9 steps · 6 must-pass · about 54 min
- The numbers that shape the design (optional)Graded
- What the system recordsGraded
- The APIGraded
- 10:00:00, from the page to an orderMust-passcan block
- Two buyers, one pair leftMust-passcan block
- The pair in the abandoned checkoutMust-pass
- Two million people at 10:00:00Must-pass
- The bots got there firstMust-pass
- The one count everyone wantsMust-pass
Staff10 steps · 7 must-pass · about 62 min
- The numbers that shape the design (optional)Graded
- What the system recordsGraded
- The APIGraded
- 10:00:00, from the page to an orderMust-passcan block
- Two buyers, one pair leftMust-passcan block
- The pair in the abandoned checkoutMust-pass
- Two million people at 10:00:00Must-pass
- The bots got there firstMust-pass
- The one count everyone wantsMust-pass
- Three regions, one dropMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- A miss on “10:00:00, from the page to an order” can now block the result.Adds “Two million people at 10:00:00”, must-pass.
- Senior
- Adds “The bots got there first”, must-pass.Adds “The one count everyone wants”, must-pass.
- Staff
- Adds “Three regions, one drop”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Idempotency and retries
- Data modelling
- Sharding and partitioning
- High-level architecture
- Traffic surges and backpressure
- Consistency and concurrency
- Replication and durability
- Observability and operations
- Rate limiting and abuse
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design a flash sale systemYour history
Sign in to see your sessions on this problem.