RECOMMENDATION SYSTEMS · INTERVIEW QUESTION
Explain the difference between user-based and item-based collaborative filtering.
🟡 intermediate · Collaborative Filtering
Hint: Think about which similarity is computed and scalability implications.
Answer
User-based CF: finds similar users to the target user, recommends items those similar users liked. Similarity computed on user rating vectors (cosine, Pearson).
Interview reasoning
Pro: captures diverse interests.
Con: user profiles change quickly, scales poorly with users (). Item-based CF: finds items similar to what user liked, based on co-rating patterns. Similarity computed on item rating vectors.
Pro: item similarities are more stable, pre-computable, scales better.
Con: less serendipity. Amazon popularized item-based CF.
In practice: item-based often preferred for large user bases.
Both suffer from cold start (new users/items have no history).
Modern alternative: matrix factorization and deep learning embeddings unify both views.
Recommendation predicts useful choices from behavior, content and context, typically through retrieval, ranking and a constrained slate. Neighborhood collaborative filtering compares users or items rather than learning arbitrary latent factors. Choose similarity and feedback handling carefully, because missing interactions often mean absent exposure rather than dislike.
Worked example. User-based neighbors recommend items liked by similar users; item-based neighbors retrieve products similar in interaction patterns to the user's history.
Validation
Compare temporal recall/ranking with popularity baselines, new-entity cohorts, latency and randomized user outcomes; audit exposure and inventory constraints.
Common pitfalls
Similarity can be dominated by popularity or sparse overlap. Recommending what users already would choose is not necessarily incremental value.
Related questions
- Explain matrix factorization for collaborative filtering. How does it handle the cold start problem?
- What is a recommendation system and how does it work?
- How do you evaluate a recommendation system in production? What are the key offline and online metrics?
- Explain two-tower models for recommendation. How are they used in production?
- What is the cold start problem in recommendation systems? How do you solve it?