Recommendation System

Design a large-scale personalized recommendation system for feed/video/ads.

00

Practice checkpoints

The requirements are open as a taste. From the numbers onward, the full guide opens in the app.

  1. 01
    Clarify scope
  2. 02
    Requirements + scale
  3. 03
    API + data modelUnlocks in the app
  4. 04
    Draw architectureUnlocks in the app
  5. 05
    Deep diveUnlocks in the app
  6. 06
    Trade-off decisionUnlocks in the app
01

Requirements that shape the design

Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.

Functional requirements

01What is the recommender optimizing — clicks, watch time, or something closer to long-term value?

The business goal is translated into an explicit ML objective before any architecture: a pure click model drowns the feed in clickbait, a watch-time model favors long sessions, and most platforms optimize a weighted blend approximating long-term satisfaction — the choice shapes labels, features, and every metric downstream. One platform then serves several surfaces — home feed, similar-items rails, video tab — with shared retrieval, feature, and experiment infrastructure and per-surface ranking policies.

02Where do candidates come from — a single model?

Candidates are merged from several sources: two-tower embedding retrieval, item-to-item similarity, trending, follow/graph edges, and business campaigns — no single source covers every user state.

03We have 100M items and 100 slots on screen. What happens in between?

A multi-stage funnel narrows the catalog: retrieval to a few thousand candidates, a light ranker to a few hundred, a heavy ranker over the survivors, then a blender applies diversity and business rules.

04Will the user see the same item again tomorrow?

Exposure is remembered: impressions are logged per user, and recently shown items are filtered or demoted at retrieval time so the feed does not repeat itself.

05What does a day-one user see — and when does a day-one item first appear?

Cold start works on both sides: new users get popularity priors shaped by onboarding interests; new items enter through content embeddings plus a reserved exploration slice of traffic.

06A new model wins offline. Do we just ship it?

Every ranking change ships through an experiment: offline metrics as the gate, then an A/B against guardrail metrics, with a long-term holdback group to catch slow damage.

Out of scopeThe ads auction and bid pricing (a sibling system that consumes these rankings) · Content-moderation classifiers (we consume their policy labels as filters) · Model-architecture research — we design the serving and learning platform around the models

Non-functional requirements

01What is the latency budget, end to end?

p95 under roughly 200 ms for the whole recommendation call — this one number is what forces the funnel shape and the feature-store design.

02I hide an item. Does the very next request know?

Freshness is tiered, not uniform: the last few actions influence the very next request (seconds), counters lag minutes, long aggregates and embeddings lag hours to a day.

03Can training data quietly diverge from what serving saw?

Point-in-time correctness is a hard requirement: the model trains only on feature values as they existed at the moment of each impression — ideally the logged served values themselves.

04The heavy ranker is down. What does the user see?

The surface always renders: if ranking degrades, serve cached results, then a popularity fallback — a generic feed beats an empty one.

05A launch goes wrong. How fast can we know, and undo it?

Every response carries a trace (model version, experiment arm), guardrails are monitored per model, and rollback is a registry pointer swap, not a redeploy.

Keep asking — the interview is a conversation

Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.

  • Which surfaces are in scope, and what is the primary objective — clicks, watch time, conversion, or long-term retention?
  • After a user hides or buys something, must the very next request reflect it, or is minutes-later acceptable?
  • Are we allowed to re-show items the user already saw, and how far back does that exposure memory go?
  • How much traffic can we spend on exploration and experiments without hurting today’s metrics?
  • Which guardrails are non-negotiable: diversity, creator fairness, unsafe-content filtering, ad load?
01

Unlock the full playbook for Recommendation System

Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.

02

Numbers that force architecture decisions

Locked in the app

03

Architecture path

Locked in the app

04

API and data model

Locked in the app

05

Deep dive directions

Locked in the app

+Series

Practice the related series