System design interview questionHardAnalytics / Ads

Design an Ad Click Aggregator

Design an ad click aggregator: ingest huge click streams, aggregate counts, and serve campaign stats.

Interview scope

Client β†’ Gateway/LB β†’ App β†’ Message Queue; workers aggregate to DB (+ Cache for hot stats). No Client β†’ Queue/DB.

Functional requirements

  • Accept click events from many clients/edges.
  • Aggregate clicks per ad/campaign.
  • Query recent totals for dashboards.

Scale and quality goals

  • Extremely write-heavy β€” buffer with a queue.
  • Don’t update a single SQL row per click synchronously forever.
  • Hot aggregates can live in cache; durable totals in DB/object tiers.

Capacity assumption

Design for this scale

Assume ~1B clicks/day (~12k events/s average); peaks much higher during big campaigns.

Practice more than a diagram

Place components on the Froquiz canvas, connect the data flow, and see which decisions the scenario-specific review finds missing. The full exercise and review unlock with Premium.

Explore Premium β†’