Skip to main content

Preview — Pro guide

You are seeing a portion of this guide. Sign in and upgrade to unlock the full article, quizzes, and interview answers.

ML System Design: Instagram Feed Ranking System

The second canonical ML system design problem. Design Instagram's personalized feed ranking end-to-end — from multi-source candidate aggregation (friends, follows, recommended) to multi-task neural ranking predicting 10+ user actions simultaneously. Covers the exact architecture Meta uses in production, the value model that combines action predictions into a single score, integrity signals, SEV-driven guardrails, cold start for social graphs, and what each level (mid/senior/staff) must cover to pass.

60 min read 5 sections 2 interview questions
Feed RankingMulti-Task LearningValue ModelSocial GraphTwo-Tower NetworksDLRMCandidate GenerationIntegrity SignalsCold StartA/B TestingFeedback LoopsPosition BiasRecencySEV

Why Instagram Feed Is a Distinct MLSD Problem from YouTube

Feed ranking and video recommendation look similar on the surface — both pick content for a user — but the constraints are fundamentally different, and that's what makes Instagram feed a distinct interview problem.

The scale is social-graph-sized: Instagram serves 2+ billion MAU. Feed consumes ~50% of total time spent on the platform. Unlike YouTube, where 800M videos sit in a flat catalog, Instagram has a social graph overlay — users follow accounts, and the candidate set is dominated by posts from followed accounts plus algorithmic recommendations. You're not ranking 800M candidates; you're ranking a few thousand per user per session from a constrained, graph-biased pool.

The action space is much richer. YouTube has one primary action: watch. Instagram has ten-plus simultaneous signals — like, comment, share (to DM), save, follow, profile visit, time spent, story tap-through, reply, and negative signals (hide, report, snooze). A production feed ranker must predict all of them jointly because they capture different dimensions of user satisfaction.

The content is heterogeneous. A single feed ranks photos, videos (Reels), carousels, and ads — each with different engagement patterns and different optimal features. A carousel's engagement is measured in swipes; a Reel's in replay rate; a photo's in dwell time.

This problem is asked at Meta (Instagram, Facebook, Threads), LinkedIn, Twitter/X, Pinterest, TikTok, Snapchat, Reddit, Bluesky, and every social platform. Variants include:

  • Facebook News Feed
  • LinkedIn feed
  • Twitter home timeline "For You"
  • Pinterest home feed
  • Threads feed

The multi-task value-model architecture covered here is the dominant paradigm across all of them.

TIP

What Interviewers Are Evaluating

Mid-level: Can you articulate why a chronological feed was replaced by ranked feed? Can you describe the retrieval → ranking split? Do you know what features matter (affinity, recency, content type)?

Senior-level: Can you design a multi-task ranker with a value model combining predicted actions? Do you understand why predicting 10 actions beats predicting 1? Can you reason about the integrity layer (spam, misinformation, borderline content) as a first-class system? Do you identify the friends-vs-recommended tension proactively?

Staff-level: Do you treat the value model weights as a business-product tuning surface, not ML hyperparameters? Can you design for the feed's role in the broader Meta ecosystem (Stories, Reels, DMs feeding each other's signal)? Do you reason about SEVs (site events) and how guardrails differ for social vs algorithmic content? Do you understand why Meta moved to 'unconnected content' and what that implies for candidate generation?

Clarifying Questions — Ask These First

01

Which feed surface are we designing?

Main Instagram feed (mix of followed + recommended) vs Reels tab (pure algorithmic, short video) vs Explore (pure discovery, grid layout). Each has different constraints. For this problem: main Instagram feed, which is the hardest because it must balance social obligation (show posts from people you follow) with algorithmic recommendation (posts from accounts you don't follow).

02

What scale?

~500M DAU on Instagram feed specifically, avg user follows ~150 accounts, ~1000 candidate posts per session after graph expansion, target p95 latency 150ms. Feed is loaded ~20-30 times per DAU per day (every app open, every pull-to-refresh).

03

What's the business objective?

Time spent + meaningful interactions (Meta's 'MSI' metric). Ad revenue is downstream of time-spent, but the direct ML objective is a weighted combination of user actions, with time-spent and share-to-DM weighted most heavily. Product-org tunes these weights — we don't invent them in the model.

04

What's the ratio of followed vs recommended content?

Historically feed was 100% followed. Today Meta targets roughly 30-50% unconnected content (accounts you don't follow) to compete with TikTok. This ratio is a product decision that strongly shapes the retrieval architecture.

05

What integrity constraints apply?

Spam, sexually suggestive, violence, misinformation, borderline content (policy-adjacent but not violating), and political content suppression (per Meta's public commitments). Integrity is a re-ranking stage, not an afterthought.

06

Ads in scope?

Typically out of scope for a feed-ranking interview — ads have their own auction system and are interleaved after organic ranking. Confirm with the interviewer; if out of scope, note it explicitly and move on.

From Business Objective to ML Objective — The Value Model

Feed ranking is where the value model pattern is most clearly expressed. Unlike video where 'watch time' is a reasonable single objective, Instagram has no natural single-objective proxy. The question is not which metric to optimize but how to combine predicted probabilities of many actions into a single rankable score.

Option A — Maximize likes

Likes are the most visible, most frequent signal. Problem: likes are a weak-intent action. A user scrolling fast can tap a heart without any real engagement. Optimizing for likes produces a feed of visually appealing but shallow content. Meta A/B-tested this and saw like counts go up while time spent and return visits dropped. Verdict: bad single objective.

Option B — Maximize time spent

Better alignment with ad revenue. Problem: same as YouTube — rewards attention-hijacking content. Meta publicly committed (after 2018 News Feed overhaul) to meaningful social interactions, not raw time-spent, because internal research showed passive scrolling correlated negatively with user wellbeing.

Option C — Maximize weighted sum of predicted actions (value model)

Predict the probability of each action (like, comment, share, save, follow, hide, time-spent, etc.) for each candidate post. Combine them via a linear value model:

score(post) = Σᵢ wᵢ × P(actionᵢ | user, post)

Weights are product decisions, not ML hyperparameters. Share-to-DM has a much higher weight than like because it represents stronger intent. Hide has a large negative weight. Comment has a higher positive weight than like because comments indicate genuine engagement.

This is the interview standard answer and what Meta publicly describes.

Option D — Multi-objective with long-term value (senior/staff level)

Add a term for estimated long-term user value — e.g., 24-hour return probability, 30-day retention impact. This is learned from causal inference or reinforcement-learning-style offline estimation. Meta does this via downstream metrics fed back into the value model weight tuning. The short-term action predictions still drive ranking; the long-term term lives in how weights are chosen offline.

IMPORTANT

Premium content locked

This guide is premium content. Upgrade to Pro to unlock the full guide, quizzes, and interview Q&A.