Design a Recommendation System (YouTube Home)

Personalised home feed inspired by YouTube and Netflix: engagement events on a stream into a data lake, daily training that precomputes candidates, two-stage retrieve-then-rank with nearest-neighbour search and a ranking model, an online feature store updated in seconds, filters, variety and cold-start feeds, impression logging, and experiment groups. A teaching design.

Functional requirements

  • Each viewer sees a personalised home feed.
  • Watches, likes and skips are recorded.
  • The feed reacts to what the viewer watched minutes ago.
  • Videos already watched or blocked are not shown again.
  • New and signed-out viewers still get a useful feed.
  • New models are tested on a small share of viewers before rollout.

Non-functional requirements

  • Home feed latency: p99 < 200ms.
  • Scale: 100M daily viewers, 8K requests/s at peak, 60% of them engagement events.
  • New engagement affects features within seconds.
  • Availability: 99.95%; the feed must render even when ranking is degraded.
  • Models retrained at least daily.

How the design evolves

Stage 1: The Same Most-Popular List for Everyone

See why one popularity list wastes most of the home page.

What was missing: Nothing yet.

Why that's risky: A cooking fan and a gamer see the same 30 videos, so most of the page is wasted. Every watch is a database write, and sorting the videos table runs on every home page view.

What gets added: One server that shows everyone the week's most-watched videos and records each watch in the database.

Trade-offs: No models and no pipelines, but no personalisation either.

Stage 2: Log Every Event, Precompute Candidates Overnight

Collect training data cheaply, and personalise the feed from a daily batch.

What was missing: No per-user data to learn from, and one list for everyone.

Why that's risky: Recommendations are a day old: a video uploaded this morning can't appear, and what the user watched five minutes ago is ignored.

What gets added: An event service that puts every watch, like and skip onto a stream, an archiver that writes them to a data lake, and a daily training pipeline that learns from them and writes each user's candidate videos to a key-value store the home page reads.

Trade-offs: Batch work is cheap and simple, but personalisation lags by a day.

Stage 3: Retrieve Then Rank, with a Feature Store

Score a manageable set of candidates with a strong model, using what the user did seconds ago.

What was missing: Candidates were a day old and nothing scored them against what the user was doing now.

Why that's risky: The feed repeats videos already watched, can fill up with one topic, and new viewers with no history get nothing useful.

What gets added: Two stages. Retrieval cheaply gathers about 500 candidates from the precomputed list and a nearest-neighbour search over video embeddings. Ranking scores each by predicted watch time with a heavier model, using online features (recent watches, freshness, popularity) that feature workers update from the event stream within seconds.

Trade-offs: Ranking only 500 videos means a great video that retrieval misses is never shown. The cheap first stage is what makes a strong second stage affordable.

Stage 4: Filters, Variety, Cold Start and Logging What Was Shown

Make the feed feel fresh and varied, work for new viewers, and train on what users actually saw.

What was missing: Watched videos reappeared, one topic could take over, new viewers got nothing, and training data didn't record what had been shown.

Why that's risky: No way to test a new model safely, nothing stops fake engagement, and one load balancer.

What gets added: The feed drops videos already watched or blocked and mixes topics for variety. New and signed-out viewers get a ready-made regional feed. Every feed shown is logged as impressions, so the model learns from what was skipped as well as what was clicked.

Trade-offs: Variety lowers the predicted score of some slots, but keeps sessions going longer.

Stage 5: Experiments, Limits, Redundancy and Monitoring

Ship model changes safely, keep fake engagement out, and survive prime time.

What was missing: No safe way to try a new model, nothing filtering fake engagement, and one load balancer.

Why that's risky: Remaining risk is feedback loops: a model that only learns from what it showed can narrow what people see. A small share of exploratory recommendations counters that.

What gets added: Experiment groups so each model change runs on a small share of viewers first, a rate limiter against scrapers and fake engagement, a second load balancer, replicas for every serving component, and monitoring of watch time, click-through per experiment, feature freshness and model age.

Trade-offs: Experiments need enough viewers and days to be trustworthy, which slows how fast models ship.

PRISM
System Design Interview
Round 1 of 4 · Architecture Design · 60:00 remaining
PRISM logo
AI Interview
Interview Prep
Interview Challenges
Build & Stress Test NEW
System Architectures
Design & Fix NEW
Interactive Roadmap System Design Guides
Notifications
  • No new notifications
Feedback
Signed in
Send feedback
Phase
Build & Stress Test
Phase 01: Thinking in Systems
Upcoming

Components

User
CDN
Load Balancer
Server
Cache
Database
Blob Storage
Search Index
Queue
Worker
Rate Limiter
Service
API Gateway
Reverse Proxy
WebSocket Server
Third-party API

