Mock Interviewer

Ask Coach

Ask Coach
Clarify requirements before you design — kept separate from your stage notes.

Tap a question to start, or type your own below.

Facebook Post Search System Design

Visual Problem Diagram

Facebook Post Search System Design architecture diagram

Scenario

A user searches Facebook posts for "beach wedding 2019" and expects results from public posts, friends, groups, and their own history. The hard part is not only finding matching words. The system must never show a private, blocked, deleted, or moderated post to the wrong viewer, even when the search index is a few seconds behind the source of truth.

Design search over social posts such as user posts, group posts, captions, links, and optionally media-derived text. The system should support keyword search, filters, ranking, pagination, and near-real-time updates while respecting who may see each post.

Constraints

Functional

Index posts, update and delete indexed documents, search by keyword and filters, rank results, enforce visibility, return cursor-based pages.

Non-functional

No privacy leaks, p95 search around a few hundred milliseconds for common queries, near-real-time indexing for normal writes, faster protection for deletes and takedowns.

Scale

Billions of posts, many index shards, millions of searches per day, highly skewed terms, and social-graph checks on the hot read path.

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs

Log in to start practicing

Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.