← Meta Interview Insights

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

Senior
Jul 2026

Summary

System design round at Meta for a software engineer role. The problem was building an ad metrics backend from scratch, covering ingestion, aggregation, and query support at scale. Pretty meaty question with a lot of moving parts.

Questions Asked (1)

Q1

Design a backend service that ingests high-volume ad impression and click events and serves both near-real-time and historical aggregated metrics, with support for duplicate and late-arriving events.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the data model and event schema which felt safe, but I spent too long there and had to rush through the streaming pipeline.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a pipeline that separates ingestion, processing, and serving layers. Use a streaming path for near-real-time metrics and a batch path for historical accuracy, with idempotent writes and windowing to handle duplicates and late data.

Pro tip: Explicitly discuss trade-offs between latency, cost, and accuracy, and propose a lambda or kappa architecture with a unified data model to avoid divergence between real-time and batch views.

1. Clarify Requirements and Scale

Ask about event volume, required latency for real-time metrics, historical retention, and query patterns. Establish consistency and accuracy expectations.

2. Design Ingestion Layer

Propose a scalable, durable message queue (e.g., Kafka) to buffer events. Ensure events have unique IDs and timestamps for deduplication and ordering.

3. Design Processing Layer

Use stream processing (e.g., Flink) for near-real-time aggregations with windowing and watermarks to handle late data. Use batch processing (e.g., Spark) for historical aggregations and reprocessing.

4. Design Serving Layer

Store real-time aggregates in a low-latency store (e.g., Redis, Druid) and historical aggregates in a scalable OLAP store (e.g., ClickHouse, BigQuery). Support queries that merge both.

5. Address Duplicates and Late Events

Implement idempotent writes using unique event IDs, and use event-time processing with allowed lateness. Reconcile real-time and batch views periodically.

Key Points to Mention

  • Idempotency and deduplication using unique event IDs
  • Event-time vs processing-time and watermarking for late data
  • Lambda vs Kappa architecture trade-offs
  • Windowing strategies (tumbling, sliding, session) for aggregations
  • Storage choices for real-time (e.g., Druid, Pinot) vs historical (e.g., BigQuery, Snowflake)
  • Exactly-once semantics and reconciliation between streaming and batch

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