YOUR BRIEF
What to work through
Work through an ad click aggregator as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.
- Clicking an ad records the click and redirects to the advertiser’s site
- Advertisers query clicks per ad over any time range, at 1-minute granularity
- Queries can filter by dimensions such as country
- Bonus: the 100 most clicked ads of the last minutes, refreshed every minute
BEFORE YOU START
Constraints to discuss
- A peak of 10,000 clicks a second
- Advertiser queries answer in under a second
- No click lost, and none counted twice
- Counts visible within a few minutes end to end, as close to real time as possible
Need a starting point?
Watch for these common gaps as you prepare:
- Writing clicks and serving advertiser queries from the same database
- A client-side redirect that lets users skip the tracking
- Dedup by user id, or inside Flink windows
- Writing the dedup cache before the stream, which can lose clicks
- Proposing Flink checkpointing by default, or a time-series database for queries with many dimensions
Why this question is in the collection
These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.