Design a "People You May Know" (PYMK) recommendation system

    A "People You May Know" (PYMK) system recommends connections from a social graph, primarily via friend-of-friend signals refined by ranking. Because graph traversal is expensive, recommendations are mostly precomputed offline.

    AI & Machine Learning, 6 components, about 35 min

    The full guide covers requirements, estimates, the API, the data model, deep dives, trade-offs, failure modes and the follow-up questions interviewers ask.

    Read the full guide on Substack

    Key points

    • Graph Store: Neo4j or JanusGraph to store user relationships (edges).
    • Candidate Gen: "Friend of Friend" (FoF) walk to find potential connections.
    • Ranking: GNN (Graph Neural Network) or XGBoost using mutual friends and profile similarity.
    • Cold Start: Use location and school/work data for users with no connections.
    • Scalability: Pre-compute recommendations offline (Spark) and store in a KV store.

    Sign in to track this guide in your curriculum progress.