← 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 trending hashtags service at Facebook scale. Three parts, one hour, and by the end I felt like I'd only scratched the surface of what they actually wanted.

Questions Asked (7)

Q1

Design a backend system that detects and serves trending hashtags on a large social network. The system needs to ingest posts continuously, compute trend scores, and serve results with roughly one minute of end-to-end latency.

System DesignTechnical Trade-offs
Author's notes

The scope of this one is enormous.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, latency, accuracy) and then outline a high-level architecture that separates ingestion, processing, and serving. Focus on a streaming pipeline with windowed aggregation and a fast serving layer, and discuss trade-offs between exact and approximate counting.

Pro tip: Emphasize the use of approximate algorithms like Count-Min Sketch for memory efficiency and discuss how to handle hot keys and skewed data. Also, mention the importance of monitoring and backpressure to maintain latency SLAs.

1. Clarify Requirements and Scale

Ask about the number of posts per second, number of unique hashtags, expected read QPS, and acceptable latency. Confirm that one-minute end-to-end latency is a hard requirement.

2. High-Level Architecture

Propose a pipeline: ingestion (e.g., Kafka) -> stream processing (e.g., Flink/Spark Streaming) -> storage/serving (e.g., Redis/Cassandra). Ensure separation of concerns for scalability.

3. Trend Scoring and Windowed Aggregation

Define a trend score (e.g., weighted count with time decay) and use sliding windows (e.g., 1-minute windows with 1-second updates) to compute scores. Discuss how to handle late data and out-of-order events.

4. Serving Layer and API

Design a low-latency serving layer that stores top-K hashtags per time window. Use a cache (e.g., Redis) and provide an API to fetch trending hashtags, possibly with pagination.

5. Trade-offs and Optimizations

Discuss trade-offs: exact vs approximate counting (e.g., Count-Min Sketch), push vs pull for updates, and how to handle hot hashtags. Mention monitoring, backpressure, and fault tolerance.

Key Points to Mention

  • Use of approximate data structures (Count-Min Sketch, HyperLogLog) for memory efficiency
  • Stream processing frameworks (Flink, Spark Streaming) with windowing and watermarks
  • Time-decay scoring to prioritize recent trends
  • Handling hot keys and skewed data via sharding or local aggregation
  • Low-latency serving with in-memory stores (Redis) and caching
  • Monitoring, backpressure, and exactly-once semantics for reliability

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

Q2

How would you operationalize 'timeliness', 'popularity', and 'novelty' into a single computable trend score that refreshes at least once per minute?

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where I got into trouble.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining each metric precisely and how they can be computed from available data streams. Then propose a weighted combination formula that balances the three factors, and design a streaming pipeline that updates the score at least every minute. Finally, discuss trade-offs and potential optimizations.

Pro tip: Emphasize that the score should be tunable and that you would validate it with A/B testing to ensure it aligns with business goals. Also, mention the importance of handling data skew and ensuring low-latency updates.

1. Define Metrics

Clearly define timeliness, popularity, and novelty in computable terms. For example, timeliness as exponential decay of age, popularity as normalized engagement count, and novelty as inverse of similarity to previously seen items.

2. Design Score Formula

Propose a weighted sum or product of the three normalized metrics, e.g., score = w1 * timeliness + w2 * popularity + w3 * novelty. Discuss how to choose weights (e.g., based on business objectives or learned via machine learning).

3. Architect Streaming Pipeline

Outline a system that ingests real-time data (e.g., Kafka), processes it using a stream processor (e.g., Flink), computes the score, and stores it in a low-latency store (e.g., Redis) for serving. Ensure updates occur at least every minute.

4. Address Scalability and Trade-offs

Discuss challenges like handling high throughput, ensuring exactly-once semantics, and managing state. Trade-offs include accuracy vs. latency, and complexity vs. maintainability.

5. Evaluate and Iterate

Mention the need for monitoring, A/B testing, and feedback loops to refine the score over time. Consider offline evaluation and online metrics.

Key Points to Mention

  • Normalization techniques (e.g., min-max, z-score) to combine metrics on the same scale
  • Exponential decay for timeliness (e.g., score = e^(-λ * age))
  • Popularity as a function of engagement counts (e.g., log scaling to handle skew)
  • Novelty using content-based or collaborative filtering to measure dissimilarity
  • Stream processing frameworks (Kafka, Flink, Spark Streaming) for real-time computation
  • Caching and serving layer (Redis, Memcached) for low-latency access
  • Trade-offs between freshness and accuracy, and between simplicity and tunability

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

Q3

How do you handle the read path so that the trending list is served at very high QPS with under 100ms latency?

System DesignTechnical Trade-offs
Author's notes

Precompute and cache, basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and constraints (QPS, data size, update frequency), then propose a multi-layer caching architecture with precomputed trending lists. Emphasize trade-offs between consistency, latency, and cost, and explain how you would handle cache invalidation and hot keys.

Pro tip: Mention that you would serve stale data during cache misses with a background refresh to avoid latency spikes, and use consistent hashing with local caching to distribute load evenly.

