Design an ad pacing system
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Netflix's system design round, last asked Apr 2026. It tests ads, budgets and rate control.
Design the pacing system for a large video advertising platform. Advertisers create campaigns with budgets, start and end dates, targeting and a delivery goal (impressions, clicks or spend). For every ad request the platform decides in real time which campaigns may serve, and pacing must spread each campaign's delivery smoothly over its flight instead of exhausting the budget in the first hours.
Requirements
- Functional: track spend, impressions and remaining budget per campaign; decide eligibility and throttling per request; re-pace as traffic changes; support nested budgets (campaign, ad group, daily).
- Non-functional: about 1M ad requests per second at peak and hundreds of thousands of active campaigns; a per-request decision within a few to tens of milliseconds at p99; overspend bounded to a small percentage; events that are late, out of order or duplicated.
Clarifying questions
- What is the delivery goal, and can one campaign mix goals?
- Is serving an auction (where bid multipliers are a lever) or a direct decision on owned inventory?
- Is the budget a hard cap or a soft target reconciled later, and what overspend is acceptable?
- How do ad-group and daily budgets relate to the campaign budget?
- How many candidate campaigns does a request consider?
What a strong answer covers
- A clear split between the fast serving path (reads cached pacing state, decides in microseconds) and a slower pacing control loop (recomputes targets every few seconds or minutes), with which state each owns.
- A pacing algorithm beyond linear: a target spend curve from a traffic forecast, a feedback controller on the gap between target and actual, and stability so it does not oscillate.
- Throttling levers: an admission probability, token buckets, bid multipliers, and when each fits.
- Overspend prevention across many serving nodes: budget escrow or tokens handed to nodes, sharded counters, soft and hard limits, and the resulting worst-case overspend bound.
- Nested budgets checked together, and an idempotent event pipeline (deduplication by event id, watermarks for late events) reconciled against the billing ledger.
- Data model, APIs, storage, how pacing state reaches serving nodes, hot-campaign handling, monitoring (delivery versus target, overspend, pipeline lag) and degradation when components fail.
Follow-ups
- One campaign carries a large share of total spend in one hot region: how do you avoid one counter becoming the bottleneck?
- A live event spikes traffic far above forecast for a few hours: how does the controller react before its next tick?
- An advertiser halves a daily budget mid-flight: how fast and safely does that reach every node?
- Add per-user frequency caps on top of pacing.
Where it's asked
- Netflix · System design · Last asked Apr 2026Design discussion; some loops split a general round from a team-specific one
What it tests
ads · budgets · rate control · streaming
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
