Phase 1 — Clarify & Scope
Interviewer: Design a metrics monitoring and alerting system — think Datadog, Prometheus, or a large-scale internal observability platform. What do you want to clarify first?
Candidate: A few questions to nail the scope:
- What are we ingesting — infrastructure metrics (CPU, memory), application metrics (request latency, error rate), or both?
- What's the write volume — how many metrics/second?
- Query patterns: real-time dashboards, alerting, or long-term trend analysis?
- Retention requirements — 15 days, 1 year, multiple years with downsampling?
- Alerting: threshold-based, anomaly detection, SLA breach?
Interviewer: Infrastructure + application metrics. 10,000 hosts each emitting 100 metrics every 15 seconds. Real-time dashboards and alerting — latency under 5 seconds. Retain raw data for 15 days, downsampled for 1 year.
Candidate: Let me size this:
At Gorilla compression (~1.37 bytes/sample average), that's:
Long-term with 5-minute downsampling (from 15-second raw):
Interviewer: Good math. What are the core functional requirements?
Candidate:
- Collect time-series metrics from agents on every host
- Store time-series data with configurable retention
- Query metrics…
In the full tutorial
- Phase 2 — High-Level Architecture
- Phase 3 — Deep Dive & Evolution
- Phase 4 — Robustness & Operations