1
0 Comments

Design Facebook News Feed | Instagram | Twitter | System Design & Architecture

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.

Video Link: https://www.youtube.com/watch?v=aEPrtb9a9jc

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

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

⬇ Download 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.

Useful Links

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

👩‍💻 Best System Design Interview Course

💻 Grokking the Coding Interview

👩‍🏫 Free Behavioral Interview Guide

🤖 Best Machine Learning Interview Course

📚 Recommended Interview Preparation Book

❤️ Support us in creating free high-quality educational content, and avail services like 📝 Detailed Resume Review, 🎉 Early Access to our content, and 📣 Shout-out in our videos.
☕️ Buy us a coffee: https://www.buymeacoffee.com/InterviewSage
🔗 Patreon: https://www.patreon.com/TheInterviewSage

🖥 Our Setup + 📚 Interview Prep Books & Courses: https://kit.co/theinterviewsage

Disclosure & Disclaimer

posted to Icon for group Developers
Developers
on February 7, 2021
Trending on Indie Hackers
The most underrated distribution channel in SaaS is hiding in your browser toolbar User Avatar 162 comments I launched on Product Hunt today with 0 followers, 0 network, and 0 users. Here's what I learned in 12 hours. User Avatar 149 comments I gave 7 AI agents $100 each to build a startup. Here's what happened on Day 1. User Avatar 97 comments Show IH: RetryFix - Automatically recover failed Stripe payments and earn 10% on everything we win back User Avatar 34 comments How we got our first US sale in 2 hours by finding "Trust Leaks" (Free Audits) 🌶️ User Avatar 26 comments How to see your entire business on one page User Avatar 23 comments