RECOMMENDATION SYSTEMS · INTERVIEW QUESTION
Explain matrix factorization for collaborative filtering. How does it handle the cold start problem?
🟡 intermediate · Collaborative Filtering
Hint: Think about user and item latent factors, and what happens when there's no interaction data.
Answer
Matrix factorization decomposes the user-item interaction matrix R ≈ UVᵀ where U (users × k) and V (items × k) are latent factor matrices. Training minimizes ||R - UVᵀ||² + λ(||U||² + ||V||²) on observed entries. Predictions: r̂_ui = u_i · v_j. Cold start problem: new users/items have no interactions to learn factors from.
Interview reasoning
Solutions:
- Content-based features as side information (hybrid models)
- Metadata-initialized embeddings
- Explore-exploit strategies
- Popular item fallback
- Ask for preferences on signup.
Modern approaches: Two-tower models (user/item encoders), transformers for sequential recommendation.
Matrix factorization predicts an interaction using a user-vector/item-vector inner product, often with biases and regularization. Shared latent directions let behavior from related users inform an item score. Pure learned-ID factors cannot identify a new entity's preferences before evidence arrives; content priors or fallback policy are required.
Worked example. A user vector [1,0] scores an item [0.8,0.2] as 0.8 before optional biases.
Validation
Evaluate temporal ranking and held-out new entities, tuning rank and regularization only on validation; compare popularity baselines.
Common pitfalls
Unobserved interactions are not uniformly true negatives. A low reconstruction error on known ratings does not establish full-catalog retrieval quality.
Related questions
- What is a recommendation system and how does it work?
- Explain the difference between user-based and item-based collaborative filtering.
- 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?