KatInterview

Low-Latency Personalized Feed Ranking Service Design

System DesignModel answer
HardModel answerSystem Designml-system-designrecommendationfeature-store

Last updated

Design an end-to-end personalized feed service for millions of users: data pipelines, feature consistency, retrieval and ranking, cold start, latency budgets, experiments, and failure handling.

You are designing the personalized feed for a large consumer mobile app. Each time a user opens the feed, the backend must return a ranked list of items tailored to that person, and the feed must react quickly to what the user just did.

Requirements

  • Service-layer P95 latency under roughly 100 ms, from request arrival to response.
  • Millions of daily active users.
  • A catalog of tens of thousands of active items, with items being added and retired continuously.
  • New interactions (views, clicks, purchases, and similar) should influence what is shown within seconds to minutes.

Walk through your design, covering these areas

  1. Architecture and data flow. Trace data from event generation, through training, to online serving. Separate the offline, nearline, and online layers.
  2. Features and feature store. Which user, item, context, and cross features would you use? How would you build a feature store so that training and serving see consistent values?
  3. Modeling. Propose a simple baseline, then a stronger deep-learning approach. Explain why you would split the system into retrieval (candidate generation) and ranking stages, or another decomposition.
  4. Cold start. Cover brand-new users and brand-new items, with several strategies for each (content signals, popularity, exploration, and so on).
  5. Latency versus accuracy. How do you shape the serving path under a hard latency budget (precomputation, caching, approximate search)? Where do caches go, and what TTL or consistency policy would you pick?
  6. Measurement. Which offline and online metrics matter? How would you run experiments? What would you monitor in production (drift, skew, latency, errors), and how would you react?
  7. Scale and reliability. What storage, streaming, and queueing choices would you make? How does the system degrade gracefully when the ranking service is slow or down?

State your assumptions explicitly (traffic, catalog size, event volume) and justify choices with rough numbers where possible.

Hints

Hint 1

Start with back-of-envelope sizing: requests per second at peak, events per second, and the memory footprint of item embeddings. These numbers tell you whether you need approximate nearest-neighbor search or whether exact scoring over the catalog is affordable.

Hint 2

Write down a per-stage latency budget (gateway, feature fetch, retrieval, ranking, re-ranking, tail headroom) and make each design decision justify itself against that budget. Fetch independent features in parallel.

Hint 3

Training/serving skew is the classic failure: define each feature once, materialize it into an online and an offline store, use point-in-time joins, and ideally log the exact feature vector served with each request ID and train on that.

Hint 4

For cold start, separate the two problems. New items can be placed using content embeddings, priors from category/creator, and a reserved exploration slot. New users need contextual popularity, onboarding signals, and fast in-session adaptation from the streaming path.