Skip to main content

Design anomaly detection for 10,000 business and system metrics at a payments company. Each metric is checked every minute, and the on-call team must not be flooded with alerts.

System design · Pro 1

Short answer

Clarify which metrics matter and what a missed incident costs against a false alert. Then: ingest metrics as time series, model each one's expected value with seasonality, score the deviation, require it to persist, group related alerts into one incident, rank by business impact, collect feedback from on-call engineers, and measure precision and detection delay.

Deeper answer

The team wants to catch real incidents quickly, such as a fall in payment success rate, without many false alerts. With 10,000 metrics checked each minute, even a tiny false positive rate per check produces many alerts a day, so alert volume is the central constraint.

Design: metrics arrive on a stream into a time series store. For each metric, a model predicts the expected value and a normal band, using daily and weekly seasonality and known events such as holidays. Simple methods, such as a seasonal baseline with a robust deviation measure scale well. An anomaly must persist for a few minutes before it alerts. A grouping step then merges anomalies that share a service or region into one incident and ranks it by business impact.

Labels are few. Use past incidents and on-call feedback on each alert as labels to tune thresholds. Evaluate by replaying history: precision, recall on known incidents and time to detect.

Trade-offs: sensitive thresholds detect sooner but page more. At scale, the first problems are alert fatigue, missing data treated as an anomaly, and models that learn an ongoing incident as normal.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

Monitoring and drift

Practice System design questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.