Inspector

Notes
Use clear names so your design intent is easy to understand.
Good
Name by business meaning
"Order API", "Restaurant Service"
Avoid
Generic names = zero signal
"Server 1", "API", "Queue"
A short description for each component makes feedback much better.
100%
Start by identifying:
  • Users & entry points
  • APIs & services
  • Databases & storage
  • Traffic flow & scale

Round 1 of 4 Architecture Design

Run a simulation to see results.

Time Remaining
60:00
System Design Interview

What are the core functional requirements?
What are the key non-functional constraints?

Questions

Start Evaluation to unlock questions.

EVALUATE MODE

Test yourself like it's the real thing.

A structured 4-module evaluation that mirrors how top companies assess system design candidates.

Architecture Design
Draw your system on the canvas. Define components, connections, and data flow.
FR & NFR Requirements
Answer functional and non-functional requirement questions about your design.
MCQ Round
Multiple choice questions testing your depth on the chosen system.
Tradeoff Analysis
Justify your design decisions and defend your architectural tradeoffs.
AI Report Generated
Choose a Problem
No problem selected
  • 30 min
  • 45 min
  • 60 min
Round 2 of 4
MCQ Round
Answer multiple-choice questions based on your design.

Exit Interview?

You're in the middle of an interview session. Leaving now will end your current attempt.

Your progress will be saved.

Open a saved design

Select a design to load into the canvas.

My Evaluations

Your past evaluation sessions

Here’s a simple request flow that follows the expected layer order.

External User
→
Edge CDN → API Gateway → Load Balancer
→
Compute App Servers / Services
→
DataAccess Cache
→
Storage Database / Search Index
→
Async Queue → Worker

Tip: keep arrows moving forward through layers (Edge → Compute → Storage). Avoid sending storage back to compute.

Evaluation Instructions

Read the rules carefully before starting. The test auto-submits on refresh.

Before you start

  • Build your architecture on the canvas. The timer starts when you click Start Evaluation.
  • Don't forget to answer Functional Requirement and Non Functional Requirements.
  • When satisfied with your design, click Next to lock it and view the questions.
  • Please answer final step questions to complete the evaluation.

Dos

  • Do read each question carefully before answering.
  • Do include required components to maximize component coverage.
  • Do save a copy of your design if you want to keep it before submission.

Don'ts

  • Don't refresh or close the tab during an active evaluation — this will auto-submit your answers.
  • Don't switch app modes or open another tab while the evaluation is running.
  • Don't attempt to edit the design after clicking Next; the workspace will be locked.

All the best!!

Confirm

Input

Notice

Evaluation Report

Evaluation Complete

Generating Your Report

Hang tight — our AI is evaluating your design…

Did you know?

Loading…

Share feedback

Tell us what worked well and what we can improve.

Let's personalize this

Answer a couple of quick questions so we can tailor your journey and missions.

Your welcome gift: of Full PRISM Access

You can change these answers from Mission Control until your missions are done.

Your personalized missions are ready

We tailored these first steps based on your answers.

    PRISM Welcome Gift

    This is a personal welcome gift from PRISM.

    Congratulations.

    You explored PRISM.

    You earned Apprentice.

    As a welcome gift, unlock Full PRISM Access for the configured trial duration.

    This starts Trial. Trial timer begins only after you activate this gift.

    Welcome to PRISM

    We've prepared a personalized Apprentice Journey based on your goals and experience.

    This journey introduces you to the capabilities of PRISM that are most relevant to you.

    Complete all 5 missions to earn your Apprentice title. 5 MISSIONS

    PRISM Surprise Offer

    Complete your Apprentice Journey to unlock a special gift from PRISM.

    • No payment required
    • No credit card required
    • Just complete the journey
    MISSION CONTROL
    0 / 8 missions complete
    NEXT UP Continue your missions
    View full roadmap →
    Mission Complete 0 / 8 Completed Next: Keep going
    SYSTEM BRIEF

    System Constraints

    What the system must do — every item is a user-facing behaviour your architecture must support.

      ↑ Engineering Constraints

      These are the failure modes you must design against — latency SLAs, durability targets, traffic ceilings.

        ⇆ Architecture Constraints

        Core Concepts to Master

        Your Journey
        PHASE – –
        0 / 0 0%
        0
        Mock Interview Checklist

        Pick a topic to start

        Explore concept overviews, real-system examples, key tradeoffs, and interview talking points for each roadmap section.

        Phase Mastered

        You've conquered this phase. These are the skills you now own:

          +500 XP

          Company Interview Paths

          Progress Summary