← Questions

Design automated anomaly detection and remediation for cloud services

0
GoogleAI/ML designLast asked Sep 2025

An AI/ML design interview question asked in Google's first round (coding), last asked Sep 2025. It tests anomaly detection, observability and automation.

Design a monitoring service for cloud applications that collects telemetry, sends it to an AI-based analyser, and acts on its findings automatically, for example by shutting down an instance or isolating it from the network. Define data ingestion, model serving, how rules and model outputs are combined, how actions are orchestrated, the safety checks before acting, audit logs and rollback. Address support for several cloud providers, scale, and noisy alerts.

Requirements

  • Functional: ingest metrics, logs, traces and security events from many applications across clouds; detect anomalies and likely incidents; decide on an action (notify, restart, scale, roll back, isolate, shut down); carry it out through each provider's API; record why and allow undo.
  • Non-functional: detection within minutes for serious issues; a very low rate of harmful automatic actions; every action traceable to its evidence and policy; the system keeps working when one cloud's API is down.

Clarifying questions

  • Which kinds of problems: reliability (crashes, latency) or security (compromised instances), or both?
  • Which actions may run without a human, and for which environments (production versus staging)?
  • How many tenants, hosts and events per second?
  • Is there labelled incident history to train and evaluate on?
  • What are the consequences of a wrong shutdown for customers?

What a strong answer covers

  • Ingestion: agents and provider-native exporters into a common schema; a streaming bus partitioned by tenant and resource; hot storage for recent windows and cheaper storage for history.
  • Detection: per-metric baselines with seasonality, multivariate and log-pattern models, and rules for known bad states; online model serving with feature windows; a cheaper first stage and an expensive analyser (possibly an LLM summarising evidence) for candidates only.
  • Fusion: rules as hard constraints and guardrails, the model as a score; correlation and deduplication across signals, so one incident yields one finding, not hundreds of alerts.
  • Action orchestration: a policy engine maps finding, confidence and resource tier to allowed actions; actions run as idempotent workflows with steps, timeouts and retries through provider adapters.
  • Safety: blast-radius limits (no more than N instances per hour), dry-run and shadow modes, human approval above a threshold, never touching protected resources, a global kill switch, and reversible actions first (isolate before terminate, snapshot before shutdown).
  • Audit and rollback: an immutable record of evidence, model version, policy decision and API calls; undo steps stored with each action.
  • Noise and evaluation: precision and recall against past incidents, feedback from operators labelling findings, alert suppression and maintenance windows.

Follow-ups

  • The model starts flagging a whole region after a provider-side outage. How do you avoid mass isolation?
  • An attacker learns the system and tries to make it shut down healthy services. What protects you?
  • How do you safely roll out a new detector version?

Where it's asked

  • Google · First round: coding · Last asked Sep 202545 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI

What it tests

anomaly detection · observability · automation

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing