← Meta Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

System design round at Meta for a software engineering role. The whole session was basically one big question about building an ad-click aggregation pipeline, and they went pretty deep on every layer of it.

Questions Asked (9)

Q1

Design a real-time ad-click aggregation pipeline that supports per-ad, per-advertiser, and per-geo aggregations over multiple time windows (1 minute, 1 hour, 1 day), with click deduplication and support for late-arriving events.

System DesignTechnical Trade-offsData Modeling
Author's notes

This was the whole interview, basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a streaming architecture with a message queue, stream processor, and a multi-tier storage layer for real-time and batch aggregations. Emphasize deduplication via idempotent processing and late-event handling using watermarks and allowed lateness. Discuss trade-offs between latency, accuracy, and cost.

Pro tip: Meta values data quality and freshness; explicitly discuss how you'd monitor and alert on deduplication rates and late-event volumes, and how you'd backfill or reconcile with batch pipelines to ensure consistency.

1. Clarify Requirements and Scale

Ask about expected QPS, number of ads/advertisers/geos, acceptable latency for each window, and consistency requirements. This shapes technology choices and partitioning strategy.

2. Design Ingestion and Deduplication

Propose a scalable message queue (e.g., Kafka) for click events. Implement deduplication using a unique click ID and a fast lookup store (e.g., Redis or RocksDB) with TTL, or leverage exactly-once semantics in the stream processor.

3. Stream Processing and Windowing

Use a stream processor (e.g., Flink) to compute aggregations over tumbling or sliding windows. Handle late events with watermarks and allowed lateness, emitting early results and updating them as late data arrives.

4. Storage and Serving Layer

Store real-time aggregates in a low-latency store (e.g., Redis, Cassandra) for serving. For longer windows (1 day), use a scalable OLAP store (e.g., Druid, ClickHouse) or batch processing with periodic updates.

5. Trade-offs and Scalability

Discuss trade-offs: exactly-once vs at-least-once, latency vs accuracy, cost of stateful processing. Explain partitioning by ad/advertiser/geo to scale horizontally and how to handle hotspots.

Key Points to Mention

  • Deduplication strategies: unique click ID, idempotent processing, and TTL-based caches.
  • Late-arriving events: watermarks, allowed lateness, and updating aggregates.
  • Multi-window aggregation: tumbling vs sliding windows, and hierarchical aggregation (1-min to 1-hour to 1-day).
  • Scalability: partitioning by ad/advertiser/geo, and handling hotspots.
  • Storage choices: real-time stores (Redis, Cassandra) vs analytical stores (Druid, ClickHouse) and batch reconciliation.
  • Trade-offs: latency vs accuracy, cost, and complexity of exactly-once semantics.

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

Q2

Walk through your non-functional requirements. How do you handle millions of QPS with low end-to-end latency, and what consistency guarantees are you targeting?

System DesignTechnical Trade-offs
Author's notes

I went with at-least-once plus idempotent aggregation rather than exactly-once because exactly-once in distributed stream processing has real overhead and I didn't think the use case needed it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and constraints, then systematically walk through each non-functional requirement (latency, throughput, consistency, availability, durability, cost) and how they interact. For millions of QPS with low latency, describe a layered architecture with caching, sharding, and async processing, and explicitly state the consistency model (e.g., eventual consistency with read-your-writes) and trade-offs. Conclude by tying choices back to business impact and how you'd measure and iterate.

Pro tip: Quantify everything: give concrete numbers for latency targets (e.g., p99 < 100ms), QPS per node, and consistency SLAs. This shows you think in terms of measurable SLOs, not vague ideals—exactly what Meta expects.

1. Clarify requirements and scale

Ask questions to understand the workload: read/write ratio, data size, geographic distribution, and what 'low latency' means (p50 vs p99). Confirm the QPS target and any consistency requirements from the business.

2. Define non-functional requirements (NFRs)

List the key NFRs: latency, throughput, consistency, availability, durability, scalability, and cost. Explain how they conflict (e.g., strong consistency vs low latency) and which are most critical for this system.

