Skip to main content

Classic design · Senior

Personalized news feed

Classic interview design. Key points: multi-task engagement, weighted score, and freshness and diversity.

16 min read · Content reviewed on October 23, 2026

Short answer

Classic interview design. Key points: multi-task engagement, weighted score, and freshness and diversity. Facebook News Feed ranking decides, for each person, which posts appear first. Meta's engineering post describes the challenge of designing personalized ranking for more than two billion people, each with different interests.

01 · CONTEXT

Deciding what each person sees first

Facebook News Feed ranking decides, for each person, which posts appear first. Meta's engineering post describes the challenge of designing personalized ranking for more than two billion people, each with different interests. The company says it uses machine learning to predict which content will be most important to each person.

Without machine learning, the feed could be flooded with content the person does not find relevant or interesting, including overly promotional content or content from acquaintances who post frequently, which can bury content from the people they are closest to.

Scale complicates the problem: the available posts must be scored for more than two billion people, with more than a thousand posts per person per day on average. In addition, the system needs to know whether an article received many likes even if it was published minutes earlier.

02 · THE OBJECTIVE

From a like to many signals

The starting point is an observable signal of value: the person clicking like. The prediction uses features of the post, such as its type or the relationship between the viewer and the poster. The algorithm ranks higher the item with the highest predicted probability that the person will like it.

Liking is not the only way to express preference. There are several values, such as likes, comments, and shares, that must be aggregated into a single value per post. Sometimes the models disagree, and the weight of each prediction is based on the actions people say, in surveys, are most meaningful.

The overall goal is long-term value. To evaluate it, the post argues for choosing metrics aligned with what people say is important to them, and the company surveys people about how meaningful an interaction was or whether a post is worth the time.

03 · ARCHITECTURE

From the request to the ranked feed

When someone opens Facebook, on any interface, the request goes to a Web/PHP layer, which queries the feed aggregator. The aggregator collects the relevant information about each post and analyzes its attributes to predict the post's value to the person and compute the final score, aggregating all the predictions.

  1. The diagram starts with the client, whether an iPhone, an Android, or a browser, which sends the request to the Web/PHP layer.

    Architecture diagram: News feed: from request to ranked feed
    CLApp or browserrequest origin
    CPCamada Web/PHP
    CPFeed aggregator
    DBFeed leaf stores
    CPPreditores
  2. The Web/PHP layer queries the feed aggregator.

    Architecture diagram: News feed: from request to ranked feed
    CLApp or browser
    CPCamada Web/PHP
    CPFeed aggregatorqueried by Web
    DBFeed leaf stores
    CPPreditores
  3. The aggregator fetches actions and objects, with an object summary, from the feed's leaf databases.

    Architecture diagram: News feed: from request to ranked feed
    CLApp or browser
    CPCamada Web/PHP
    CPFeed aggregator
    DBFeed leaf storescandidates and summaries
    CPPreditores
  4. The models run over all candidate stories in parallel, across many machines called predictors.

    Architecture diagram: News feed: from request to ranked feed
    CLApp or browser
    CPCamada Web/PHP
    CPFeed aggregator
    DBFeed leaf stores
    CPPreditoresparallel models
  5. The aggregator returns the list of ranked stories to the front end, which renders it for the person.

    Architecture diagram: News feed: from request to ranked feed
    CLApp or browser
    CPCamada Web/PHP
    CPFeed aggregatorranked list
    DBFeed leaf stores
    CPPreditores

04 · CANDIDATES AND PASSES

Inventory, funnel, and diversity

The eligible inventory includes any non-deleted post shared by a friend, group, or page the person is connected to, made since the last login. There is also resurfacing logic: new posts the person has not seen but that were ranked in earlier sessions become eligible again, and already-seen posts that generated an interesting conversation among friends can become eligible again as a comment-boosted post.

