RETURN TO SYSTEM DESIGN VAULT (55)BLUEPRINT #55 // Very Hard
#55Very HardFinTech & Transactional APIs

Develop an Ads Management and Display System for a Social Feed

ASKED IN INTERVIEWS AT:MetaGoogleAmazonPinterest

EXECUTIVE SUMMARY & PROBLEM STATEMENT

Design an ad-serving platform executing real-time bidding (RTB) auctions in under 50ms, budget pacing, user targeting, and conversion attribution.

SCALE ESTIMATION & TRAFFIC ENVELOPE

DAILY ACTIVE USERS / TPS1 Billion ad impressions per day, 50,000 auctions/sec
READ / WRITE TRAFFIC RATIOReal-time read auctions with high volume telemetry click writes
5-YEAR STORAGE CAPACITYDistributed in-memory candidate indices in Redis + ClickHouse for telemetry

FUNCTIONAL REQUIREMENTS

  • [1]Advertisers create campaigns, target demographics, and set daily budgets
  • [2]Run second-price Vickrey auction on every feed ad slot
  • [3]Track impressions, clicks, and conversions

NON-FUNCTIONAL REQUIREMENTS

  • •Auction completion latency < 40ms
  • •Zero budget overspend (smooth pacing throughout 24 hours)
  • •High availability under global feed traffic

CORE ARCHITECTURAL COMPONENTS

Auction Engine (C++ / Go)
Targeting Candidate Index
Probabilistic Pacing Service (Redis)
Ad Serving Mixer
Billing & Attribution Ledger

DATA SCHEMA & PERSISTENCE

Campaigns (id, advertiser_id, daily_budget_cents, bid_cpm, targeting_json), UserProfiles (id, age, gender, interest_tags)

DISTRIBUTED TRADE-OFFS & FAILURE MODES

  • ⟡Probabilistic pacing artificially throttles bids during early hours to avoid burning an entire daily budget before peak evening shopping.