Design Fleet-Wide Latency Percentile Aggregation Across Thousands of Servers
Last updated: November 29, 2026
Quick Overview
Design how a monitoring system computes accurate p50, p99 and p99.9 request latency for a service running on 20,000 tasks, at one-minute resolution, without shipping every individual request latency to a central store.
0
0
0 solved
Design how a monitoring system computes accurate p50, p99 and p99.9 request latency for a service running on 20,000 tasks, at one-minute resolution, without shipping every individual request latency to a central store.
A focused Google onsite question that hides a common mistake: averaging per-server percentiles is wrong. The interviewer checks whether a candidate knows mergeable summaries (histograms, t-digest, DDSketch), their error guarantees, and how bucket design affects tail accuracy.
What the Interviewer Expects
- State clearly why percentiles of percentiles are incorrect
- Propose a mergeable summary with bounded error
- Choose bucket layout (exponential) and quantify relative error
- Describe the collection and merge path from tasks to dashboard
- Discuss memory and network cost per task
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- What relative error does a log-bucket histogram with growth factor 1.1 give?
- How would you compute p99.9 over a full day from minute data?
- When would you prefer t-digest over fixed buckets?
- How do you handle latency values outside the bucket range?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: per service, method and cluster, compute latency quantiles each minute, and over arbitrary windows (1 hour, 1 day) and groupings (all clusters).
Non-functional: relative error und...
High-Level Design
- In-task recorder: each RPC adds its latency to an in-memory histogram for its (method, status) key.
- Export: every 10 seconds tasks export bucket counts as a distribution-typed metric.
- **...