Katkat

Design a Short-Video Recommendation System

ByteDanceSoftware Engineer · Onsite

Last updated

This problem tests the ability to design a multi-stage recommendation pipeline that balances real-time personalization, system latency, and content diversity.

Problem: Designing a Short-Video Recommendation Engine

Design the architecture for a short-video feed platform similar to TikTok. The system must provide personalized content to millions of concurrent users with sub-100ms latency for candidate retrieval and ranking.

Functional Requirements

  1. Personalized Feed: Users receive a continuous stream of videos based on historical interactions (likes, skips, watch time).
  2. Low Latency: The system must handle high request volumes while maintaining a fast time-to-first-frame.
  3. Freshness: New content must be surfaced to users quickly after ingestion.

Non-Functional Requirements

  1. Scale: Support 100M+ DAU and 1M+ uploads per day.
  2. Diversity: Prevent filter bubbles by injecting varied content types.
  3. Safety: Ensure policy filters (e.g., copyright, prohibited content) are applied effectively.

Expectations

Your design should cover:

  1. Architecture Overview: A high-level diagram illustrating the path from request to response.
  2. Candidate Retrieval: How to efficiently narrow down millions of videos to hundreds of relevant candidates (e.g., collaborative filtering, embedding-based retrieval).
  3. Ranking Pipeline: The usage of multi-stage models (e.g., lighter models for initial filtering vs. heavy deep learning models for final reranking).
  4. Feedback Loop: How real-time interactions (clicks, watch-time) are ingested and incorporated back into the retrieval layer.
  5. Cold Start: How to handle new users and new videos without historical data.

Hints

Hint 1

Consider a funnel approach: use fast retrieval methods like Vector Search for candidate generation before applying complex ranking models.

Hint 2

Address the cold start problem by using content-based features (e.g., visual/audio embeddings, metadata tags) rather than relying solely on interaction logs.

Hint 3

Think about how to separate the 'Nearline' processing of user engagement signals from the 'Offline' training of recommendation models to keep the latency low.

Follow-up questions

  • How would you measure the success of your recommendation system? What metrics would you track in an A/B test?
  • If the latency spikes due to a viral video, how would you implement an effective caching strategy for the retrieval layer?
  • How do you ensure the system doesn't over-promote 'clickbait' content while still maximizing user session duration?