Design Percentile Latency Rollups for Service Health Dashboards

Last updated: November 29, 2026

Quick Overview

Design the aggregation layer that turns per-request latency measurements from thousands of hosts into p50, p99, and p99.9 per service, endpoint, and region, queryable over minutes to months.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the aggregation layer that turns per-request latency measurements from thousands of hosts into p50, p99, and p99.9 per service, endpoint, and region, queryable over minutes to months.

Meta's monitoring stack needs accurate tail latency at massive scale, and naive approaches either cost too much or produce wrong numbers. The interviewer wants to hear why you cannot average percentiles and how mergeable histograms or sketches fix that.

What the Interviewer Expects
  • Explain why percentiles of percentiles are wrong
  • Choose a mergeable histogram or sketch representation
  • Aggregate at host, then cluster, then global
  • Downsample over time while keeping mergeability
  • Control cardinality of labels
Key Topics to Cover
Histograms
Sketches
Rollups
Cardinality
Downsampling
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How accurate is your p99.9 and how does that depend on bucket layout?
  • What happens when someone adds a user_id label?
  • How would you compute the percentage of requests over 200 ms?
  • How do you store a year of data cheaply?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: query latency{service, endpoint, region} percentiles at 1 minute resolution for 2 weeks, 1 hour for a year; also "fraction of requests over X ms" for SLOs.

Non-functional: milli...

High-Level Design
  • In-process client records each request into a local histogram keyed by label set.
  • Every 10 seconds the host flushes histograms to an aggregator tier sharded by label set hash.
  • Aggregator...

Submit Your Answer
Markdown supported