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.
With 5,000 refreshes a second, how often is each product checked?
How many alerts a second when a big sale opens?
How many chart reads, and how many free price reports?
How much does a year of price history weigh?
Build-up · 5 steps
Build the high-level design
One requirement at a time, ending with a tracker that works for one retailer and a few million products.
Step 1 of 5
Add a product, see history
A URL resolver turns any URL shape into one canonical ID, so one TV never gets five histories. A first fetch runs at once, and only a changed price is stored, as a change point.
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
“You own none of the prices for 500 million products across ten retailers. How do you get them?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“You can afford 5,000 refreshes a second for 500 million products. Which do you refresh next?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“Charts are read 580 times a second, and each wants a year of one product’s prices. How do you store them?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“A TV goes from ₹54,999 to ₹47,999. It has 200,000 of your 100 million alerts. Which ones fire?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“After a retailer’s redesign, your parser reads a TV at ₹499. How do you avoid alerting 200,000 people wrongly?”
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“At 00:00 on Big Billion Days, 6M alerts fire in five minutes, 40,000 a second at first. How do you deliver them?”
Your move. Pick an approach:
Build-up · 9 steps
Follow one TV’s drop on sale night
The collection side runs top to bottom through the middle; the user side wraps around it; one Kafka topic of confirmed price changes joins them.
Step 1 of 9
Schedule
The timing wheel releases the TV at 00:00:30. 18,000 watchers, a target 2% below the price and a sale boost give it a high value, and the retailer’s token bucket has room.