Design Facebook News Feed | Instagram | Twitter | Facebook System Design (Pirate) Interview Series

The Interview Sage
The Interview Sage
Published in
2 min readFeb 7, 2021

--

Hi Everyone, I recently got the Design Facebook News Feed question in my Facebook onsite interview round.

Key Features

I was asked to design the following key features:

  1. Facebook users should be able to see the news feed containing posts and statuses, from their friends and pages that they have followed.
  2. Users can post and like statuses that may contain text, images, and videos.
  3. They can send friend requests to other users
  4. They can follow other pages.

Detailed Framework

I used the following framework to answer this question in the interview. It helped me to maintain focus and answer it better.

  1. Key Features
  2. Design Goals
    a. Minimum Latency
    b. High Availability
    c. Partition Tolerance
    d. Eventual Consistency (CAP Theorem)
    e. Read vs. Write Heavy
  3. Scale Estimation
    a. Daily Active Users (DAUs)
    b. Read QPS
    c. Write QPS
    d. Data generated each day and over 10 years (Storage Utilization)
    e. Approximate number of servers required
  4. High-Level Design
    a. Feed Generation
    b. Feed Publishing
    → Push vs. Pull
  5. Application Layer
    a. Multiple Stateless Servers with Load Balancer
  6. Database Design
    a. Schema design
    b. SQL vs. No-SQL
    c. Sharding
    → Hash-based sharding
    → Consistent Hashing
    d. Replication (for Fault Tolerance)
    e. Quorum
    → Read + Write Consistency
  7. Caching for Fast Retrieval
    a. Eviction Policy (LRU)
  8. Detailed Architecture Diagram

Optional

If time permits, you can also discuss the following towards the end of the interview:

  1. Push Notifications
  2. Security, for example, ACL (Access Control List)

Preparation Material for this question

High-Level Design + Detailed Architecture Diagram + Framework to answer this question in the interview

Learn more about the design goals, scale estimations, high-level design overview, and detailed architecture diagram of these problems in this video.

☕️ Buy us a Coffee at BuyMeACoffee.com/InterviewSage

This article is part of the series on System Design Interviews at Facebook. So, follow us to get notified when our next article in this series is published. Thanks for reading!

Disclosure & Disclaimer

--

--