3. Architect for high QPS and low latency

Describe techniques: horizontal scaling with sharding, caching (CDN, in-memory), async processing, batching, and load balancing. Mention specific technologies (e.g., Memcached, Kafka, Thrift) and how they reduce latency.

4. Choose consistency model and trade-offs

State the consistency guarantees you target (e.g., eventual consistency, read-your-writes, monotonic reads) and justify why they meet business needs. Explain how you'd implement them (e.g., quorum reads/writes, versioning).

5. Monitor, measure, and iterate

Explain how you'd track SLOs with metrics (p99 latency, error rates, QPS) and use them to drive improvements. Mention capacity planning and failure testing to ensure resilience.

Key Points to Mention

  • Latency targets: p50 vs p99, tail latency, and how to achieve them (e.g., hedged requests, caching).
  • Horizontal scaling: sharding, partitioning, and consistent hashing to distribute load.
  • Caching strategies: CDN, edge caching, in-memory caches, and cache invalidation.
  • Consistency models: eventual consistency, strong consistency, read-your-writes, and their trade-offs with latency and availability.
  • Asynchronous processing: message queues (Kafka), batch writes, and decoupling to handle spikes.
  • Monitoring and SLOs: defining SLIs, alerting, and using data to iterate on performance.

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

Q3

How would you design the ingestion path from the client click event all the way into your stream processor?

System DesignAPI & Integrations
Author's notes

CDN or edge collection, then into Kafka with partitioning by ad ID.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, latency, reliability) and then walk through the end-to-end pipeline: client-side event capture, transport to the backend, ingestion layer, and finally the stream processor. Emphasize trade-offs at each stage, such as batching vs. low latency, and how you ensure data integrity and exactly-once processing.

Pro tip: Show awareness of Meta's scale by discussing how to handle millions of events per second and the importance of backpressure and idempotency to avoid data loss or duplication.

1. Clarify Requirements and Constraints

Ask about expected event volume, latency requirements, data loss tolerance, and processing guarantees (at-least-once vs. exactly-once). This sets the stage for design decisions.

2. Client-Side Event Capture and Batching

Describe how the click event is captured on the client (e.g., JavaScript SDK), enriched with metadata, and batched to reduce network overhead. Mention using sendBeacon or WebSocket for reliable delivery.

3. Transport and Ingestion Layer

Explain how events are sent to an ingestion endpoint (e.g., HTTP API, load balancer) and then to a durable, scalable message queue like Kafka or Meta's equivalent (e.g., Scribe). Discuss partitioning and replication for fault tolerance.

4. Stream Processing and Downstream Integration

Detail how the stream processor (e.g., Flink, Spark Streaming) consumes from the queue, performs transformations, windowing, and aggregations, and writes to sinks (e.g., data warehouse, real-time dashboards).

5. Reliability, Monitoring, and Scaling

Cover mechanisms for exactly-once processing (idempotent writes, checkpoints), backpressure handling, and monitoring (latency, throughput, error rates). Discuss auto-scaling of ingestion and processing layers.

Key Points to Mention

  • Client-side batching and compression to reduce network calls and improve efficiency.
  • Use of a distributed message queue (e.g., Kafka) for durability, scalability, and decoupling.
  • Partitioning strategy (e.g., by user ID or event type) to ensure ordered processing and parallelism.
  • Exactly-once semantics via idempotent producers/consumers and transactional writes.
  • Backpressure and load shedding to handle traffic spikes without overwhelming the system.
  • Monitoring and alerting on end-to-end latency, throughput, and error rates.

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

Q4

How would you implement the stream processing layer, specifically around windowing strategies and watermark handling?

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

I went with Flink and talked through tumbling windows for the 1m/1h/1d aggregates and briefly mentioned sliding windows for smoother rollups.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the use case and requirements (e.g., event time vs processing time, latency, accuracy, scale). Then propose a stream processing architecture (e.g., using Flink, Kafka Streams, or Beam) and detail windowing strategies (tumbling, sliding, session) and watermark mechanisms (periodic, punctuated, allowed lateness). Finally, discuss trade-offs and how you'd handle late data and ensure correctness.

