Feed Ranking System Design to Increase User Time Spent
Company: LinkedIn
Role: Machine Learning Engineer
Category: ML System Design
Difficulty: medium
Interview Round: Onsite
Design how you would use a feed ranking system to increase the time users spend in the feed. The report gives only this goal, so settle the scope with the interviewer first. In its usual form, the feed mixes content from accounts a user follows with recommended content, a multi-stage system retrieves and ranks candidates for every feed request, and you are asked what to optimize, how to model it, and how to show that it works.
```hint Dwell time is a biased label
Raw time on an item depends on its length and format, its position in the feed and whether it was even on screen. Decide how to turn it into a target that compares items fairly.
```
```hint More time is not always better
Think about which kinds of content could raise time spent while users come to like the product less, and what you would measure to catch that.
```
### Constraints and Clarifications
- Not given: the content types, the current ranking objective, the scale and latency budget, and whether "time spent" means per session, per day or over the long term. Ask, or state your assumptions.
### Clarifying Questions
- Is the target time spent per session, total daily time in the feed, or longer-term engagement such as return visits?
- What does the feed rank (text posts, articles that open on click, images, videos, ads), and what does the current ranker optimize?
- What dwell data is logged: time an item is visible on screen, time on an opened article, video watch time?
- Which guardrails must not regress: content quality, hides and reports, creator distribution, ads revenue?
- How many candidates are ranked per request, and what is the serving latency budget?
### What a Strong Answer Covers
- A clear objective with a north-star metric, its link to per-item dwell, and explicit guardrails
- Label design for dwell time: visibility logging, normalization by format and length, position bias, skips and delayed labels
- A multi-stage architecture and where time spent enters each stage
- A multi-task model and a value function that combines its predictions, with a way to set the weights
- Offline metrics that match the objective, online experiments with long-term holdouts, and feedback-loop risks
- Serving constraints and monitoring
### Follow-up Questions
- Long videos earn more dwell than short posts. How do you stop the model from simply favoring long content?
- In the experiment, session time goes up but return visits go down. How do you detect and handle that?
- How do you rank a new item that has no dwell history yet?
- How do you choose the weights between dwell, clicks and other objectives in the final score?
Overview: Design a feed ranking system whose goal is to increase how much time users spend in the feed. It tests choosing an objective and guardrails, turning noisy dwell time into fair training labels, multi-stage ranking with multi-task models, and online experiments that capture long-term effects.