Design an Ad Serving System

Quick Overview

Design a real-time ad serving platform. Cover ad auction mechanics, CTR prediction integration, targeting based on user signals, budget pacing, frequency capping, and serving ads within strict latency budgets.

Google
System Design
Software Engineer
Google
Software Engineer
Onsite
System Design
Hard

0


Design a real-time ad serving platform. Cover ad auction mechanics, CTR prediction integration, targeting based on user signals, budget pacing, frequency capping, and serving ads within strict latency budgets.

This is a Google system design onsite question close to its core ads business. The interviewer checks whether you can run targeting, CTR prediction, and an auction within a tight latency budget while keeping budgets, pacing, and frequency caps correct at global scale.

What the Interviewer Expects
  • Clarify the latency budget and request volume before designing
  • Lay out the serving path: candidate retrieval, filtering, CTR scoring, auction
  • Explain auction mechanics such as ranking by bid times predicted CTR
  • Design budget pacing and frequency capping with fast counters
  • Separate the real-time serving path from logging and billing pipelines
  • Discuss consistency trade-offs for budget counters across regions
Key Topics to Cover
Ad auctions
CTR prediction
Budget pacing
Frequency capping
Low-latency serving
Targeting
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
  • How do you prevent an advertiser from overspending when counters are eventually consistent?
  • How do you keep CTR model inference within a few milliseconds?
  • How would you handle a new advertiser with no click history?
  • What happens to serving if the targeting index is stale?
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 Requirements:
    1. Ad Auction Mechanic: Must support real-time auctions for ad placements based on bids, targeting, and CTR (click-through rate) predictions.
    2. **Targeting:...
Capacity Estimation

To estimate the capacity needed for the ad serving system, we can consider the following:

  • User Base: Assume 1 billion active users globally.
  • Ad Requests: If each user generates 10 ad r...

Submit Your Answer
Markdown supported