Skip to main content

Classic design · Senior

Video recommendation

Classic interview design. Key points: candidate generation + ranking, two-tower, implicit feedback, cold start, and A/B.

16 min read · Content reviewed on October 23, 2026

Short answer

Classic interview design. Key points: candidate generation + ranking, two-tower, implicit feedback, cold start, and A/B. The case is recommending the next video ("up next") while the user watches another. For the design, scale assumptions are adopted: about 1B videos, 1B daily active users, 5 videos on screen at once, and a response in a 250ms window.

01 · CONTEXT AND REQUIREMENTS

What recommending the next video means

The case is recommending the next video ("up next") while the user watches another. For the design, scale assumptions are adopted: about 1B videos, 1B daily active users, 5 videos on screen at once, and a response in a 250ms window. This agreement is the starting point of the requirements gathering.

Before the model comes the business goal. Optimizing click-through rate is easy to measure but can lead to greedy behaviors; maximizing watch time aligns better with an ad-supported platform; and the option adopted in the case is quality-adjusted watch time.

CriterionClick-through rateWatch timeQuality-adjusted time
VantagemEasy to measure and optimizeAligns with an ad-supported platform and controls the retention problemCombines time with signals such as ratings, completion rate, and sharing
RiscoSensationalist thumbnails generate clicks, but without retention the user leavesMay promote addictive, low-quality contentMay still miss factors such as creator sustainability and diversity

02 · STAGED ARCHITECTURE

From the entire catalog to a few videos

Systems for recommendation at scale almost always use a multi-stage architecture, relatively standard in the industry. The YouTube neural network paper describes two networks, one for candidate generation and another for ranking; the design below extends this funnel with a light ranker and a final re-ranking, as in the case.

  1. The app requests next-video recommendations from the recommendation service, which coordinates the following stages.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation servicecoordinates the funnel
    CPCandidate generators
    DBVector database
    CHPrecomputed candidate cache
    CPLight ranker
    CPHeavy ranker
    CPList re-ranking
  2. Several candidate generators run in parallel, with universal or personalized context, and many of them are thin interfaces over the vector database.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation service
    CPCandidate generatorsin parallel
    DBVector databasevizinhos
    CHPrecomputed candidate cache
    CPLight ranker
    CPHeavy ranker
    CPList re-ranking
  3. Limited-context generators can be precomputed and cached.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation service
    CPCandidate generators
    DBVector database
    CHPrecomputed candidate cacheprecomputed
    CPLight ranker
    CPHeavy ranker
    CPList re-ranking
  4. The light ranker shrinks the candidate set with features that are fast to compute, and what matters in it is recall.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation service
    CPCandidate generators
    DBVector database
    CHPrecomputed candidate cache
    CPLight rankerprioritizes recall
    CPHeavy ranker
    CPList re-ranking
  5. The heavy ranker uses the full feature set to score the remaining videos.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation service
    CPCandidate generators
    DBVector database
    CHPrecomputed candidate cache
    CPLight ranker
    CPHeavy rankerfull features
    CPList re-ranking
  6. Re-ranking adjusts the list as a whole, balancing engagement, creators, and platform health.

    Architecture diagram: Next-video recommendation funnel
    CLVideo app
    CPRecommendation service
    CPCandidate generators
    DBVector database
    CHPrecomputed candidate cache
    CPLight ranker
    CPHeavy ranker
    CPList re-rankingvalue model
CriterionLight rankerHeavy ranker
PrioridadeHigh recall, low latency, and high throughputHigh precision, high quality, and lower throughput
Typical modelTree-based model, such as GBDTTransformer-based architecture, which has become the preferred one in recommendation
CustoRuns on CPU with latency under a millisecondComputationally more expensive than DLRM

In the YouTube paper, scoring the entire catalog within tens of milliseconds requires approximate scoring, and the service generates hundreds of candidate videos through an approximate nearest neighbor search.

03 · DATA AND MODELS

What the model learns and from what

Most training data comes from implicit feedback. Explicit signals have high quality but are relatively rare. Videos that make the user leave the platform are among the strongest implicit negative signals.

Video content features can be computed once, at upload or edit time, and cached for a long time. Engagement features are more dynamic and need more frequent updating, with careful normalization.