1. Clarify Requirements and Constraints

Ask about expected QPS, data size, update frequency, and consistency requirements to scope the problem. This shows you avoid premature optimization and design for actual needs.

2. Design a Multi-Layer Caching Strategy

Propose using a CDN for edge caching, a distributed cache like Redis for the trending list, and an in-process cache for ultra-low latency. Explain how each layer reduces load on the origin.

3. Precompute and Store Trending Lists

Describe a background job that periodically computes the trending list and writes it to the cache layers. This decouples read path from heavy computation and ensures fast reads.

4. Handle Cache Invalidation and Consistency

Discuss strategies like TTL-based expiration, versioned keys, or pub/sub notifications to update caches. Acknowledge that eventual consistency is acceptable for trending data.

5. Address Scalability and Fault Tolerance

Explain how to shard the cache, replicate data, and use techniques like request coalescing to handle hot keys. Mention monitoring and fallback mechanisms to maintain latency under failures.

Key Points to Mention

  • Use of CDN and edge caching to serve static or semi-static trending lists close to users.
  • Distributed caching with Redis or Memcached, including sharding and replication for high availability.
  • In-process caching (e.g., Guava, Caffeine) to avoid network hops for the hottest data.
  • Precomputation of trending lists via batch jobs or stream processing to avoid on-the-fly aggregation.
  • Cache invalidation strategies: TTL, write-through, or event-driven updates with eventual consistency.
  • Handling hot keys with techniques like local caching, request coalescing, or key splitting.

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

Q4

How would you extend this design to support personalized or per-region trending lists without re-aggregating the entire firehose for every segment?

System DesignTechnical Trade-offs
Author's notes

Follow-up that caught me mid-breath.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what defines a segment (user attributes, region), how many segments, and the acceptable latency for trending updates. Then propose a two-tier aggregation architecture where the firehose is first aggregated into fine-grained buckets (e.g., by region and content category), and segment-specific trending lists are derived by combining these buckets with segment weights, avoiding full re-aggregation per segment.

Pro tip: Emphasize the trade-off between pre-computation and on-the-fly computation: pre-aggregate at a granularity that balances storage cost and query latency, and use approximation algorithms like count-min sketch for high-cardinality segments to keep memory bounded.

1. Clarify Requirements and Constraints

Ask about the number of segments, update frequency, latency SLAs, and whether personalization is per-user or per-group. This determines the aggregation granularity and storage strategy.

2. Design a Multi-Level Aggregation Pipeline

Propose a pipeline that aggregates the firehose into fine-grained buckets (e.g., by region, topic, and time window) using stream processing. These buckets serve as building blocks for any segment.

3. Derive Segment-Specific Lists via Composition

For each segment, compute trending lists by combining relevant buckets with segment-specific weights or filters. This avoids re-aggregating the raw firehose for every segment.

4. Address Scalability and Trade-offs

Discuss storage vs. compute trade-offs, use of approximation algorithms for high-cardinality segments, and caching strategies. Mention how to handle real-time updates and backfill.

5. Summarize and Validate

Recap the design, highlighting how it meets the requirements, and invite feedback on potential bottlenecks or alternative approaches.

Key Points to Mention

  • Two-tier aggregation: raw events -> fine-grained buckets -> segment-specific lists
  • Use of stream processing (e.g., Flink, Kafka Streams) for real-time aggregation
  • Segment weights or filters to combine buckets without full re-aggregation
  • Approximation algorithms (e.g., count-min sketch) for memory efficiency with many segments
  • Caching and pre-computation for low-latency serving
  • Trade-offs between pre-computation granularity, storage cost, and query latency

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

Q5

A coordinated group floods a new hashtag from many fake accounts to manufacture novelty and popularity signals. What defenses would you build into the trending system?

System DesignProduct Analytics & Metrics
Author's notes

Genuinely did not see this coming.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the goal: detect and mitigate coordinated inauthentic behavior that artificially inflates trending signals. Then propose a layered defense combining graph-based anomaly detection, behavioral signals, and rate limiting, while balancing false positives and real-time performance.

Pro tip: Emphasize that defenses must be adaptive and adversarial-aware—attackers evolve, so the system should continuously learn from new attack patterns and avoid hardcoded thresholds that can be gamed.

1. Define the threat model and success metrics

Identify what constitutes coordinated inauthentic behavior (e.g., many fake accounts, synchronized posting) and define metrics like precision/recall of detection, false positive rate, and latency impact.

2. Detect coordination via graph and behavioral signals

Use graph analysis to find clusters of accounts with similar creation times, posting patterns, or shared IPs/devices. Combine with behavioral signals like burstiness, content similarity, and account age.

3. Apply real-time mitigation and rate limiting

Implement rate limits per account, device, or IP; delay trending updates for suspicious hashtags; and require additional verification for accounts contributing to trending topics.

4. Incorporate feedback loops and adversarial adaptation

