Mock Interviewer
Ask Coach
Tap a question to start, or type your own below.
Facebook Post Search System Design
Visual Problem Diagram

Scenario
Picture opening a social network and typing beach wedding 2019 into the search box, because you half remember a friend's photos from that weekend. You would like to see the posts you are allowed to see: public posts, posts from friends, posts in groups you belong to, and your own. The part of the system that finds those posts is called post search. It has a harder job than a normal web search, because a post that matches your words can still be off limits to you, and a post your friend deleted a few seconds ago must not show up even though the search copy has not caught up yet.
Clarify this problem here, or open Pathway Coach if you want a prep plan first.
This problem asks you to design post search for a very large social network, which is the part of the product that takes a few words typed by a person and returns the posts that match, as long as that person is allowed to see them. The person types a few words, optionally narrows the results with a filter such as an author or a date range, and opens the next page when the first one is not enough. Posts can be public, visible only to friends, shared inside a group, or private to the author, so two people who type the same words can legitimately get different results.
In the interview you need to explain six things. First, how the words a person types lead to the matching posts without reading every post that exists. Second, how a brand-new post becomes searchable without making the person who published it wait. Third, how a private group post, or a post from someone the searcher has blocked, is dropped before it reaches the screen. Fourth, how a deleted post disappears quickly even when the search copy of it is a few seconds behind the real post. Fifth, how you order the posts that remain and return the next page. Sixth, how one very common word avoids forcing the system to look at millions of posts. Reading the text inside photos and keeping a separate search list for every person can stay thin, because they are extensions and not the core.
Constraints
Add a post to search. Update it or remove it. Search by words and filters. Order the matches. Hide posts the viewer is not allowed to see. Return the next page.
Most common searches finish in a few hundred milliseconds, so results feel instant. A normal new post becomes searchable within seconds. A deleted or taken-down post is hidden faster than that, even if the search copy lags.
Billions of posts and millions of searches a day. Searching is the hot action. The heavy read is a common word that matches a huge list of posts.
Stages ahead
Not ready to design yet?
Try the free Coach trial — ask how to prep, what to practice first, or how InterviewCrafted works. Sign in when you want to start this problem.
Log in to start practicing
Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.
Want full access now? View Pro pricing