Computing and updating these features is typical work for a data pipeline.

  1. In the design, each user interaction becomes an event in a queue, and a pipeline turns those events into training examples.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queueevent queue
    CPTraining example pipelinebuilds examples
    DBExample storage
    CPTower training
    DBVector database
    CPCandidate generator
    CHEmbedding and candidate cache
  2. Most examples come from implicit feedback, and videos that make the user leave the platform are strong negative signals.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queue
    CPTraining example pipeline
    DBExample storageready examples
    CPTower training
    DBVector database
    CPCandidate generator
    CHEmbedding and candidate cache
  3. Two parallel towers learn embeddings of the user and the candidate videos, from triplets of user, positive video, and negative video.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queue
    CPTraining example pipeline
    DBExample storage
    CPTower trainingtwo towers
    DBVector database
    CPCandidate generator
    CHEmbedding and candidate cache
  4. In negative sampling, hard negatives are favored.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queue
    CPTraining example pipeline
    DBExample storage
    CPTower traininghard negatives
    DBVector database
    CPCandidate generator
    CHEmbedding and candidate cache
  5. The user and candidate video embeddings go to the vector database, from where they are retrieved.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queue
    CPTraining example pipeline
    DBExample storage
    CPTower training
    DBVector databaseembeddings
    CPCandidate generator
    CHEmbedding and candidate cache
  6. The generator queries the database with an embedding and retrieves the K nearest vectors; embeddings and candidate results can be cached.

    Architecture diagram: Tower and embedding training
    CLVideo app
    QInteraction event queue
    CPTraining example pipeline
    DBExample storage
    CPTower training
    DBVector database
    CPCandidate generatorsearches neighbors
    CHEmbedding and candidate cachecaches results

The case's final ranker uses a transformer-based architecture, optimized for several prediction tasks. Watch time is a regression head and click probability is a binary classification head. Predicting several outcomes at once lets it learn richer representations of different aspects of behavior.

The training examples are generated by users, but also by the current system. The case's loss includes a correction for position bias in historical data.

04 · INFERENCE AND EVALUATION

Serve fast and measure carefully

You can precompute and store in cache the embeddings of all videos. User embeddings and candidate generation results are also cached.

The final outputs can be evaluated with ranking metrics such as NDCG, MAP, and precision and recall. Since each stage is a new source of error for the following ones, the recall of the candidate generators should also be evaluated.

The gold standard of online evaluation is the A/B test. In the YouTube paper, the authors determine final effectiveness through live experiments, because live A/B results do not always correlate with offline experiments. Experiments also suffer from novelty effect: the new system may yield better results than it otherwise would.

05 · DEEP DIVES

Cold start, feedback loops, and exploration

New users and videos lack the behavioral data that feeds the heavy ranker. For new users, demographic information and onboarding preferences are used to group them with similar users. For new videos, features are extracted from the content itself and controlled exploration is used.

  1. A new video does not yet have user behavior; features are extracted from the content itself, with multimodal models that analyze thumbnails, titles, descriptions, transcripts, and the video.

    Architecture diagram: Cold start of a new video
    CLCreator uploads the video
    CPContent feature extractioncontent features
    DBVector databasenew video
    CPRecommendation service
    CPExploration service
    CLEspectadores
    QImpression and feedback log
  2. The exploration service exposes the new video to a diverse but limited audience, to obtain initial signals without risking the broad base.

    Architecture diagram: Cold start of a new video
    CLCreator uploads the video
    CPContent feature extraction
    DBVector database
    CPRecommendation service
    CPExploration servicelimited audience
    CLEspectadores
    QImpression and feedback log
  3. What was shown and how viewers reacted is logged, and techniques such as counterfactual logging help reduce bias in the training data.

    Architecture diagram: Cold start of a new video
    CLCreator uploads the video
    CPContent feature extraction
    DBVector database
    CPRecommendation service
    CPExploration service
    CLEspectadores
    QImpression and feedback logimpressions and reactions
  4. Once there is some behavioral signal, the video moves to a more personalized approach.

    Architecture diagram: Cold start of a new video
    CLCreator uploads the video
    CPContent feature extraction
    DBVector database
    CPRecommendation servicepersonaliza
    CPExploration service
    CLEspectadores
    QImpression and feedback log

Recommenders create feedback loops that affect the user experience. As mitigation, the case proposes counterfactual logging, inverse propensity reweighting, losses that penalize overexposure, and diversity constraints on the list.

There is also the balance between showing what the user already likes (exploitation) and including wildcards that may reveal new interests (exploration). This problem is handled with techniques such as Thompson sampling or contextual bandits.

Frequently asked questions

What is Video recommendation?

Classic interview design. Key points: candidate generation + ranking, two-tower, implicit feedback, cold start, and A/B.

What does the Video recommendation design cover?

It is organized in these sections: What recommending the next video means, From the entire catalog to a few videos, What the model learns and from what, Serve fast and measure carefully, and Cold start, feedback loops, and exploration.

How long is Video recommendation and what level is it?

It takes about 16 minutes to read and is rated Senior level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.