KatInterview

Build a Personalized Swipe-Feed Ranking Pipeline for Clips

Machine LearningModel answer
MediumModel answerMachine Learningrecommendation-systemsml-system-designretrieval-and-ranking

Last updated

Design an end-to-end ML recommender for a vertical clip feed with multi-stage retrieval and ranking, real-time learning, diversity and safety controls, and cold-start handling.

Problem

You are asked to design the recommendation backend for a mobile app where users swipe through an endless vertical feed of short clips. The feed should feel tailored to each person and keep adapting while they scroll.

What the product needs

  1. Tailored feed: Each user gets a continuous stream of clips chosen from their past behavior (likes, skips, watch time and similar signals).
  2. Fast responses: The service must absorb a very high request rate while keeping the delay before the first frame low. The server-side budget for retrieval plus ranking is roughly 100 ms.
  3. Fresh content: A newly uploaded clip should be able to reach viewers soon after ingestion.

Operating constraints

  1. Scale: More than 100M daily active users and more than 1M new uploads per day.
  2. Variety: The feed must not trap users in a narrow bubble, so it should deliberately mix in different kinds of content.
  3. Safety: Policy checks (copyright, prohibited content, takedowns) must be enforced reliably.

What your answer should cover

  1. Architecture: A high-level picture of the path from a feed request to the response.
  2. Candidate retrieval: How you shrink a huge corpus to a manageable candidate set (for example collaborative filtering and embedding-based retrieval).
  3. Ranking: How a multi-stage model cascade works, from cheap early filtering to a heavy final model and re-ranking.
  4. Feedback loop: How live interactions (plays, watch time, likes) flow back to improve features and retrieval.
  5. Cold start: How you serve brand-new users and brand-new clips that have no history.

State your assumptions, do rough capacity math, and discuss the key trade-offs.

Hints

Hint 1

Begin with back-of-envelope numbers: requests per second at peak, corpus size, embedding memory footprint, and a per-stage latency budget that sums to under 100 ms.

Hint 2

Think in a funnel: several parallel retrieval channels return thousands of candidates, a cheap pre-ranker trims to a few hundred, a multi-task heavy ranker scores them, and a re-ranker applies diversity, safety, and business rules.

Hint 3

Separate request-time work (reads precomputed features only) from nearline stream processing (seconds) and offline training (hours to daily), and explain how each feeds back into the system.

Hint 4

For cold start, use content-derived embeddings plus a small guaranteed exposure budget for new clips, and context priors plus fast in-session adaptation for new users.