Meta System Design: Real-Time Ad Auction Platform
Question Description
Design a real-time ad auction platform that chooses which ads to show in a social feed (think Meta / Instagram). You must support real-time bidding (RTB) from advertisers, enforce targeting and budget/frequency constraints, run a low-latency auction per impression, and return personalized ads within tight SLAs.
Core task: describe the end-to-end architecture and data flow for millions of concurrent auctions per second while keeping the entire auction + ad delivery under 100 ms. Explain how bids are collected, how targeting is enforced, how you combine bid amount and a relevance score (e.g., predicted CTR) in a second-price auction, and how results are logged for billing and analytics.
High-level flow / stages:
- Request intake: the feed service sends an ad request with user profile/context and available slots.
- Pre-filtering & targeting: quickly narrow candidate ads using targeting indices, keyword/tag filters, and budget/frequency checks.
- Real-time bidding and auction: route eligible bidders (or cached bids) into a fast auction service that scores by effective CPM (bid * predicted CTR) and runs a second-price win calculation adjusted for relevance.
- Serve response: return winning creative(s) to the feed with minimal payload and latency.
- Post-auction: async logging, billing, attribution, and feedback to ML models and A/B testing frameworks.
Skill signals you should demonstrate: distributed systems and horizontal scaling, latency optimization (p95/p99 tuning), caching and indexing strategies for targeting, familiarity with RTB and second-price auctions, consistency and logging design for billing, and how to support experiments/A-B testing. Mention practical trade-offs (eventual consistency for analytics, sync vs async billing) and monitoring/SLAs to meet 99.99% uptime and cost constraints.
Common Follow-up Questions
- •How would you implement budget pacing and global spend limits across many auctions while ensuring advertisers don’t overspend?
- •Design the frequency-capping subsystem: how do you track impressions per user per campaign at scale with low latency?
- •How would you extend the auction to support multiple ad slots per page (multi-slot auctions) and handle bundling/pricing?
- •Explain how you would detect and mitigate bid or click fraud, and what signals you’d use for real-time filtering.
- •If the CTR model changes frequently, how do you update relevance scores without violating the 100 ms latency constraint?
Related Questions
Explore More Questions
Practice This Question with AI
Get real-time hints, detailed requirements, and insightful analysis of the question.