System design interview questionHard

Design an Ad Click Aggregator

Design a system to track ad clicks and aggregation for real-time analytics and billing.

1. Problem Statement

Our ad platform needs to count clicks per ad in near real time for advertiser dashboards and bill advertisers accurately at the end of each day. How would you design it?

2. Architecture Discussion Map

Use this as one discussion aid, not a single correct answer. Your design should follow from the requirements, scale, and trade-offs you establish.

Rendering architecture diagram...
Mermaid Source (For AI Bots)
graph LR
    A["Design an Ad Click Aggregator"]
    A --> F1["Real-time aggregation Count Clicks per Ad"]
    A --> F2["Correctness Advertisers must be billed correctly"]
    A --> F3["Click-ID deduplication, separate from invalid-traffic filtering"]
    A --> F4["Aggregate-store choice and rollups for advertiser queries"]

3. Key Focus Areas

  • 1
    Real-time aggregation (Count Clicks per Ad)
  • 2
    Correctness (Advertisers must be billed correctly)
  • 3
    Click-ID deduplication, separate from invalid-traffic filtering
  • 4
    Aggregate-store choice and rollups for advertiser queries

4. What the Interviewer Looks For

The interviewer probes these areas, and the report grades the interview against them.

  • Semantics, scope, and estimation
  • Ingestion, deduplication, and idempotency
  • Event-time aggregation and late data
  • Billing correctness and reconciliation
  • Query serving and operations

Want interactive feedback?

Practice drawing this system component-by-component on a live whiteboard while the interviewer probes at your target level.

Continue to Dashboard

Core Concepts

Stream ProcessingIdempotencyAnalytics

Continue preparing

Build a complete software engineer mock interview plan

Related System Design

Design a Payment System

Design a reliable payment service that charges customers through external payment processors. Focus on correctness and idempotency.

Related System Design

Design Product Search Autocomplete

Design personalized, trend-aware autocomplete and search suggestions for a large online store's product search, built around a ranking model you are given.

Related System Design

Design a Cross-Product Tagging System

Design a shared tagging service that lets users apply tags to entities across multiple Atlassian products, with consistent search and deduplication.