Design a swipeable video feed backend
SnapchatSoftware Engineer · OnsiteLast updated
This question evaluates system-design competence for building scalable, low-latency backend services that handle feed vending, pagination, personalized ranking, caching, storage, and content eligibility; it is categorized under System Design and tests practical application of distributed systems and backend data engineering principles.
Design the backend service for a short-video product similar to a “Spotlight”-style feed.
Scope: only the backend “feed vending” functionality that powers the client’s swipe up/down experience.
Functional requirements:
- Client requests a feed and receives an ordered list of video IDs (and minimal metadata) to display.
- Supports endless scrolling/swiping (pagination) with low latency.
- Personalized ranking (can be simplified), plus fallback to non-personalized if needed.
- Avoid showing the same video too often; support “next/previous” navigation.
Non-functional requirements:
- Very high read QPS, low p95 latency.
- Ability to update rankings frequently.
- Basic abuse/spam controls and content eligibility (e.g., blocked creators, geo/age restrictions).
Provide components, APIs, storage, caching, and how you generate and serve ranked results.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.