Design a metrics and monitoring system (like Datadog)
Customers install our agent on each server, and it sends CPU, memory, request counts and latencies, which customers chart on dashboards and watch with monitors that page their on-call engineers. We assume a point every 10 seconds; Datadog's own agent collects every 15 seconds by default. It's an alarm company's control room for thousands of buildings, which must still ring when its own wiring is what's failing.
It's also asked as "design Datadog". The closest case study is the Ad click aggregator, which also counts events in windows, but where every event is money. Interviewers like it because the writes never stop, one deploy can multiply the series count, and alerts must work exactly when everything else fails. Time-series databases teaches the storage engine; this page runs it for thousands of customers.
Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.
Step 1 · Clarify the features and cut the scope
Minutes 0–5 · How this step works
Interviewer: Design a metrics and monitoring system like Datadog.
You: Do agents push to us, or do we pull from customers' servers?
Interviewer: Agents push. Customers' servers sit behind their firewalls.
You: Gauges, counters and latency distributions? And monitors on thresholds, rates of change and "no data from this host"?
Interviewer: All of those, notifying by page, chat or email.
You: How long is data kept, and are logs and traces in?
Interviewer: Fifteen months, like Datadog. Logs and traces are out.
You: Then I'll cover ingest, storage, dashboard queries, rollups for long ranges, and monitors with their notifications, for many customers on one shared system. Out: logs, traces, anomaly models and billing. OK?
Interviewer: Go ahead.
Each answer shapes the design: pushing agents retry, distributions need values that merge, 15 months needs rollups, and "no data" must tell a silent host from a slow pipeline.
Step 2 · Non-functional requirements
Minutes 5–8 · How this step works
You: Say 10,000 customers with 100 million active series between them, each sending a point every 10 seconds: 10 million points a second, all day (assumptions). A point shows on dashboards within 15 seconds of the agent sending it. Dashboard panels answer within a second at p99 for ranges up to a day, and within 3 seconds for 15 months. Every monitor is evaluated every minute and pages within ~75 seconds of its condition holding for its full window. An acknowledged point is never lost, except new series past a customer's limit and points over two hours late, which are counted and reported to her. Alerting survives a lost zone, a slow pipeline or a slow store, and never pages falsely because our data is late.