← Meta Interview Insights

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

Senior
Jun 2026

Summary

Meta system design round for a software engineer role, focused entirely on building an ads impression aggregation service. The question had a lot of moving parts and the follow-up on write throughput pushed into territory I wasn't fully prepared for.

Questions Asked (3)

Q1

Design an ads impression aggregator service that ingests high-volume impression events and serves per-ad hourly counts via an API.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the ingestion pipeline since that felt most concrete: ad servers pushing into Kafka, a stream processor doing windowed aggregation by ad and hour, then writing into something like Cassandra keyed on that pair.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: event volume, latency, accuracy, and query patterns. Then propose a scalable architecture with a high-throughput ingestion pipeline, a windowed aggregation layer, and a low-latency serving store. Discuss trade-offs between batch and stream processing, and how to handle late data and exactly-once semantics.

Pro tip: Emphasize the importance of idempotency and deduplication in the ingestion pipeline to avoid overcounting, and suggest using a lambda or kappa architecture to balance real-time and batch processing needs.

1. Clarify Requirements

Ask about event volume, required latency for API responses, accuracy guarantees, and query patterns (e.g., per-ad hourly counts).

2. High-Level Architecture

Propose a pipeline: ingestion (e.g., Kafka), stream processing (e.g., Flink/Spark Streaming), storage (e.g., Cassandra/Bigtable), and serving layer (e.g., Redis).

3. Data Modeling and Aggregation

Design keys for per-ad hourly counts, handle windowing, and decide on pre-aggregation vs. on-the-fly aggregation.

4. Scalability and Fault Tolerance

Discuss partitioning, replication, backpressure, and exactly-once processing to handle high volume and failures.

5. Trade-offs and Optimizations

Compare batch vs. stream, discuss late data handling, and propose caching or materialized views for low-latency reads.

Key Points to Mention

  • Use of a distributed message queue (e.g., Kafka) for durable, high-throughput ingestion.
  • Stream processing with windowing (e.g., tumbling windows) to compute hourly counts.
  • Idempotent writes and deduplication to ensure exactly-once semantics.
  • Choice of storage: time-series DB or wide-column store for scalability.
  • Serving layer with caching (e.g., Redis) for low-latency API responses.
  • Handling late-arriving events with watermarks or allowed lateness.

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

Q2

How do you handle duplicate and out-of-order impression events in the ingestion pipeline?

System DesignTechnical Trade-offs
Author's notes

Talked about watermarks and a look-back window for late arrivals, which landed okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the ingestion pipeline, such as data volume, latency tolerance, and exactly-once semantics. Then, propose a robust strategy that combines deduplication using unique event IDs with windowing and watermarking to handle out-of-order events. Finally, discuss trade-offs between different approaches and how to monitor and handle late data.

Pro tip: Mention that you would use a combination of event-time processing and idempotent writes to downstream systems, and highlight the importance of defining a clear late-data policy based on business impact.

1. Clarify Requirements

Ask about data volume, latency requirements, and the cost of duplicates or missing data to understand the problem scope.

2. Deduplicate with Unique IDs

Use a unique event ID (e.g., UUID) and maintain a deduplication store (e.g., Redis, Bloom filter) to filter duplicates within a time window.

3. Handle Out-of-Order with Event Time

Process events based on event time rather than ingestion time, using watermarks and allowed lateness to handle out-of-order events.

4. Ensure Idempotent Writes

Design downstream systems to be idempotent, so that duplicate processing doesn't cause incorrect results.

5. Monitor and Adapt

Monitor metrics like duplicate rate and late event rate, and adjust window sizes or deduplication TTL based on observed patterns.

Key Points to Mention

  • Event time vs. processing time
  • Watermarks and allowed lateness
  • Deduplication techniques (e.g., unique IDs, Bloom filters)
  • Idempotent writes and exactly-once semantics
  • Trade-offs between latency, cost, and accuracy
  • Monitoring and alerting for duplicates and late data

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

Q3

How would you handle very high write throughput to the database from the stream processor?

System DesignTechnical Trade-offs
Author's notes

This is where the interview got harder.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., writes per second, latency, durability). Then propose a layered architecture: buffer writes using a message queue, batch them, and use a write-optimized database (e.g., Cassandra, ScyllaDB) with partitioning and replication. Discuss trade-offs between consistency, latency, and throughput, and mention monitoring and backpressure mechanisms.

Pro tip: Emphasize that you would first measure and understand the current bottleneck before optimizing, and that you'd design for failure—e.g., using idempotent writes and dead-letter queues to handle retries without data loss.

1. Clarify requirements and constraints

Ask about expected write volume (e.g., millions per second), latency SLAs, data durability, and consistency needs. This shapes the entire design.

2. Decouple ingestion from persistence

Introduce a durable message queue (e.g., Kafka) between the stream processor and the database to absorb bursts and allow the database to consume at its own pace.

3. Optimize database writes

Use batching, asynchronous writes, and a write-optimized datastore (e.g., LSM-tree based like Cassandra). Partition data to distribute load and consider denormalization for write efficiency.

4. Implement backpressure and monitoring

Add backpressure to slow down producers if the database is overwhelmed. Monitor key metrics (write latency, queue depth) and set up alerts.

5. Discuss trade-offs and alternatives

Compare consistency vs. availability, SQL vs. NoSQL, and cost implications. Mention potential fallbacks like writing to a log first or using a write-behind cache.

Key Points to Mention

  • Batching and asynchronous writes to reduce per-write overhead
  • Partitioning/sharding to distribute write load across nodes
  • Using a write-optimized database (e.g., Cassandra, ScyllaDB, or LSM-tree based)
  • Message queue for buffering and decoupling (e.g., Kafka, Pulsar)
  • Backpressure mechanisms to prevent overload
  • Idempotency and exactly-once semantics to handle retries

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