Design a Scalable Post, Feed, and Search Service
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
# Design a Scalable Post, Feed, and Search Service
Design a social-post service with three core capabilities: a user can publish a text post, retrieve a personalized feed of recent posts, and search posts by text. Cover the high-level architecture, APIs, data flow, storage choices, event streaming, scaling strategy, and an end-to-end walkthrough.
Do not assume one universal consistency model. State what users should observe after publishing or deleting a post and how those choices affect feed and search paths.
### Constraints & Assumptions
- The workload is read-heavy, but publish bursts and high-fanout authors exist.
- Feed reads need pagination with stable cursors.
- Search indexing may lag the source of truth if that behavior is explicit and observable.
- Media, recommendations, and advertising are outside the initial scope.
### Clarifying Questions to Ask
- Is the feed chronological, ranked, or a hybrid?
- What latency, availability, freshness, and retention targets matter?
- Which privacy and deletion guarantees are required?
- How large can a follower graph and one author's fanout become?
### What a Strong Answer Covers
- Clear APIs, identifiers, cursor semantics, and source-of-truth ownership
- A justified fanout-on-write, fanout-on-read, or hybrid feed strategy
- Durable event propagation to feed materialization and search indexing
- Partitioning, caching, backpressure, idempotency, and hot-key handling
- Deletion, privacy, observability, and reconciliation of derived views
### Follow-up Questions
- How would you prevent a celebrity publish from overwhelming the system?
- How does a privacy change propagate to cached feeds and search results?
- How would you rebuild the search index without missing concurrent writes?
- What does a stable feed cursor contain when new posts arrive between pages?
Quick Answer: Design a scalable service for publishing text posts, reading personalized feeds, and searching post content. Cover API and cursor contracts, feed fanout choices, durable event propagation, indexing lag, deletion and privacy semantics, partitioning, caching, backpressure, and hot users.