← Meta Interview Insights

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

Senior
Jun 2026

Summary

Meta system design round for a software engineer role. The question was about building an ads impression aggregator, which sounds straightforward until you actually have to think through the storage and late-event handling pieces under pressure.

Questions Asked (2)

Q1

Design a service that ingests a high-volume stream of ad impression events and exposes per-ad impression counts aggregated by hour, with near real-time updates within 30 seconds. How do you handle late or out-of-order events?

System DesignData ModelingTechnical Trade-offs
Author's notes

I started with the ingestion layer, Kafka felt obvious, and I talked through windowing logic for the hourly buckets.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, latency, accuracy) and then propose a streaming architecture using a distributed log (e.g., Kafka) for ingestion, a stream processor (e.g., Flink) for windowed aggregation, and a fast serving layer (e.g., Redis or Cassandra) for low-latency queries. Address late/out-of-order events by using event-time processing with watermarks and allowed lateness, and discuss trade-offs between accuracy and latency.

Pro tip: Emphasize that you would use event-time processing with watermarks and allowed lateness, and explain how you'd handle updates to already emitted results (e.g., via retractions or upserts) to maintain correctness while meeting the 30-second freshness SLA.

1. Clarify Requirements and Constraints

Ask about expected event volume, acceptable latency, accuracy requirements, and query patterns to scope the design appropriately.

2. Design Ingestion and Processing Pipeline

Propose a scalable ingestion layer (e.g., Kafka) and a stream processing engine (e.g., Flink) that performs windowed aggregations by ad ID and hour.

3. Handle Late and Out-of-Order Events

Use event-time processing with watermarks to track progress, and allow a configurable lateness window. For events arriving after the window closes, either update results via retractions or store them in a side output for later reconciliation.

4. Design Serving and Storage Layer

Use a low-latency store (e.g., Redis, Cassandra) to serve aggregated counts, ensuring it supports upserts for late updates. Consider a lambda architecture with a batch layer for eventual consistency if needed.

5. Discuss Trade-offs and Optimizations

Explain trade-offs between latency, accuracy, and cost. Mention techniques like incremental aggregation, state management, and backpressure handling to ensure scalability.

Key Points to Mention

  • Event-time vs processing-time semantics and why event-time is crucial for out-of-order events
  • Watermarks and allowed lateness to bound state and handle late data
  • Exactly-once or at-least-once processing guarantees and idempotent updates
  • Use of a distributed log (Kafka) for durability and replayability
  • Serving layer design for low-latency reads and support for upserts
  • Trade-offs between accuracy and latency (e.g., early results vs final results)

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

Q2

Follow-up: How would you handle very high write throughput to the storage layer?

System DesignTechnical Trade-offs
Author's notes

Talked about write buffering, batching inserts, and using something like a columnar store or pre-aggregated counters to avoid row-level contention.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the workload characteristics (write volume, read/write ratio, latency requirements, consistency needs) and then propose a layered architecture that scales writes horizontally. Discuss specific techniques like sharding, LSM-tree-based storage engines, and write-optimized data structures, while addressing trade-offs such as read amplification and consistency.

Pro tip: Emphasize that high write throughput often requires sacrificing read performance or strong consistency; explicitly state which trade-off you'd choose and why, showing you understand the business context. Also, mention monitoring and backpressure mechanisms to handle bursts gracefully.

1. Clarify Requirements and Constraints

Ask about write volume (e.g., writes per second), data size, read/write ratio, latency SLAs, consistency requirements, and durability guarantees. This ensures your solution is tailored to the actual problem.

2. Choose a Write-Optimized Storage Engine

Propose using LSM-tree based stores (e.g., RocksDB, Cassandra) that batch writes in memory and flush sequentially to disk, avoiding random I/O. Alternatively, consider append-only logs or write-ahead logging for durability.

3. Scale Horizontally with Sharding/Partitioning

Partition data across multiple nodes based on a shard key to distribute write load. Discuss strategies like consistent hashing, range partitioning, and handling hotspots.

4. Optimize Write Path and Batching

Use techniques like write batching, asynchronous replication, and in-memory buffers to reduce per-write overhead. Consider compression and columnar formats for efficiency.

5. Address Trade-offs and Failure Handling

Discuss trade-offs: higher write throughput may increase read latency, reduce consistency, or complicate compaction. Explain how to handle failures with replication, quorum writes, and backpressure.

Key Points to Mention

  • LSM-trees and write-optimized data structures (e.g., memtables, SSTables)
  • Sharding/partitioning strategies and hotspot mitigation
  • Write batching, asynchronous I/O, and append-only logs
  • Trade-offs between write throughput, read latency, and consistency (e.g., eventual consistency)
  • Compaction strategies and their impact on performance
  • Backpressure and monitoring to handle write bursts and prevent overload

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