Problems / Design a product, hard

Build ad click aggregation

Design ad click aggregation from an empty canvas: take 2,850 clicks a second without losing or double-counting one, aggregate them per ad per minute on a stream, and serve advertisers’ reports.

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.

What it must do

Scale

Request types to route: click (95%, write), report (5%, read). Budget: $4,000 a month.

Estimate first

The test cases

You start from an empty canvas. When you run the tests, each one simulates your design with its own traffic and failures:

TestWhat it doesPasses when
Normal dayThe normal day: the traffic in the brief, nothing broken.Success ≥ 99.9%; p99 latency ≤ 80 ms (click); p99 latency ≤ 1.5 s (report)
A Super Bowl adAt 5 s a Super Bowl ad airs: traffic triples for 8 s.Success ≥ 99%; p99 latency ≤ 100 ms (click)
The event stream goes downAt 5 s the event stream on the request path crashes; it comes back 10 s later. While this test runs, brokers redeliver unacknowledged messages after 5 s and 0.2% of acknowledgements are lost, as in production: only idempotent consumers avoid duplicates.No lost events; Success ≥ 99% (click); No duplicate side effects
A server diesAt 4 s one server of the first app service on the request path dies for 10 s.Success ≥ 99%
Budget: $4,000/monthThe normal day's design must cost at most $4,000 a month.Cost ≤ $4,000/month

Must include

More design a product problems