Pro tip: Emphasize that watermarks are a heuristic for event-time completeness, not a guarantee; always pair them with allowed lateness and a side output for late data to balance correctness and latency.

1. Clarify Requirements

Ask about data characteristics (event time vs processing time, out-of-order events), latency/accuracy trade-offs, and scale. This shapes windowing and watermark choices.

2. Choose Windowing Strategy

Select appropriate window types (tumbling, sliding, session) based on the use case. Explain how each handles event grouping and triggers.

3. Design Watermark Handling

Describe how watermarks are generated (periodic or punctuated) and propagated. Discuss how they trigger window evaluation and handle late data.

4. Address Late Data and Correctness

Explain mechanisms for late data: allowed lateness, side outputs, and reprocessing. Discuss how to maintain correctness (e.g., exactly-once semantics).

5. Discuss Trade-offs and Optimizations

Compare latency vs completeness, watermark heuristics, and resource usage. Mention optimizations like incremental aggregation and state management.

Key Points to Mention

  • Event time vs processing time and their impact on windowing and watermarks
  • Types of windows: tumbling, sliding, session, and global windows with triggers
  • Watermark generation strategies: periodic, punctuated, and idle source handling
  • Handling late data: allowed lateness, side outputs, and reprocessing
  • Trade-offs between latency, accuracy, and resource consumption
  • Fault tolerance and exactly-once semantics in stream processing

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

Q5

What storage layer would you use for ad-hoc analytics queries on top of the aggregated data, and why?

System DesignTechnical Trade-offsData Modeling
Author's notes

Said an OLAP store, something like Druid or ClickHouse, for the ad-hoc query path.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: query patterns, data volume, latency expectations, and cost constraints. Then propose a columnar OLAP storage layer (e.g., Presto/Trino on Hive/Parquet, or a specialized engine like Druid/ClickHouse) and justify it by contrasting with row-based OLTP stores. Finally, discuss trade-offs around performance, cost, and operational complexity, and how it integrates with Meta's data ecosystem.

Pro tip: Mention that ad-hoc analytics often benefit from a two-tier approach: a hot layer (e.g., Druid) for sub-second dashboards and a warm layer (e.g., Presto on Parquet) for flexible, deep queries, balancing cost and performance.

1. Clarify Requirements

Ask about query complexity, concurrency, data freshness, and SLA to understand if the workload is interactive or batch-oriented.

2. Evaluate Storage Options

Compare columnar stores (Parquet/ORC on HDFS/S3), OLAP engines (ClickHouse, Druid), and data warehouses (Snowflake, BigQuery) based on scan efficiency, compression, and indexing.

3. Consider Integration and Ecosystem

Assess how the storage layer fits with existing data pipelines, metadata catalogs, and query engines like Presto/Spark at Meta.

4. Discuss Trade-offs

Weigh performance vs. cost, flexibility vs. optimization, and operational overhead vs. managed services.

5. Propose a Solution

Recommend a specific storage layer (e.g., Presto on Parquet) and explain why it meets the requirements, mentioning alternatives if needed.

Key Points to Mention

  • Columnar storage formats (Parquet, ORC) for efficient scans and compression
  • OLAP engines like Presto/Trino, ClickHouse, or Druid for fast aggregations
  • Separation of storage and compute for scalability and cost efficiency
  • Data partitioning and bucketing to prune data during queries
  • Caching and materialized views to accelerate frequent queries
  • Integration with Meta's data infrastructure (e.g., Hive metastore, Spark)

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

Q6

How would you handle the split between a hot real-time path and a cold batch path, and when would you revert to the batch results?

System DesignTechnical Trade-offs
Author's notes

