ProblemTransactions and payments
Online auction
Take bids on thousands of live auctions at once and name the right winner the moment each one closes.
The brief
Marketplace · suggested for Senior
Design an online auction marketplace
Design an online auction marketplace: about 20 million timed auctions live at once, about 60 million bids a day, prices that update live for everyone watching, and a rush of bids in each auction’s final minute.
An online marketplace sells items by timed auction. A seller lists an item with a starting price, an optional hidden reserve price and an end time 1 to 10 days away. Buyers bid, or enter the most they are willing to pay and let the marketplace bid for them. Everyone viewing an auction sees its price, number of bids and time left change as it happens, and most of the action comes in the final minutes. When an auction ends, the highest bidder wins if the reserve was met and is charged on a saved card. Design the service: how auctions and bids are stored, how a bid is accepted or turned down, how everyone watching sees the new price, how an auction ends, and what happens after it does.
Functional requirements
- CoreSellers list an item as an auction with a starting price, an optional hidden reserve price and an end time 1 to 10 days away.
- CoreBuyers place bids; the first bid must be at least the starting price, and every later bid must beat the current price by at least the increment for that price.
- CoreA buyer can instead enter the most they will pay, and the marketplace bids for them only as much as needed to keep them in the lead; nobody else ever sees that amount.
- CoreEveryone viewing an auction sees its current price, number of bids and time left, updated live.
- CoreAn auction ends at its end time, except that a bid accepted in its last 2 minutes moves the end to 2 minutes after that bid.
- CoreWhen an auction ends, the highest bidder wins if the reserve was met and is charged on a saved card; if that payment fails, the seller can offer the item to the next-highest bidder at that bidder’s highest bid.
- CoreBuyers search and browse auctions, for example by keyword and ending soonest.
- CoreA bid sent again after a timeout counts once.
Non-functional requirements
- LatencyA bidder learns whether the bid was accepted, outbid or too late within about 300 ms at p99 on the same continent, and about 400 ms across continents.
- ConsistencyThe price only goes up, by at least the increment; the highest valid bid wins, a lower bid never replaces a higher one, and only one bidder leads at any moment.
- LatencyEveryone viewing an auction sees a new price within about a second.
- DurabilityAn accepted bid is never lost, and every auction’s full bid history can be audited years later.
- ConsistencyWhether a bid arrived before the end is decided the same way for every bidder, wherever they are.
- AvailabilityBidding keeps working through the final-minute rush on the busiest auctions.
Scale
- ScaleAbout 20 million live auctions; about 3 million end each day, most in the evening.
- ScaleAbout 60 million bids a day: about 700 a second on average and about 5,000 at peak; about half of an auction’s bids arrive in its final hour.
- ScaleA popular auction can get about 1,000 bid attempts a second in its last minute.
- ScaleAbout 5 million people viewing auction pages at peak; the most-watched auction has about 100,000.
- ScaleAbout 20,000 searches a second.
- ScaleBuyers and sellers worldwide; the service runs in three regions (US, EU and Asia).
Nice to mention (below the line)
- Below the lineShipping.
- Below the lineFeedback and ratings.
- Below the linePaying sellers out.
Out of scope
- Out of scopeFixed-price listings.
- Out of scopeBuyer–seller messaging.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- MarketplaceSuggested for Senior
An eBay-style marketplace of timed auctions: about 20 million live at once, bids that must beat the price, prices that move live, and a rush in the last minute.
8 steps · 5 must-pass · about 44 min at Senior
What each level is graded on
Marketplace, 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 |
| Auctions, bids and sales | Graded | Graded | Graded | Graded |
| The listing, bidding and watching calls | Graded | Graded | Graded | Graded |
| From a bid to every screen | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| Bidding for you | Must-pass | Must-pass | Must-pass | Must-pass |
| The last two minutes | Must-pass | Must-pass | Must-passcan block | Must-passcan block |
| The winner doesn’t pay | — | Must-pass | Must-passcan block | Must-passcan block |
| A hot auction | — | — | Must-pass | Must-pass |
| A hundred thousand watchers, three regions | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 32 min | 7 steps 4 must-pass about 38 min | 8 steps 5 must-pass about 44 min | 9 steps 6 must-pass about 51 min |
Entry level6 steps · 3 must-pass · about 32 min
- The numbers that shape the design (optional)Graded
- Auctions, bids and salesGraded
- The listing, bidding and watching callsGraded
- From a bid to every screenMust-passcan block
- Bidding for youMust-pass
- The last two minutesMust-pass
Mid-level7 steps · 4 must-pass · about 38 min
- The numbers that shape the design (optional)Graded
- Auctions, bids and salesGraded
- The listing, bidding and watching callsGraded
- From a bid to every screenMust-passcan block
- Bidding for youMust-pass
- The last two minutesMust-pass
- The winner doesn’t payMust-pass
SeniorYour level8 steps · 5 must-pass · about 44 min
- The numbers that shape the design (optional)Graded
- Auctions, bids and salesGraded
- The listing, bidding and watching callsGraded
- From a bid to every screenMust-passcan block
- Bidding for youMust-pass
- The last two minutesMust-passcan block
- The winner doesn’t payMust-passcan block
- A hot auctionMust-pass
Staff9 steps · 6 must-pass · about 51 min
- The numbers that shape the design (optional)Graded
- Auctions, bids and salesGraded
- The listing, bidding and watching callsGraded
- From a bid to every screenMust-passcan block
- Bidding for youMust-pass
- The last two minutesMust-passcan block
- The winner doesn’t payMust-passcan block
- A hot auctionMust-pass
- A hundred thousand watchers, three regionsMust-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
- Adds “The winner doesn’t pay”, must-pass.
- Senior
- A miss on “The last two minutes” can now block the result.A miss on “The winner doesn’t pay” can now block the result.Adds “A hot auction”, must-pass.
- Staff
- Adds “A hundred thousand watchers, three regions”, 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
- Choosing storage
- Indexing
- Sharding and partitioning
- Networking and protocols
- 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 an online auction system (eBay)Your history
Sign in to see your sessions on this problem.