Runtyme
All practice problems

Backend Engineering · System design · Intermediate

System design practice: Mumbai Marathon

The pay button is about to start spinning. Mumbai Marathon at ChaiCart. Traffic builds to about 14,000 requests a second. 2 things go wrong at once…

The problem

  • Mumbai Marathon 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,700.
  • Peak ≈ 14,000 req/s
  • Quiet until 8:04 PM, then a jump to the peak in two minutes
  • 60% of real traffic is the same offer page for everyone
  • ⚠ Payments slow down from 7:54 PM. 15% of requests are checkouts

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

Traffic that's identical for everyone (the offer page) belongs on the CDN. Set it up before the spike: servers take minutes to boot. Repeat reads of the same data belong in a cache, not in more database replicas. Don't make servers wait on slow payments: queue checkouts and let workers (~300/s each) handle them.

What this teaches (spoiler)

Prepare for spikes you can see coming, and push identical content to the edge. Read-heavy traffic is a caching problem first: answer repeat reads from memory. Never let a slow third party hold your servers hostage. Queue the work and reply immediately.

Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.