Lambda architecture basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the use case and requirements (latency, accuracy, consistency) to justify the need for dual paths. Then describe the architecture: a hot path for low-latency approximate results and a cold path for accurate batch processing, and explain how you reconcile them, including when to fall back to batch results. Emphasize trade-offs and monitoring.

Pro tip: Mention that the hot path should be designed to degrade gracefully and that batch results serve as the source of truth for reconciliation and backfilling, not just as a fallback. This shows you understand both real-time and batch systems deeply.

1. Clarify Requirements

Ask about latency, accuracy, consistency, and scale requirements to determine if a dual-path approach is necessary and what trade-offs are acceptable.

2. Design Hot Path

Describe a low-latency, approximate real-time pipeline (e.g., stream processing with Kafka, Flink) that provides quick but potentially less accurate results.

3. Design Cold Path

Outline a batch processing system (e.g., Hadoop, Spark) that computes accurate results over historical data, often with higher latency.

4. Reconciliation and Fallback

Explain how to reconcile discrepancies between hot and cold paths, and when to revert to batch results (e.g., when hot path confidence is low, on system failures, or for critical decisions).

5. Monitoring and Iteration

Discuss monitoring metrics (latency, accuracy, drift) and how to iterate on the system to improve both paths over time.

Key Points to Mention

  • Lambda architecture vs. Kappa architecture and their trade-offs
  • Eventual consistency and how to handle it in the hot path
  • Use of a serving layer to merge results from hot and cold paths
  • Fallback strategies: when to use batch results (e.g., data quality issues, system outages, or for auditing)
  • Monitoring and alerting for discrepancies between paths
  • Cost and complexity trade-offs of maintaining two paths

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

Q7

How would you filter out fraudulent or invalid clicks in this pipeline?

System DesignTechnical Trade-offs
Author's notes

I put fraud filtering early in the pipeline, right after ingestion, using a combination of rule-based filters (same IP clicking the same ad repeatedly within a window) and a flag from an async ML scoring service.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the pipeline context and requirements, then propose a multi-layered filtering approach combining real-time and batch processing. Discuss specific techniques like rule-based filters, ML models, and graph analysis, and explain how to balance accuracy, latency, and scalability.

Pro tip: Emphasize that fraud detection is an adversarial problem, so you need continuous monitoring and adaptation. Mention the importance of feedback loops and human review for edge cases.

1. Clarify Requirements and Context

Ask about the pipeline's purpose, data volume, latency requirements, and what constitutes a fraudulent click. Understand the scale and business impact.

2. Design a Multi-Layered Filtering System

Propose a combination of real-time and batch processing layers: simple rules for immediate filtering, ML models for probabilistic scoring, and graph-based analysis for coordinated fraud.

3. Detail Specific Techniques

Explain rule-based filters (e.g., IP blacklists, click frequency), ML models (e.g., logistic regression, random forests, neural networks), and graph algorithms (e.g., connected components, PageRank) to detect anomalies.

4. Address Trade-offs and Scalability

Discuss trade-offs between precision and recall, latency vs. accuracy, and how to scale using distributed systems (e.g., Kafka, Flink, Spark). Mention monitoring and alerting.

5. Implement Feedback and Adaptation

Describe how to incorporate feedback from human reviewers and adapt models over time to counter evolving fraud tactics. Suggest A/B testing and continuous evaluation.

Key Points to Mention

  • Real-time vs. batch processing: use streaming for immediate blocking and batch for deeper analysis.
  • Feature engineering: IP reputation, user agent, click timestamps, session patterns, device fingerprints.
  • Machine learning models: supervised (if labeled data) and unsupervised (anomaly detection) approaches.
  • Graph analysis: detect botnets and coordinated fraud by analyzing relationships between clicks, users, and IPs.
  • Trade-offs: false positives vs. false negatives, latency constraints, and cost of computation.
  • Monitoring and adaptation: track model performance, set up alerts, and retrain models regularly.

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

Q8

How do you handle schema evolution in the event stream over time?

System DesignAPI & Integrations
Author's notes

