Design an online ads serving system
Company: OpenAI
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Design an online ads serving system that returns targeted ads within 100 ms end-to-end. Support campaign management, budgets, pacing, frequency capping, targeting (keywords, user segments, geo), ranking using predicted CTR/CVR and bid, real-time auctions, and near-real-time reporting. Specify APIs for ad request and response and define core data models. Outline the architecture (edge gateways, ad selector, feature store, model service, auctioneer, throttling and pacing service, caching, logging pipeline, offline analytics). Discuss auction choice and incentives, handling cold start, deduplication, A/B testing strategy, and privacy and compliance (e.g., GDPR/CCPA). Address scaling, storage and indexing choices, consistency guarantees, fault tolerance, backpressure, and capacity planning with back-of-the-envelope estimates.
Quick Answer: This question evaluates a candidate's competency in large-scale, low-latency distributed system design, covering real-time ad selection and auction mechanics, API and data-model design, scaling, fault tolerance, near-real-time reporting, and privacy/compliance considerations.