Ad Serving and Performance Statistics
Serve ads under partner delivery caps or paced hourly allowances, handle synchronized live-video breaks, and retain trustworthy observed-event reports.
Problem statement
For this exercise, assume organizations register image ads for web placements and already-prepared video creatives for client-driven live-video ad breaks and can activate or pause them. A placement requests one eligible ad and receives its creative reference and a delivery ID, or an explicit no-fill response.
Rotate fairly among currently pacing-eligible active ads assigned to that placement; auctions and personalized ranking are outside scope. Pausing must stop new delivery decisions within 60 seconds, while events for previously issued deliveries remain valid.
A served response is not an impression. Clients report observed impressions and clicks. Each issued delivery can contribute at most one of each event kind independently, even if clients retry.
Events can arrive out of order and are accepted up to 24 hours after delivery issuance; attribute them to the UTC day when that delivery was issued. Counts reflect received observations rather than guaranteed client completeness.
Once a valid event is durably acknowledged, processing failures must not lose it or count it twice.
An organization operator compares per-ad impression and click counts over the same UTC-day interval, with a freshness indicator and provisional status until the late-event window closes. Reports must isolate organizations. Do not claim that raw count differences establish causal creative quality.
Exclude billing, conversions, fraud detection and media transcoding; show the boundary to creative-byte delivery.
For this exercise, each ad has one organization-owned delivery policy for a UTC-hour window: ASAP up to a configured count Q, or evenly paced at Q deliveries per hour, such as 10,000/hour. The quota unit is a newly issued delivery authorization, not an observed impression, HTTP request or click.
A delivery can contribute at most one observed impression, so this conservative issuance cap bounds possible impressions but may underdeliver when clients do not display ads. ASAP can use its whole hourly allowance when opportunities exist.
Even pacing permits at most floor(Q × elapsed seconds / 3600) new deliveries by a point in that hour; unused allowance can catch up within the hour, but never rolls into the next. Explain quota consumption, retries and failover rather than only limiting generic endpoint traffic.
Quota or mode changes take effect in the next window; pause keeps its existing 60-second bound. A missing client event never proves that an issued delivery can be safely reclaimed.
For this exercise, a live-video player asks for an ad at a break identified by a trusted playback-session/break record. The request is bound to organization, placement, playback session and break ID, with one allowed delivery result for that break.
Use a server-validated break deadline of one second after its scheduled start; an expired break returns no-fill. Repeat or concurrent requests recover the same decision instead of consuming another quota unit. A decision whose reply is lost remains consumed if it was durably issued.
A late retry may recover its status but must not start new playback after the deadline. Creative bytes come from the existing media/CDN boundary; live-stream transport, server-side stitching, transcoding, auctions, monetary budgets and billing are outside scope.
Explain synchronized-break bursts, bounded state lookup, overload/no-fill and isolation from measurement lag. The stable break-decision key is unique across all candidate ads and UTC-hour windows; changing the selected ad or hour cannot create another decision for that break.
An issued result or durably recorded terminal no-fill is final for that key. A temporary unavailable or outcome-unknown response may be retried only under the same key and unresolved selection state. Recheck the trusted break deadline in the final guarded issuance transition.
Every response carries its playback validity deadline, and the player must reject late first responses as well as late retries; status recovery never authorizes new playback after that deadline.
What to build
- Organization operators register ads with creative references and placements, activate them, and pause future delivery decisions within 60 seconds. Operators select the next UTC hour’s per-ad ASAP cap or evenly paced delivery allowance.
- Placements and live-video breaks receive one pacing-eligible ad and stable delivery identity, or explicit no-fill; repeated break requests cannot issue another delivery. Creative bytes stay behind the media/CDN boundary.
- Accept observed impression and click events for issued deliveries, enforce their 24-hour acceptance window, and count each delivery/event-kind at most once despite retries or replay.
- Authorized operators compare their per-ad UTC delivery-day counts with freshness and provisional status; acknowledged events remain recoverable through processing failure.
At scale
- For this exercise, assume 10,000 organizations and 1 million active ads; ad-serving traffic is 50,000 requests/second with p95 at most 150 ms and 99.9% monthly availability.
- Assume 100,000 impression/click events per second, with bursts of three times that rate for 15 minutes; ingestion and reporting may degrade independently of serving. For this exercise, synchronized live breaks can also raise decision traffic to three times the serving baseline for ten seconds; the break deadline and safe no-fill behavior still apply.
- Under normal load, 95% of accepted events appear in reports within 5 minutes. Accept events for 24 hours after their delivery was issued and retain 30 days of aggregate reports.
- Keep acknowledged input recoverable until it has been correctly applied and its reporting cohort closes. Pause propagation must stay within 60 seconds; no particular storage or queue product is required. For this exercise, hard issuance overshoot is zero per ad/window, unknown issued decisions are not recycled, and low demand or playback failure may cause underdelivery.