Problems / Async and streaming, hard

Notification burst: a campaign, a quota and a provider outage

Asked at Uber, DoorDash and Airbnb. A marketing campaign sends notifications through an API that calls the push provider directly and retries twice. At 6 s the campaign triples the rate for 8 seconds, the provider’s quota is 150,000 a minute, and at 15 s the provider is down for 8 seconds.

Unlock it once for 25 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.

Your goals

Success ≥ 99.5%, no duplicate pushes, no lost notifications, for at most $260,000 a month.

Test cases

Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 2; 1 of them are hidden until then.

  1. As given. The problem’s own traffic, scheduled failures and seed.

The traffic

3,000 requests a second for 20 seconds: 100% notify (writes).

The system

What each component does in this design, and what calls it. The simulator mimics each one from these settings.

ComponentIts job hereSettings
Load balancerLoad balancerTraffic enters here.Calls Notification API.Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header.–
Notification APIApp serviceLoad balancer forwards to it.Calls Push provider A.Little's law: throughput ≈ concurrency ÷ latency. 200 slots at 50 ms serve about 4,000 req/s.6 replicas × 100 slots · timeout 2.5 s
Push provider ANotification serviceNotification API calls it.Email, SMS and push providers all throttle senders and can delay delivery.200 slots · 150,000 calls/min

More async and streaming problems