Design a Metrics and Monitoring System
Design a monitoring system like Datadog or Prometheus for a company with 50,000 servers: collect metrics, store them, draw dashboards, and fire alerts. Plan for 10M data points per second and queries over the last 15 months.
How the interview goes
Five phases, and questions the interviewer is likely to ask in each.
1. Requirements
- What resolution is needed for last hour versus last year?
- How quickly must an alert fire?
Show a hintHint
Estimate active series, not just points per second.
2. High-level design
- What sits between agents and storage?
- How is a query for 'p99 latency by region' answered?
Show a hintHint
Absorb spikes between the agents and storage.
3. Deep dive
- How do you compress timestamps and values?
- What happens when someone adds a request_id tag?
Show a hintHint
Consecutive points in a series are similar, which compresses very well.
4. Scaling
- How do you shard writes and still query across shards?
- How do you handle a burst after a network partition heals?
Show a hintHint
Old data rarely needs per-second resolution.
5. Trade-offs
- Push versus pull collection?
- Precompute rollups or compute at query time?
Show a hintHint
Alerts and dashboards have different reliability needs.
Practice this with an AI interviewer
Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.
Start this interview