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: Eid Evening Feast
Browsing, browsing, browsing. Hardly anyone buys yet. Eid Evening Feast at ChaiCart. Traffic builds to about 14,000 requests a second. 2 things go wrong…
The problem
- Eid Evening Feast at ChaiCart. Traffic builds to about 14,000 requests a second. 2 things go wrong at once tonight. Keep 99% of customers served and stay within ₹4,650.
- Peak ≈ 14,000 req/s
- 80% of requests read the same menu data
- From 7:50 PM: 35% 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. Repeat reads of the same data belong in a cache, not in more database replicas.
What this teaches (spoiler)
Not all traffic deserves capacity: shed abusive clients at the door. Read-heavy traffic is a caching problem first: answer repeat reads from memory.