Layer 3 · Go deeper · 12 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How many bids a second does the whole platform take?
What does pushing live prices to watchers cost?
How much does keeping every bid forever cost?
How many bids a second can one locked row take?
Build-up · 5 steps
Build the high-level design
One functional requirement at a time, ending with a design that runs a normal day correctly, all resting on one database row per auction.
Step 1 of 5
List a timed auction
The listing service writes the auction and its close timer in one transaction on the auction’s shard, so an auction can never exist without a way to end. Search follows through change data capture.
6 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 6
Interviewer
“Asha leads at $31 with a hidden $50 maximum. Ben bids $55 and Chen $60 at the same moment. How do you lose neither?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“Bidders want to type the most they’d pay and let the system bid for them. How do you implement it?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“An auction “ends at 20:00:00”. A bid is in flight at 19:59:59.990, and a machine may die at 19:59. How do you close it?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“200,000 people watch the signed bat while it takes 2,000 bids a second. How do you keep their prices live?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“The signed bat takes 2,800 bids in its last two seconds; its locked row serves 1,000. What do you change?”
The other 1,800 queue for 3.6 seconds, past the end. Bids that arrived in time are judged late and rejected.
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“The auction closes: Chen won at $60. Now money must move and people must hear, over days. Who runs it?”
Your move. Pick an approach:
Build-up · 8 steps
Follow a hot auction from listing to payment
The hot path is the bid API, the bid engine and the bid log. Everything else is a projection of the log or a consumer of its events.
Step 1 of 8
List
The listing service validates the auction and writes it, with its end time, to the auction’s shard. Search follows through change data capture, without dual writes.