Bugpit

System design interview questions

Design checkout for a flash sale

"Design the checkout for a one hour sale." You ask questions and learn: 4,000 req/s, and 4 in 100 are people paying, so 160 charges a second. The payment provider allows 100 a second. Nobody should lose an order.

Practise this round

Part of Bugpit Pro. A 25 minute timed round in your browser: draw the design, run it against the traffic, then see the interviewer's checklist.

The question

4,000 requests a second at the peak, 4% of them writes. You have 25 minutes and every part on offer: servers, load balancers, caches, databases, queues and more.

How the round works

Like a real interview, the canvas starts empty and the checklist stays hidden until you submit. Bugpit then sends the traffic at your design, crashes a machine, and marks what held up, what fell over and what it would cost each month.

What a strong answer covers

Show it (try the round first)

You can't scale someone else's API. 160 charges a second against a limit of 100 means charging while the customer waits will fail.

Take the order, put it in a queue and answer at once. Workers charge cards at the rate the provider allows, and the queue empties after the peak.

Send the receipt from the worker too. A slow email provider should never slow checkout.

A job can run twice after a crash, so each charge carries an idempotency key. Say this out loud in an interview, even though a diagram can't show it.

The point: When a limit isn't yours to raise, put a queue in front of it and let the work wait. Then prove the queue empties.

Try it against the clock

More system design interview questions