KatInterview

Recommender for a Fast-Changing Catalog with Few Interactions

Machine LearningModel answer
HardModel answerMachine Learningrecommender-systemscold-starttwo-tower

Last updated

Design a two-stage recommender for a content app where users and items are constantly new, covering models, exploration, off-policy evaluation, A/B testing and a strict latency budget.

You are launching the home feed for a content app. Interaction data is thin, many users are new, and a large batch of new items arrives every day. Most of an item's engagement happens shortly after it is published.

Design a recommendation system that keeps working for both brand-new users and brand-new items. Your answer should cover:

  1. Architecture. A two-stage pipeline (candidate generation followed by ranking). State your assumptions about scale, such as users, catalog size, requests per second and page size.
  2. Retrieval model. Choose a concrete approach (for example matrix factorization or a two-tower network). Give the loss, the negative sampling scheme, and explain how it produces useful representations for items and users with no history.
  3. Ranking model. Choose a model for the launch period and one for when data is plentiful. Give the loss, and list the main user, item, user-item and context features.
  4. Exploration. Explain how you give new items exposure without hurting the experience (for example Thompson sampling, or epsilon-greedy with limits on propensities).
  5. Evaluation. Define offline metrics and online KPIs. Write down the off-policy estimator you would compute (IPS, SNIPS or doubly robust) and explain why it is needed.
  6. Experimentation. Describe an A/B test that handles selection bias, and the guardrails that protect long-term outcomes.
  7. Serving. Show how you would meet a p50 below 50 ms and a p99 below 200 ms end to end, including feature store access, caching and approximate nearest neighbor search.

Hints

Hint 1

Make the item and user representations work without IDs: feed content embeddings and context into the towers, and randomly drop the ID embedding during training so a new entity still gets a sensible vector.

Hint 2

Log everything needed for off-policy evaluation at serving time (propensity, position, whether the slot was exploratory, policy version). Without logged propensities you cannot use IPS or doubly robust estimators later.

Hint 3

Treat latency as a budget: split the 200 ms p99 across candidate retrieval, feature fetch, ranking and re-ranking, run retrieval sources in parallel, and cut the candidate set aggressively before the expensive model.