Design a Dedicated News Feed Ranking Algorithm

System Design
Medium
Meta
83K views

Beyond feed generation, describe the ranking algorithm. Discuss features used (recency, popularity, user affinity), A/B testing, and model deployment.

Why Interviewers Ask This

Interviewers at Meta ask this to evaluate your ability to balance competing business objectives like user engagement and content freshness within a massive-scale system. They specifically assess your understanding of how machine learning models integrate with heuristic scoring, your approach to handling cold-start problems for new posts, and your strategic thinking regarding A/B testing frameworks to validate ranking improvements before global rollout.

How to Answer This Question

1. Clarify requirements by defining success metrics such as time spent, likes, or shares, and establish constraints like latency limits for real-time rendering. 2. Outline the data pipeline, detailing how you ingest signals like post recency, author affinity, and interaction history from billions of daily events. 3. Design a two-stage architecture: first, a candidate generation phase to filter millions of posts down to hundreds using heuristics, followed by a ranking phase using a gradient boosting model or neural network. 4. Discuss feature engineering specifics, emphasizing how you weight user affinity against content popularity to prevent echo chambers. 5. Conclude with an evaluation strategy, explaining how you would design an A/B test to measure lift in engagement while monitoring negative feedback loops like spam or misinformation.

Key Points to Cover

  • Demonstrating a clear separation between candidate generation and precise ranking phases
  • Identifying specific, actionable features like user affinity and content embeddings
  • Proposing a concrete A/B testing strategy that balances engagement with content quality
  • Addressing the cold-start problem for new posts effectively
  • Emphasizing latency constraints critical for real-time social media feeds

Sample Answer

To design a dedicated news feed ranking algorithm, I would start by defining our primary objective: maximizing meaningful interactions without compromising content diversity. First, we need a candidate generation stage that filters the billions of daily posts down to a manageable set, say 500, using fast heuristics based on user affinity and recent activity. Next, in the ranking stage, we employ a machine learning model, likely a Gradient Boosted Decision Tree or a Deep Learning model, to score these candidates. Key features would include post recency, the user's historical affinity for the author, predicted probability of clicking, and engagement velocity. We must also handle cold starts for new posts by leveraging content embeddings rather than just interaction history. Crucially, we cannot rely solely on offline metrics. I would propose a rigorous A/B testing framework where we deploy the new model to a small percentage of users, measuring incremental lift in 'time spent' and 'shares' while strictly monitoring 'unfollow rates' to ensure we aren't creating filter bubbles. Finally, we need a robust online serving layer with low latency, ensuring the model inference happens in under 100 milliseconds to maintain a seamless user experience across mobile devices.

Common Mistakes to Avoid

  • Focusing only on the ML model while ignoring the high-level system architecture and data flow
  • Neglecting to define success metrics, leading to a solution that optimizes for the wrong outcome
  • Overlooking the cold-start problem for new content creators or posts
  • Failing to mention A/B testing or how to validate the model's impact on user retention

Practice This Question with AI

Answer this question orally or via text and get instant AI-powered feedback on your response quality, structure, and delivery.

Start Practicing

Related Interview Questions

Browse all 150 System Design questionsBrowse all 71 Meta questions