SevyDevy

Design the database for a DSP ads platform

PremiumDatabase designHard

  • DSP
  • Insertion orders
  • Line items

Quick answer

This database design interview question asks you to design the database for a DSP ads platform. Aim for a design that stores data correctly and serves its main queries well, then explain the schema, keys, indexes and trade-offs. Interviewers want to see how you model entities, choose keys and design for the real access patterns.

The problem

Design the database for a DSP ads platform, the demand-side platform advertisers use to buy video and display ads. It stores advertisers, campaigns, insertion orders, line items, creatives, targeting, budgets, flights and delivery stats. The hard parts are budgets that must never overspend and one model that serves both pacing and reporting.

What must the database for a DSP ads platform do?

  • Campaign setup: Traders create advertisers, campaigns, insertion orders (IOs), line items and creatives, and assign creatives to line items. Each exchange approves a creative separately before it can serve there.
  • Budgets and flights: An IO has flights, each with dates and a budget; a line item has a budget, flight dates, a daily cap and a pacing mode (even or as fast as possible).
4 more requirementsUnlock to see all

How well must it do it?

  • No overspend: Spend never exceeds an IO flight budget by more than 1 percent, and a line item never pushes its IO over.
  • Report speed: A 90-day report for one advertiser returns in under 3 seconds.
3 more requirementsUnlock to see all

What scale should you design for?

Use these numbers in your estimates.

The scale numbers unlock with this questionUnlock

Key concepts

  • DSP
  • Insertion orders
  • Line items
  • Budget pacing
  • Columnar storage
  • Audit history

How you’ll practise

6 short steps · save and come back any time
  1. Access patterns
  2. Entities
  3. Schema
  4. Indexes and queries
  5. Scale and consistency
  6. Wrap-up

Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.

What do interviewers look for?

In any database design round.

  • Lists the entities and how they relate before writing tables
  • Designs the schema around the main access patterns
  • Chooses primary keys, foreign keys and indexes with reasons
  • Explains where to normalise and where to denormalise
  • Considers integrity, transactions and concurrent writes
  • Plans for growth: partitioning, archiving and migrations

Questions people ask about this interview question

Which design type is this question?
It is a database design question. You design the database for a DSP ads platform and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Hard. It suits engineers preparing for senior interviews, where you are expected to drive the discussion and go deep on trade-offs.
What should I cover first?
Start with the entities and the main queries the database must answer. Agree on scope with the interviewer before you design anything.
Can I practise it for free?
It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.

Related questions

Updated · Written by the SevyDevy team

Premium questionSign up free, then unlock it