All practice problems Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.
Backend Engineering · System design · Intermediate
System design practice: First Rain of June
It's quiet. Then it's very, very not quiet. First Rain of June at ChaiCart. Traffic builds to about 9,000 requests a second. 2 things go wrong at once…
The problem
- First Rain of June at ChaiCart. Traffic builds to about 9,000 requests a second. 2 things go wrong at once tonight. Keep 99% of customers served and stay within ₹2,150.
- Peak ≈ 9,000 req/s
- Quiet until 7:59 PM, then a jump to the peak in two minutes
- 55% of real traffic is the same offer page for everyone
- From 7:58 PM: 40% of traffic is bots
You'll use: System design · Caching · CDN · Queues & workers · Database replicas · Rate limiting
Solve it (expert level)2–3 min · No coding needed
Show a hint
Bots make far more requests than people. A rate limiter blocks them before you pay to serve them. Traffic that's identical for everyone (the offer page) belongs on the CDN. Set it up before the spike: servers take minutes to boot.
What this teaches (spoiler)
Not all traffic deserves capacity: shed abusive clients at the door. Prepare for spikes you can see coming, and push identical content to the edge.