Back to explorer
System Architectures 18 Min

FB Post Search

MEDIUM

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

Concept CheckInteractive

Inverted indexes enable efficient keyword searches by mapping terms to document lists.