Use human review and machine learning to continuously update detection models, and simulate attacks to test robustness. Avoid static thresholds that attackers can reverse-engineer.

5. Balance trade-offs and monitor impact

Ensure defenses do not overly suppress legitimate trends or add excessive latency. Monitor false positives and adjust thresholds, and consider transparency with users about why a hashtag is not trending.

Key Points to Mention

  • Graph-based anomaly detection to identify coordinated clusters
  • Behavioral signals: account age, posting frequency, content similarity, device/IP reputation
  • Rate limiting and throttling at account, device, and IP levels
  • Real-time vs. batch processing trade-offs for detection and mitigation
  • Adversarial adaptation: continuous learning and red-teaming
  • False positive mitigation and user experience considerations

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

Q6

How would you normalize and cluster near-duplicate hashtags like #WorldCup and #world_cup so they count as one trend?

System DesignData Modeling
Author's notes

Short answer: lowercase normalization at ingestion, strip underscores and punctuation, maybe a phonetic or edit-distance clustering step for misspellings.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., real-time vs batch, acceptable false positives). Then outline a pipeline: normalize hashtags using text canonicalization, generate candidate pairs via blocking or MinHash LSH, and cluster using a similarity threshold. Finally, discuss how to maintain clusters incrementally and handle edge cases like multilingual hashtags.

Pro tip: Emphasize that perfect normalization is impossible due to ambiguity (e.g., #CamelCase vs #camel_case), so propose a tunable similarity threshold and a feedback loop to refine rules. Also, mention that clustering should be idempotent and support merging/splitting over time.

1. Clarify Requirements and Scale

Ask about data volume, latency needs, and tolerance for false positives/negatives. This determines whether to use batch or streaming processing and the complexity of the algorithm.

2. Normalize Hashtags

Apply text canonicalization: lowercase, remove separators (underscores, hyphens), handle Unicode (e.g., NFKC), and optionally split camel case. Consider language-specific rules and stemming/lemmatization.

3. Generate Candidate Pairs

Use blocking (e.g., by first few characters) or MinHash LSH to avoid O(n^2) comparisons. This efficiently finds likely duplicate pairs at scale.

4. Cluster Similar Hashtags

Compute similarity (e.g., Jaccard, edit distance, or embedding cosine) and cluster with a threshold using union-find or connected components. Tune threshold to balance precision and recall.

5. Maintain and Evolve Clusters

Design for incremental updates: when a new hashtag arrives, assign to an existing cluster or create a new one. Periodically re-cluster and allow manual overrides or feedback to improve accuracy.

Key Points to Mention

  • Text normalization techniques: lowercasing, separator removal, Unicode normalization, camel case splitting.
  • Scalable similarity search: MinHash LSH, blocking, or locality-sensitive hashing to reduce pairwise comparisons.
  • Clustering algorithms: union-find, connected components, or graph-based clustering with a similarity threshold.
  • Similarity metrics: Jaccard similarity, edit distance, or embeddings for semantic similarity.
  • Incremental processing: how to handle new hashtags and update clusters without full recomputation.
  • Evaluation and tuning: precision/recall trade-offs, A/B testing, and incorporating user feedback.

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

Q7

How would you measure trend quality both offline and online, and how would you tune the scoring weights over time?

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

A/B testing the scoring formula against user engagement metrics, and offline evaluation against a labeled dataset of known real-world events.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what 'trend quality' means in your context—likely a measure of how well a trend captures user engagement or relevance. Then describe offline evaluation using historical data and online evaluation via A/B tests, focusing on metrics like precision, recall, and user engagement. Finally, explain how you would iteratively tune scoring weights using experimentation and feedback loops.

Pro tip: Emphasize the importance of aligning offline metrics with online business metrics to avoid divergence, and mention using multi-armed bandits or Bayesian optimization for efficient weight tuning.

1. Define Trend Quality

Clarify what constitutes a high-quality trend: relevance, freshness, engagement, or diversity. Establish clear success metrics that align with product goals.

2. Offline Measurement

Use historical data to evaluate trend quality via metrics like precision@k, recall, NDCG, or user engagement proxies. Simulate ranking with different weights to assess impact.

3. Online Measurement

Run A/B tests or interleaving experiments to measure real user interactions (CTR, dwell time, shares). Use guardrail metrics to ensure no negative impact.

4. Weight Tuning

Adjust scoring weights based on offline and online results. Use techniques like grid search, Bayesian optimization, or multi-armed bandits to find optimal weights efficiently.

5. Iterate and Monitor

Continuously monitor performance, detect drift, and re-tune weights periodically. Incorporate user feedback and business changes to keep trends relevant.

Key Points to Mention

  • Offline metrics: precision, recall, NDCG, MAP
  • Online metrics: CTR, dwell time, engagement rate, conversion
  • A/B testing and interleaving for online evaluation
  • Weight tuning methods: grid search, Bayesian optimization, multi-armed bandits
  • Guardrail metrics to prevent negative user experience
  • Feedback loops and periodic re-evaluation to adapt to changing trends

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