Design Impression and Click Counting for Promoted Pin Billing

Last updated: November 29, 2026

Quick Overview

Design the system that counts impressions and clicks on promoted Pins, deduplicates and filters invalid traffic, and produces numbers that are accurate enough to bill advertisers and fast enough to power near real-time budget pacing.

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

0

0

0 solved


Design the system that counts impressions and clicks on promoted Pins, deduplicates and filters invalid traffic, and produces numbers that are accurate enough to bill advertisers and fast enough to power near real-time budget pacing.

Ads are Pinterest's main revenue source, and counting events wrong either overcharges advertisers or leaks money. This system design round checks exactly-once style aggregation, a clear split between a fast approximate path and an authoritative billing path, and invalid traffic handling.

What the Interviewer Expects
  • Separates real-time pacing counts from authoritative billing counts
  • Defines a billable impression precisely (viewable, deduped)
  • Achieves effectively exactly-once counting with idempotent keys
  • Handles late and duplicate events with event-time windows
  • Includes invalid traffic filtering and reconciliation
Key Topics to Cover
stream processing
exactly-once
ads billing
deduplication
lambda architecture
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
  • An advertiser disputes a day's click count; how do you answer them?
  • How would you stop a campaign within seconds of exhausting its budget?
  • How do you handle a client release that double fires impression events?
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: count billable impressions and clicks per ad, campaign and advertiser; expose near real-time spend for pacing; produce daily invoiced totals; filter bots and duplicates.

Non-functional: b...

High-Level Design

Clients emit events with an event id (uuid generated on device), ad id, request id from the ad server, user id, timestamp and viewability info. Edge collectors validate, append to Kafka partitioned by...


Submit Your Answer
Markdown supported