Design Facebook News Feed | Instagram | Twitter | Facebook System Design (Pirate) Interview Series
Tags: beginners, tutorial, programming, career
Published: 2021-02-07 04:10:22

{% youtube aEPrtb9a9jc %}

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
    * Minimum Latency
    * High Availability
    * Partition Tolerance
    * Eventual Consistency (CAP Theorem)
    * Read vs. Write Heavy
3. Scale Estimation
    * Daily Active Users (DAUs)
    * Read QPS
    * Write QPS
    * Data generated each day and over 10 years (Storage Utilization)
    * Approximate number of servers required
4. High-Level Design
    * Feed Generation
    * Feed Publishing
        * Push vs. Pull
5. Application Layer
    * Multiple Stateless Servers with Load Balancer
6. Database Design
    * Schema design
    * SQL vs. No-SQL
    * Sharding
        * Hash-based sharding
        * Consistent Hashing
    * Replication (for Fault Tolerance)
    * Quorum
        * Read + Write Consistency
7. Caching for Fast Retrieval
    * 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](https://www.buymeacoffee.com/interviewsage/e/19518)

Learn more about the design goals, scale estimations, high-level design overview, and detailed architecture diagram of these problems in [this video](https://www.youtube.com/watch?v=aEPrtb9a9jc).

---

# Cracking the Facebook Behavioral Interview

If you have not read our first article on Top Facebook Behavioral Interview Questions, we recommend reading it by clicking the below link:

{% post https://dev.to/theinterviewsage/top-facebook-behavioral-interview-questions-part-1-2a0o %}

---

# Cracking the Facebook System Design Interview

In case if you have not read our series on Cracking the Facebook System Design Interview, we recommend reading it by clicking the below link:

{% post https://dev.to/theinterviewsage/top-facebook-system-design-interview-questions-31np %}

---

# Useful Links

✅ [Educative.io Unlimited Plan [💰 10% off for first 100 users]](https://bit.ly/Educative-Unlimited)
✅ [TryExponent.com Membership [💰 Limited Time 10% offer]](https://bit.ly/Try-Exponent)

👩‍💻 [Best System Design Interview Course](https://www.educative.io/courses/grokking-the-system-design-interview?aff=KQZl)
🚀 [Complete SWE Interview Course [💰 Limited Time 10% offer]](https://bit.ly/SWE-Interview-Course)
🙋‍♀️ [Behavioral Interview Guide [💰 Special Discount]](https://www.buymeacoffee.com/interviewsage/e/30176)
📚 [Recommended Interview Preparation Book (on Amazon)](https://smarturl.it/InterviewPrepBook)

---

[![Buy Me a Coffee](https://dev-to-uploads.s3.amazonaws.com/i/o2l00b1bt3nl8fdfb0nn.png)](https://www.buymeacoffee.com/InterviewSage)

<center>☕️ Buy us a Coffee at <a href="https://www.buymeacoffee.com/InterviewSage">BuyMeACoffee.com/InterviewSage</a></center>

---

> 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! {% user theinterviewsage %}

[Full Disclosure & Disclaimer](https://disclosureanddisclaimer.theinterviewsage.com/)