Facebook Post Search System Design
Visual Problem Diagram

Scenario
User searches their timeline for "beach wedding 2019" across posts with photos, links, and privacy scopes—global search must never return friends-only posts to strangers. Per-user index shard + privacy filter on every query is the trap.
Design search over social posts (user posts, group posts) respecting visibility rules. Every result must pass authorization for the searching viewer—indexing shortcuts that leak private posts fail the interview.
You should support full-text search, filters, ranking, and incremental indexing. Be ready to explain ACL in the index and post-filter authorization.
Constraints
Index posts, search by keyword/filters, rank results, enforce visibility, delete/update index
< 300 ms p95 search, near-real-time index minutes, no privacy leaks, 99.9% availability
Billions posts, millions searches/day, heterogeneous visibility rules