Design Near-Real-Time Indexing So New Posts Are Searchable in Seconds

Last updated: November 29, 2026

Quick Overview

Design the indexing pipeline for Facebook and Threads post search so that a new public post becomes searchable within a few seconds, while the full index still holds years of posts.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
Onsite
System Design
Medium

0

0

0 solved


Design the indexing pipeline for Facebook and Threads post search so that a new public post becomes searchable within a few seconds, while the full index still holds years of posts.

Freshness matters for search during breaking news, and Meta interviewers ask how to combine a small fast index with a large static one. They check the tiered index design, delete handling, and how queries merge results across tiers.

What the Interviewer Expects
  • Tier the index into real-time, recent, and historical segments
  • Describe the streaming ingestion and tokenization path
  • Merge and compact segments over time
  • Handle edits, deletes, and privacy changes
  • Merge query results across tiers
Key Topics to Cover
Inverted index
Tiered segments
Stream ingestion
Tombstones
Result merging
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you make sure a deleted post disappears immediately?
  • How would you rank fresh posts that have no engagement yet?
  • What is the memory cost of the real-time tier?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: new posts searchable within ~5 s; edits reflected; deletes removed immediately; search over all history.

Non-functional: hundreds of thousands of new posts per second at peak; que...

High-Level Design
  • Ingestion: post-created events go to a stream. Indexer workers tokenize text, extract entities and hashtags, and append to an in-memory real-time segment on index servers, partitioned by pos...

Submit Your Answer
Markdown supported