MLCrack

    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 (O(U2)O(U²)). 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.