Decisions and ranking

Recommenders

Like a librarian learning your tastes from past choices, a recommender estimates which items you may want next. It can learn from item features, patterns across users, or both. Large systems usually retrieve a small candidate set before ranking it more carefully.

Catalog1000 itemsRetrieve20 candidatesRankscore 20 candidatesRerankselect 3 to show
Retrieve 20 of 1000 items, score them, then select 3 with relevance and constraints in mind.
Catalog1000 itemsRetrieve20 candidatesRankscore 20 candidatesRerankselect 3 to show
Retrieve 20 of 1000 items, score them, then select 3 with relevance and constraints in mind.

How it works

  1. Define the user outcome and construct training examples from timestamped interactions and available features.
  2. Retrieve candidates with methods such as matrix factorization, two-tower embeddings, or content similarity.
  3. Rank candidates using user, item, and context features to predict the chosen objective.
  4. Rerank for constraints such as diversity, availability, and repeated exposure.
  5. Evaluate on time-based holdouts and then measure user outcomes in a controlled online experiment.

$$\hat r_{ui}=p_u^\top q_i$$

The knobs that matter

embedding dimension
controls capacity and retrieval storage
negative sampling
changes which unobserved items the model learns to distinguish
candidate count
trades retrieval coverage against ranking cost
reranking weights
balance relevance with diversity and other product objectives

What interviewers ask

  • When would you use collaborative filtering instead of content-based recommendations?
  • How would you train and serve a two-tower retrieval model?
  • How do you recommend items for a new user or a newly added item?
  • How would you evaluate a recommender without leaking future interactions?

Common mistakes

  • Treating every missing interaction as a confirmed dislike.
  • Using future interactions or future item features when building training examples.
  • Optimizing click prediction alone without checking satisfaction and exposure effects.

When to use it

Use recommenders when users face many items and past interactions or item features provide useful signals. Start with simple content or popularity rules when there is little data to support personalized learning.

Implement it (1 problems)

Learn it

Interview questions about recommenders