Design Ad Click Aggregation With Exactly-Once Billing Counts

Last updated: November 29, 2026

Quick Overview

Design the pipeline that ingests ad impressions and clicks across Meta's apps, aggregates them per ad and per minute for advertiser dashboards, and produces counts accurate enough to bill advertisers.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the pipeline that ingests ad impressions and clicks across Meta's apps, aggregates them per ad and per minute for advertiser dashboards, and produces counts accurate enough to bill advertisers.

Ads revenue depends on correct counting, so this prompt shows up in Meta onsites for backend and data infrastructure candidates. The interviewer focuses on deduplication, late events, the difference between real-time and billing-grade numbers, and click fraud filtering.

What the Interviewer Expects
  • Separate the fast approximate path from the reconciled billing path
  • Deduplicate events using a unique event ID and a bounded dedup window
  • Handle late and out-of-order events with event-time windows and watermarks
  • Filter invalid traffic before billing
  • Make aggregation idempotent so replays do not double count
Key Topics to Cover
Stream processing
Deduplication
Watermarks
Lambda architecture
Click fraud
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How long should the dedup window be and what does it cost in memory?
  • How would you support ad-hoc queries by age bucket and placement?
  • An advertiser disputes a bill; how do you prove the count?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: record impressions and clicks with ad_id, campaign, placement, user attributes; show per-minute counts within a minute; produce daily billing totals. Non-functional: no double bill...

High-Level Design
  • Clients and servers log events with a unique event_id (generated where the ad was served) to an ingestion tier that writes to a durable partitioned log (keyed by ad_id).
  • Real-time path: ...

Submit Your Answer
Markdown supported