Design a Personalized Feed and Compare Ranking Objectives
LinkedInMachine Learning Engineer · Technical ScreenLast updated
Design an end-to-end personalized professional feed system and compare pointwise, pairwise, and listwise learning-to-rank formulations across offline training, online serving, and business metrics.
Scenario
You are tasked with designing the machine learning system powering the home feed for a professional social network. The feed delivers a personalized stream of content, including posts from direct professional connections, followed companies, industry influencers, recommended articles, and sponsored updates.
Your design must cover the end-to-end workflow from candidate retrieval to final presentation, with a deep dive into learning-to-rank (LTR) objective formulation.
Requirements & Scale
- User Base: 200 million daily active users (DAU).
- Throughput: Average 30,000 requests per second (QPS), peaking at 70,000 QPS.
- Latency Budget: Total end-to-end response time must be under 150 ms (p99).
- Engagement Signals: Implicit feedback (dwell time, clicks, impressions) and explicit feedback (reactions, comments, shares, saves).
Design Expectations
-
End-to-End Architecture
- Detail the stages from candidate generation (retrieval) to coarse ranking, fine ranking, and re-ranking (diversity, freshness, business logic).
- Describe the data pipelines required for real-time feature extraction vs. batch offline feature computation.
-
Feature Engineering
- Outline key feature groups: user-level features (e.g., industry, seniority), author/content features (e.g., text embeddings, topic tags), graph-based features (e.g., degrees of connection, interaction history), and real-time contextual features.
-
Ranking Objectives: Pointwise vs. Pairwise vs. Listwise
- Pointwise: Formulate binary classification or regression targets (e.g., predicting
P(click),P(comment), expected dwell time). Discuss calibration and multi-task learning. - Pairwise: Explain formulations like RankNet or LambdaMART using item pairs
(post_i > post_j)for a given user session. - Listwise: Formulate loss over the full list (e.g., ListNet, LambdaLoss) directly optimizing metrics like NDCG.
- Comparison: Systematically compare the three approaches across training complexity, inference efficiency, ability to handle position bias, and alignment with multi-objective business goals.
- Pointwise: Formulate binary classification or regression targets (e.g., predicting
-
Online Serving & Latency Mitigation
- Explain how model inference fits within the 150 ms budget (e.g., two-pass scoring, vector search ANN, feature caching, model distillation).
Hints
Hint 1
Structure the candidate pipeline into at least three distinct stages (retrieval, scoring, re-ranking) to prune millions of posts down to the top 20 within the latency budget.
Hint 2
When comparing LTR paradigms, consider both mathematical objective alignment with metrics like NDCG and practical constraints such as training data generation and serving cost.
Hint 3
A production feed typically optimizes for multiple actions simultaneously; consider how a multi-task pointwise model compares in operational simplicity to pairwise or listwise alternatives.
Follow-up questions
- How do you identify and mitigate position bias and presentation bias in your training logs?
- How would you integrate sponsored content into the organic feed while preserving user experience and maximizing revenue?
- If your objective shifts from maximizing short-term engagement to fostering long-term content creator retention, what architectural and objective changes would you make?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.