Design an Ad Content Delivery System with A/B Testing
Design an ad content delivery (ad serving) system that selects and serves ads to users, and supports A/B testing and experimentation.
Core Scenario
A client (e.g., a web or mobile application) requests an ad for a specific placement (e.g., a homepage banner). The system must efficiently choose an eligible ad and return its creative metadata quickly.
Requirements
Functional
- Campaign and Creative Management: The system must allow for the creation and management of ad campaigns and their associated creatives. Basic campaign metadata is sufficient.
- Targeting: Support for targeting ads based on at least country, device type, and application placement. Optionally, the system should support targeting based on user segments.
- Ad Selection: The system must select an appropriate ad to serve for each incoming request.
- Tracking: Implement impression and click tracking for served ads.
- Delivery Controls: Include at least one basic delivery control mechanism, such as pacing/budget management, frequency capping, or deduplication.
- A/B Testing: The system must support running experiments that modify ad selection/ranking logic or creatives. This includes deterministically assigning users to different variants and logging the outcomes of these assignments.
Non-functional
- Low Latency: Ad requests must be served with very low latency, typically within tens of milliseconds.
- High Throughput: The system should be capable of handling high throughput, assuming millions of requests per day or more.
- High Availability: The system must be highly available.
- Reporting Accuracy: Define what aspects of reporting must be real-time versus those that can be eventually consistent.
Deliverables
- A high-level architecture outlining key services.
- Data model and storage choices for campaigns, targeting rules, and events.
- A detailed serving path, from request initiation to decision making and response, including caching strategies.
- An event logging pipeline and a strategy for metrics collection.
- A comprehensive A/B test design, covering user assignment, exposure logging, metric computation, and guardrails.
- Identification and discussion of key trade-offs and potential failure modes.
AI interview prep
Core dilemma
Balancing ultra-low latency, high-throughput ad serving with the robust, consistent, and auditable infrastructure required for A/B experimentation and accurate analytics.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design an Ad Content Delivery System with A/B Testing
Design an ad content delivery (ad serving) system that selects and serves ads to users, and supports A/B testing and experimentation.
Core Scenario
A client (e.g., a web or mobile application) requests an ad for a specific placement (e.g., a homepage banner). The system must efficiently choose an eligible ad and return its creative metadata quickly.
Requirements
Functional
- Campaign and Creative Management: The system must allow for the creation and management of ad campaigns and their associated creatives. Basic campaign metadata is sufficient.
- Targeting: Support for targeting ads based on at least country, device type, and application placement. Optionally, the system should support targeting based on user segments.
- Ad Selection: The system must select an appropriate ad to serve for each incoming request.
- Tracking: Implement impression and click tracking for served ads.
- Delivery Controls: Include at least one basic delivery control mechanism, such as pacing/budget management, frequency capping, or deduplication.
- A/B Testing: The system must support running experiments that modify ad selection/ranking logic or creatives. This includes deterministically assigning users to different variants and logging the outcomes of these assignments.
Non-functional
- Low Latency: Ad requests must be served with very low latency, typically within tens of milliseconds.
- High Throughput: The system should be capable of handling high throughput, assuming millions of requests per day or more.
- High Availability: The system must be highly available.
- Reporting Accuracy: Define what aspects of reporting must be real-time versus those that can be eventually consistent.
Deliverables
- A high-level architecture outlining key services.
- Data model and storage choices for campaigns, targeting rules, and events.
- A detailed serving path, from request initiation to decision making and response, including caching strategies.
- An event logging pipeline and a strategy for metrics collection.
- A comprehensive A/B test design, covering user assignment, exposure logging, metric computation, and guardrails.
- Identification and discussion of key trade-offs and potential failure modes.