Skip to content

ONE QUESTION. YOUR REASONING.

Design an ad serving system

Design the system that picks the ad for each ad slot in a feed: it matches targeting, respects budgets and frequency caps, and answers fast enough not to slow the page.

System designInfrastructure and platformSeniorStaff

YOUR BRIEF

What to work through

Work through an ad serving system as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.

  • For each ad slot request, return at most one ad, or none, from the eligible campaigns
  • Match targeting: audience segments, keywords and location
  • Rank eligible ads by bid and predicted click rate, and run an auction for the price
  • Spend each campaign’s budget evenly over its flight, without overspending
  • Cap how often one user sees the same ad or campaign

BEFORE YOU START

Constraints to discuss

  • An answer within 100 ms end to end, 50 to 70 ms of it on the server
  • Up to 1 million ad requests a second at peak in Netflix’s framing
  • Worst-case overspend held to a small single-digit percentage
  • 99.9% availability per region, serving no ad rather than failing the page
  • Spend and impressions reported within 5 minutes
Need a starting point?

Watch for these common gaps as you prepare:

  • Querying the campaign database on every ad request instead of an in-memory index
  • One central budget counter written on every impression by every server
  • Ignoring that spend arrives late, so pacing overshoots at the end of the day
  • Running the heavy model on every campaign instead of after retrieval and filters
  • Failing the page when the ad path is slow instead of returning no ad
  • Putting click counting for reports in the serving path
Read: System design questions and who asks them

Why this question is in the collection

These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.