HLD-410·Payments & Ledger
Expert · 2,000 ptsReal-Time Bidding (RTB) Ad Exchange & 45ms Budget Pacer
Design Google AdX / The Trade Desk’s ultra-low-latency ad auction and campaign budget pacing tier enforcing strict p99 <= 45ms deadlines without overspending advertiser daily caps.
Max p99
≤ 45 ms
Availability
≥ 99.5%
Budget
≤ $11,700
Functional Requirements
- FR-1POST /rtb/auction/{campaign_id} — Evaluates user segment features, checks remaining budget lease, and clears second-price/first-price bid.
- FR-2GET /rtb/campaigns/{campaign_id}/pacing — Serves active bid-shading multiplier and remaining slice quota.
- FR-3POST /rtb/auction/{campaign_id}/reverse — Supports idempotent reversal/refund or campaign pause updates while keeping cached balances and deduplication keys consistent.
- FR-4Must prevent runaway campaign budget overspend (read-after-write lease pacing) and survive primary DB crash.
Workload Profile
Baseline Ad Impressions88,000 Auction Read RPS / 15,000 Win/Spend Write RPS
Live Sports Halftime Peak225,000 Read RPS / 36,000 Spend Write RPS
Active Working Set52 GB user audience profiles & campaign pacing slices
Latency GateHard exchange auction cutoff p99 <= 45 ms
Consistency Model
Read-after-write on depleted campaign budget leases so exhausted campaigns immediately stop bidding.
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Design Write-up
0 boxes · 0 edges
0 words