1
0 Comments

Design Facebook Status Search | Twitter Search | System Design & Architecture

Design Facebook Status Search is a very popular system design interview question.

Facebook provides a search bar at the top of its page to enable its users to search posts, statuses, videos, and other forms of content posted by their friends and the pages they follow.

Key Features

Given that it will be a 45-minute interview round, you will be designing a system with a lower feature set. In this question, you will be asked to develop the backend of a system with the following key features:

  1. Enable the users to search the statuses that their friends and the pages they follow have posted on Facebook.
  2. For simplicity, consider that these statuses will only contain text for this particular question.

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

Detailed Framework

You can use the following framework to better answer the Design Facebook Status Search question in the interview. It will help you to maintain focus and answer it better.

  1. Key Features
    • As discussed above
  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. REST APIs
    • /statusSearch (Read API)
    • /postStatus (Write API)
  5. High-Level Design
    • How to build the Search Index for fast retrieval on a large scale?
  6. Application Layer
    • Multiple Stateless Servers with Load Balancer (Round-Robin)
  7. Database + Search Index Design (Data Layer)
    • Schema design
    • SQL vs. No-SQL
    • Sharding
      • Hash-based sharding
      • Consistent Hashing
    • Replication (for Fault Tolerance)
    • Quorum
      • Read + Write Consistency
  8. Caching for Fast Retrieval
    • Eviction Policy - LRU
  9. Detailed Architecture Diagram

Optional

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

  1. Security, for example, ACL (Access Control List)
  2. Statuses which can also contain media (photo & video) along with text

Preparation Material for this question

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

Learn more about the Key Features, Design Goals, Scale Estimations, REST APIs, High-Level Design, and Detailed Architecture Diagram of this problem in this video.

Useful Links

👩‍💻 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 take advantage of services like
📝 Detailed Resume Review
🎁 Special Discounts on Extras
🎉 Early Access to our content
📣 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

Trending on Indie Hackers
I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 12 comments Hero Section Copywriting Framework that Converts 3x 12 comments Promptzone - first-of-its-kind social media platform dedicated to all things AI. 8 comments How to create a rating system with Tailwind CSS and Alpinejs 7 comments