ML System Design Mock Interview: YouTube Feed Recommendations

Added:

Problem Setup
Architecture
Label Design
Feature Eng
Model Design
Evaluation
Deployment

Problem Setup

0:00
Playing Section
  • 1

    Design a YouTube recommendation feed returning hundreds of ranked videos.

  • 2

    Must balance scale, latency, and accuracy using a multi-stage approach.

  • 3

    Define engagement labels and assume offline ingestion for new content.

Basic Machine Learning Foundations: Familiarity with supervised learning, feature engineering, and standard evaluation metrics like ROC-AUC, precision, and recall.
Recommender System Fundamentals: Understanding the core concepts of collaborative filtering, content-based filtering, and matrix factorization.
System Design Basics: Knowledge of basic distributed systems concepts, including databases, caching, APIs, and the trade-offs between latency and throughput.
Two-Stage Recommendation Architecture: Conceptual understanding of dividing the recommendation process into candidate generation (retrieval) and ranking phases.
Deep Learning for Recommender Systems: Exploring advanced neural network architectures such as Two-Tower models, Deep & Cross Networks (DCN), and Transformer-based sequence models.
Real-Time Data Pipelines: Learning how to implement streaming data technologies like Apache Kafka and Flink for real-time feature extraction and low-latency feature stores.
Multi-Task and Multi-Objective Learning: Studying how to train models to optimize for multiple conflicting targets simultaneously, such as click-through rate, watch time, and user engagement.
MLOps and Scale Deployment: Deep diving into online evaluation, A/B testing design, model drift detection, and scaling model inference pipelines for billions of daily active users.
46.3K views1.8Klikes33:12@MLEpathOriginal Release: 2024-12-07

For large-scale recommendation systems like YouTube's feed, a multi-stage architecture is essential to balance accuracy, latency, and scale constraints. The system employs two main stages: a candidate generation stage that prioritizes scale and latency by filtering billions of items down to thousands using approximate nearest neighbors and embeddings, followed by a ranker stage that prioritizes accuracy on the smaller candidate pool. Labels are derived from user interactions (likes, watch time, end-screen clicks) with careful handling of class imbalance through temporal splits and negative sampling. Real-time updates use lightweight models to adapt to immediate user intent while maintaining long-term embedding stability through periodic retraining. Deployment follows AB testing with continuous monitoring and retraining every few hours to maintain model freshness.