Recommendation System

Source: 30-System-Design/Framework & Systems

Prompt

  • Design a recommendation system for a large-scale video platform (e.g., home feed).

Requirements

  • Functional: personalized recommendations, diversity/freshness, cold start handling.
  • Non-functional: low latency, high throughput, explainability, privacy.
  • Constraints: strict latency budget, heavy-tailed catalogs, fast content churn.

Success Metrics

  • Offline: NDCG, MAP, Recall@K.
  • Online: CTR, watch time, retention, satisfaction.
  • Guardrails: skips, hides, complaints, diversity metrics.

Data

  • Sources: user events, item metadata, embeddings, context signals.
  • Labeling: implicit feedback (clicks, watch time), explicit feedback (likes).
  • Negative signals: skips, short dwell, “not interested”.

Modeling

  • Candidate generation: two-tower / ANN retrieval.
  • Ranking: gradient boosting or deep ranker with context features.
  • Re-ranking: diversity/novelty constraints.
  • Cold start: content-based features, popularity priors, exploration.

Serving

  • Retrieval: ANN index, caching by segment.
  • Latency budget: retrieval + ranking + re-ranking.
  • Personalization: real-time features, session intent.
  • Fallbacks: popular/trending when features are missing.

Evaluation & Monitoring

  • Offline eval: train/val splits, leakage checks.
  • Online eval: A/B tests with guardrail metrics.
  • Drift/abuse: data drift, feedback loops.
  • Long-term health: measure satisfaction beyond short-term CTR.

Risks & Tradeoffs

  • Exploration vs exploitation.
  • Popularity bias and filter bubbles.
  • Novelty vs relevance in short sessions.

Notes

Comments

Share your approach or ask questions

0 comments
?
|
Markdown supported
Sign in to post

Loading comments...