Schema registry with backward compatibility enforcement.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that schema evolution is inevitable in event-driven systems and that the approach depends on compatibility requirements and consumer needs. Then outline a strategy that balances backward/forward compatibility, schema registry usage, and versioning, while addressing migration and deprecation. Conclude with trade-offs and how you'd handle breaking changes.

Pro tip: Emphasize that you design for evolution from day one by using a schema registry and enforcing compatibility checks in CI/CD, and mention that you always consider the consumer's ability to handle unknown fields (e.g., via tolerant readers).

1. Clarify requirements and constraints

Ask about the event streaming platform (Kafka, Pulsar, etc.), consumer types (real-time, batch), and compatibility guarantees needed (backward, forward, full).

2. Choose a schema management strategy

Discuss using a schema registry (e.g., Confluent Schema Registry) with Avro, Protobuf, or JSON Schema, and define compatibility rules (e.g., backward compatible by default).

3. Apply evolution patterns

Explain techniques like adding optional fields with defaults, avoiding deletions/renames, using union types for new variants, and versioning via subject name strategies.

4. Handle breaking changes and migrations

Describe how to manage breaking changes: dual-write to new topic, use a new schema version with a migration period, and coordinate consumer upgrades.

5. Monitor and enforce governance

Mention setting up CI/CD checks for schema compatibility, monitoring consumer lag/errors, and having a deprecation policy for old schemas.

Key Points to Mention

  • Schema registry and compatibility types (backward, forward, full, none)
  • Avro/Protobuf/JSON Schema and their evolution capabilities
  • Techniques: optional fields, default values, union types, no renames/deletions
  • Versioning strategies: topic per version, schema ID in message, subject naming
  • Consumer tolerance: ignoring unknown fields, handling missing fields gracefully
  • Migration patterns: dual-write, shadow topics, consumer-driven contracts

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

Q9

Do a rough capacity estimation for this system given millions of QPS.

System DesignTechnical Trade-offs
Author's notes

I blanked for a second on the exact numbers and kind of worked backwards from 'let's say 5 million clicks per second' which is probably high but I wanted to stress-test the design.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's scope and assumptions (e.g., read/write ratio, payload size, storage duration). Then break down the QPS into components like requests per second, bandwidth, storage, and compute, using round numbers and powers of ten for quick mental math. Finally, validate the estimates against known benchmarks and discuss trade-offs or bottlenecks.

Pro tip: Always state your assumptions explicitly and use powers of ten to simplify calculations; interviewers care more about your reasoning process than exact numbers.

1. Clarify requirements and assumptions

Ask questions to understand the system's functionality, expected read/write ratio, average request/response size, data retention period, and any peak-to-average traffic ratio.

2. Estimate QPS and peak QPS

Given 'millions of QPS', assume a specific number (e.g., 5 million QPS) and break it down into reads and writes based on the ratio. Calculate peak QPS by applying a peak factor (e.g., 2-3x).

3. Calculate bandwidth and storage

Multiply QPS by average request/response size to get bandwidth (e.g., Mbps/Gbps). For storage, multiply write QPS by average data size and retention period to estimate total storage needed.

4. Estimate compute and memory

Determine the number of servers needed based on per-server capacity (e.g., 10k QPS per server). Estimate memory requirements for caching (e.g., 20% of daily reads) and database working set.

5. Validate and discuss trade-offs

Sanity-check numbers against known systems (e.g., Google, Facebook). Discuss bottlenecks (e.g., database, network) and potential optimizations like sharding, caching, or CDN.

Key Points to Mention

  • Assumptions: read/write ratio, payload size, retention period, peak factor
  • Powers of ten for quick mental math (e.g., 1 million QPS = 10^6)
  • Bandwidth calculation: QPS * average request size
  • Storage calculation: write QPS * data size * retention time
  • Server count estimation: total QPS / per-server capacity
  • Caching and CDN to reduce backend load
  • Database sharding and replication for scalability
  • Trade-offs between consistency, latency, and cost

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