← Meta Interview Insights

Meta·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

Meta system design round focused entirely on building a search system for posts, basically a stripped-down Elasticsearch from scratch. Pretty intense scope for a single session, lots of follow-ups on sharding strategy and ranking.

Questions Asked (3)

Q1

Design a system to search Facebook posts: given keyword queries, return relevance-ranked results at scale.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

This one is deceptively wide.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, latency, ranking factors, freshness) and then outline a high-level architecture that separates ingestion, indexing, and query serving. Focus on the trade-offs between relevance and scalability, and propose a concrete design using inverted indexes, sharding, and caching.

Pro tip: Emphasize that relevance ranking is an iterative process: start with a simple TF-IDF or BM25 baseline, then layer on engagement signals and machine learning models, but always measure impact via A/B tests. Also, discuss how to handle real-time indexing and deletion of posts to keep results fresh.

1. Clarify Requirements and Scope

Ask questions to understand scale (daily posts, queries per second), latency requirements, ranking criteria (recency, engagement, relevance), and consistency needs. Define what 'relevance' means for Facebook posts.

2. High-Level Architecture

Propose a pipeline: ingestion (posts streamed to indexers), indexing (build inverted index with post metadata), and query serving (parse query, retrieve candidates, rank, return results). Mention components like Kafka, distributed file system, and query servers.

3. Indexing and Storage Design

Design the inverted index: tokenization, stemming, stop words, and posting lists with doc IDs and term frequencies. Discuss sharding by document or term, replication for fault tolerance, and storage optimizations (compression, tiered storage).

4. Query Processing and Ranking

Explain query flow: parse, rewrite, retrieve top-K candidates using index, then rank using a combination of textual relevance (BM25) and social signals (likes, comments, shares, recency). Mention machine learning models for ranking and how to train them.

5. Scalability, Latency, and Trade-offs

Address scaling: horizontal scaling of index shards, caching frequent queries, using CDNs for static assets. Discuss trade-offs: consistency vs. latency, index freshness vs. throughput, and cost vs. performance.

Key Points to Mention

  • Inverted index and posting lists for efficient keyword search
  • Sharding and replication strategies for horizontal scalability
  • Ranking with TF-IDF/BM25 plus engagement signals (likes, comments, shares) and recency
  • Caching and CDN for low-latency query serving
  • Real-time indexing and deletion to handle fresh content
  • Trade-offs between relevance, latency, and cost; use of A/B testing for ranking improvements

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle real-time post ingestion into the search index without taking down read performance?

System DesignTechnical Trade-offs
Author's notes

Went with a streaming pipeline that appends to an in-memory buffer, flushes to immutable segments periodically, then compacts in the background.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., QPS, latency SLAs, freshness). Then propose a decoupled architecture using a message queue and a separate indexing pipeline that writes to a new index version, with atomic alias swaps to avoid impacting read performance. Finally, discuss trade-offs and monitoring.

Pro tip: Emphasize that read performance is paramount and that you would use techniques like double-buffering (blue-green deployment) and incremental indexing to minimize disruption. Also, mention the importance of backpressure and dead-letter queues to handle ingestion spikes gracefully.

1. Clarify Requirements

Ask about the scale (documents per second, total index size), read latency SLA, and freshness requirements (how soon must new posts be searchable).

2. Decouple Ingestion from Indexing

Propose a message queue (e.g., Kafka) to buffer incoming posts, allowing the indexing pipeline to process at its own pace without affecting read traffic.

3. Use Versioned Indexes with Atomic Swaps

Build a new index version in the background, then atomically swap an alias to point to it, ensuring reads are never blocked and consistency is maintained.

4. Optimize Indexing for Read Performance

Use techniques like segment merging, incremental indexing, and caching to minimize the impact on read operations. Consider read/write separation with dedicated replicas.

5. Monitor and Handle Failures

Implement monitoring for ingestion lag, read latency, and error rates. Use backpressure, retries, and dead-letter queues to handle failures without degrading read performance.

Key Points to Mention

  • Message queue (e.g., Kafka) for decoupling and buffering
  • Atomic alias swap for zero-downtime index updates
  • Read/write separation with dedicated replicas for reads
  • Incremental indexing and segment merging to reduce overhead
  • Backpressure and dead-letter queues for resilience
  • Monitoring and alerting on ingestion lag and read latency

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through your ranking approach for search results. How would you go beyond simple keyword matching?

System DesignAlgorithms & Data Structures
Author's notes

Started with TF-IDF, moved to BM25, then described layering a ranking model on top with features like engagement signals and personalization.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a multi-stage ranking pipeline: candidate generation, feature extraction, and final scoring with machine learning. Emphasize that you go beyond keyword matching by incorporating signals like user behavior, document quality, and semantic understanding. Conclude by discussing how you evaluate and iterate on the ranking model.

Pro tip: At Meta, ranking systems must handle massive scale and real-time updates, so highlight your experience with distributed systems and online experimentation. Mention that you balance relevance with other objectives like freshness, diversity, and business metrics.

1. Candidate Generation

Describe how you efficiently retrieve a set of potentially relevant documents from a large corpus, using inverted indices, embeddings, or graph-based methods. This stage prioritizes recall over precision.

2. Feature Engineering

Explain the features you extract for each query-document pair, such as textual similarity, click-through rates, user engagement history, and document authority. Include both handcrafted and learned features.

3. Ranking Model

Detail the machine learning model used to score and order candidates, e.g., gradient boosted trees or neural networks. Discuss how you train it on labeled data (e.g., clicks, relevance judgments) and handle biases.

4. Evaluation and Iteration

Explain how you measure ranking quality offline (e.g., NDCG, MRR) and online (A/B tests). Describe how you use feedback to refine features and model architecture.

5. Beyond Keyword Matching

Highlight techniques like semantic embeddings, query understanding, personalization, and contextual signals that capture intent beyond literal term matching.

Key Points to Mention

  • Two-stage retrieval and ranking architecture for scalability
  • Learning-to-rank algorithms (e.g., LambdaMART, neural rankers)
  • Use of embeddings and semantic similarity for query-document matching
  • Incorporation of user behavior signals (clicks, dwell time) for personalization
  • Online evaluation via A/B testing and interleaving experiments
  • Handling of biases and fairness in ranking models

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.