FB Post Search
Common Problems
FB Post Search
Scaling ReadsScaling WritesPublished Jul 5, 2024ByStefan Mai·medium·Asked at:Try This Problem Yourself
Practice with guided hints and real-time feedbackStart Practice
Understanding the Problem
🔍 What is Facebook?
Facebook is a social network centered around “posts” (messages). Users consume posts via a timeline composed of posts from users they follow or more recently, that the algorithm predicts they will enjoy. Posts can be replied, “liked”, or “shared” (sometimes with commentary).
For this problem, we're zooming in on the search experience for Facebook. This question is primed for infrastructure-style interviews where your interviewer wants to understand how deeply you understand data layout, indexing, and scaling.
We're going to assume our interviewer has explicitly told us that we're not allowed to use a search engine like Elasticsearch or a pre-built full-text index (like Postgres Full-Text) for this problem.
This practice of disallowing specific technologies is common enough that you should be prepared for it. The intent here is to
Inverted indexes enable efficient keyword searches by mapping terms to document lists.
Related Topics
Expand your knowledge by learning about adjacent concepts in system design.
Design a URL Shortener (TinyURL)
Build a high-throughput shortener analyzing base58 encodings and database sharding.
Networking Essentials
Learn the important parts of networking that you'll need to know for your system design interviews
API Design
Learn about API design for system design interviews
Cheat Sheet Utility
View and print a concise system design reference card.