Scoring happens in several passes, needed to save computing power and to apply rules, such as diversity of content types, that depend on an initial score. Before them, integrity processes are applied to each post.

  1. The diagram starts with the eligible inventory, which gathers the posts since the last login and those that become eligible again.

    Architecture diagram: News feed: candidate funnel and passes
    CPEligible inventorycandidatos
    CPIntegrity processes
    CPLight pass
    CPMain pass
    CPContextual pass
    CLPerson's feed
  2. Integrity processes are applied to each post before the scoring passes.

    Architecture diagram: News feed: candidate funnel and passes
    CPEligible inventory
    CPIntegrity processesintegridade
    CPLight pass
    CPMain pass
    CPContextual pass
    CLPerson's feed
  3. A lightweight model selects about five hundred of the most relevant posts among the eligible ones.

    Architecture diagram: News feed: candidate funnel and passes
    CPEligible inventory
    CPIntegrity processes
    CPLight passnarrows candidates
    CPMain pass
    CPContextual pass
    CLPerson's feed
  4. In the main pass, each story is scored independently and the eligible ones are sorted by score.

    Architecture diagram: News feed: candidate funnel and passes
    CPEligible inventory
    CPIntegrity processes
    CPLight pass
    CPMain passscores and sorts
    CPContextual pass
    CLPerson's feed
  5. Rules such as diversity of content types come in during the contextual pass.

    Architecture diagram: News feed: candidate funnel and passes
    CPEligible inventory
    CPIntegrity processes
    CPLight pass
    CPMain pass
    CPContextual passdiversidade
    CLPerson's feed
PassadaWhat it doesWhy it exists
LeveUses a lightweight model to select the most relevant posts among the eligible onesAllows ranking fewer stories, with high recall, and using more powerful neural networks in the following passes
PrincipalScores each story independently and sorts the eligible ones by scoreThis is where most of the personalization happens
ContextualAdds contextual features, such as content-type diversity rulesPrevents the person from seeing redundant content types, such as several videos in a row

05 · THE SCORE

From multitask predictions to a linear combination

Each post is scored with multitask neural networks. The features include the post type, embeddings, that is, representations generated by deep learning models, and what the person usually interacts with. For each person, there are thousands of signals to evaluate.

  1. The diagram starts with the features that feed the model: post type, embeddings, and what the person usually interacts with.

    Architecture diagram: News feed: multitask predictions and linear score
    CPAtributosatributos
    CPMultitask network
    CPLike prediction
    CPComment prediction
    CPShare prediction
    CPLinear combination
  2. The multitask neural network receives the features and scores the post.

    Architecture diagram: News feed: multitask predictions and linear score
    CPAtributos
    CPMultitask networkmultitarefa
    CPLike prediction
    CPComment prediction
    CPShare prediction
    CPLinear combination
  3. The system generates several predictions for the person, such as like, comment, and share.

    Architecture diagram: News feed: multitask predictions and linear score
    CPAtributos
    CPMultitask network
    CPLike predictioncurtir
    CPComment predictioncomentar
    CPShare predictioncompartilhar
    CPLinear combination
  4. The predictions are combined linearly into a single value per post.

    Architecture diagram: News feed: multitask predictions and linear score
    CPAtributos
    CPMultitask network
    CPLike prediction
    CPComment prediction
    CPShare prediction
    CPLinear combinationsingle value
  5. A rare action, with a prediction close to zero, plays a minimal role in the result.

    Architecture diagram: News feed: multitask predictions and linear score
    CPAtributos
    CPMultitask network
    CPLike predictionlow prediction
    CPComment prediction
    CPShare prediction
    CPLinear combination

For simplicity and tractability, the predictions are combined linearly. For some people, the score may be higher for likes than for comments, because some people express themselves more by liking. One advantage of the format is that an action the person rarely engages in, such as a like prediction very close to zero, automatically plays a minimal role in the ranking.

06 · FRESHNESS AND LIMITS

Freshness, diversity, and what to take into the interview

Freshness shows up in more than one place. The system needs to know, in real time, whether an article received many likes even though it was published minutes earlier, and also whether the person liked a lot of content a minute earlier, in order to use that in ranking. The resurfacing logic makes not-yet-seen posts get reconsidered.

Diversity, in turn, comes in at the contextual pass, because rules such as content-type variety depend on an initial score.

The post also cites offline learning systems among the techniques behind the meaningful interactions and content quality models.

Frequently asked questions

What is Personalized news feed?

Classic interview design. Key points: multi-task engagement, weighted score, and freshness and diversity.

What does the Personalized news feed design cover?

It is organized in these sections: Deciding what each person sees first, From a like to many signals, From the request to the ranked feed, Inventory, funnel, and diversity, From multitask predictions to a linear combination, and Freshness, diversity, and what to take into the interview.

How long is Personalized news feed and what level is it?

It takes about 16 minutes to read and is rated Senior level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.