KatInterview

Design a Content Feed Ranking Pipeline & Objective Formulations

Machine LearningModel answer
MediumModel answerMachine Learningmachine learning system designlearning to rankmulti-task learning

Last updated

Design a large-scale personalized social network feed architecture and compare pointwise, pairwise, and listwise ranking strategies across training, serving, and business metrics.

Problem Overview

Design the end-to-end Machine Learning pipeline powering a personalized updates feed for a professional social platform. The feed serves a dynamic mix of connection posts, followed organization updates, industry recommendations, shared articles, and sponsored content.

Your design should explain the end-to-end candidate lifecycle (retrieval through final presentation) and provide a technical comparison of Learning-to-Rank (LTR) objectives.


Technical Expectations & Metrics

  • Traffic Scale: 200 million Daily Active Users (DAU), averaging 30,000 QPS with peak loads hitting 70,000 QPS.
  • Latency Target: End-to-end execution must complete within 150 ms (p99).
  • Feedback Signals: Implicit (impressions, dwell duration, clicks) and explicit (likes, comments, reposts, bookmarks).

Key Requirements

  1. System Architecture & Data Flows

    • Outline the full multi-stage funnel: Candidate Generation, Coarse Ranking, Fine Ranking, and Re-ranking / Final Slate Assembly.
    • Describe the data pipelines for real-time feature streaming and offline batch computation, addressing how training-serving skew and label latency are managed.
  2. Feature Taxonomy

    • Categorize key features across User Profile, Content/Author Metadata, Graph/Social Dynamics, and Session/Contextual Signals.
  3. Learning-to-Rank (LTR) Objective Formulations

    • Pointwise: Multi-task classification/regression setups predicting single-action probabilities and continuous targets (e.g., dwell time). Detail probability calibration techniques.
    • Pairwise: Pair formulation dynamics (e.g., RankNet, LambdaMART), pairwise sample generation, and loss scaling.
    • Listwise: Direct optimizing for list-level metrics like NDCG (e.g., ListNet, LambdaLoss).
    • Trade-off Analysis: Compare the three methodologies regarding training complexity, online latency, position bias mitigation, and flexibility with multi-objective business goals.
  4. Serving Infrastructure & Latency Optimization

    • Provide concrete latency budgets for each execution stage and explain techniques to keep high-QPS scoring under the 150 ms constraint.

Hints

Hint 1

Break down the 150 ms budget into exact millisecond allocations per funnel stage to ensure feasibility.

Hint 2

Consider how score calibration affects the ability to combine multi-task predictions into a unified business value score.

Hint 3

Contrast how position bias is handled implicitly in pairwise/listwise losses vs. explicitly via auxiliary features in pointwise setups.