InterviewStack.io LogoInterviewStack.io

Trend Analysis and Anomaly Detection Questions

Covers methods for detecting and interpreting deviations in metric behavior over time and determining whether changes reflect real product or user behavior versus noise. Topics include baseline establishment, seasonality and holiday effects, time series decomposition, smoothing and aggregation choices, statistical detection techniques such as control charts, z scores, EWMA and CUSUM, thresholding strategies, and modern algorithmic approaches like isolation forest or LSTM-based detectors. Also covers visualization and dashboarding practices for communicating trends, setting sensible alerting rules, triage workflows for investigating anomalies, and assessing business impact to prioritize fixes or rollbacks.

MediumTechnical
0 practiced
Implement a streaming CUSUM detector in Python: provide a class StreamingCUSUM(target_mean: float, k: float, h: float) with an update(value: float) method that updates internal state and returns whether a positive or negative shift alarm is triggered. Explain how you'd choose k and h for production and how you'd persist per-metric state for hundreds of thousands of metrics.
MediumSystem Design
0 practiced
Design a real-time anomaly detection pipeline that can process 100k events/second, detect per-metric anomalies within 5 seconds, and send alerts to a downstream incident system. Use Kafka for ingestion and Flink/Storm for processing. Discuss keyed streams, state management, late/out-of-order data handling, backpressure strategies, and scaling considerations.
HardTechnical
0 practiced
Design an A/B test to evaluate a new anomaly detection algorithm against the existing production detector. Specify randomization unit (metrics, metric-days, or operator groups), primary and secondary outcomes (e.g., precision/recall on labeled incidents, operator time spent), sample size calculations with formulas, safety guardrails to avoid missed critical incidents, and a rollout plan if the new algorithm passes.
MediumTechnical
0 practiced
You monitor a low-count metric (e.g., daily signups per small country where many days are zero). How would you select thresholding and detection techniques to avoid noisy alerts while still catching material regressions? Consider statistical models suited for counts.
HardTechnical
0 practiced
You're building an LSTM-based anomaly detector for multiple time-series metric types. Describe data preprocessing (normalization, windowing, handling missing values), model architecture choices (sequence length, layers, bidirectional?), loss functions (reconstruction vs next-step prediction), training regime, and how to serve the model for low-latency online inference. Also address model monitoring and fallback strategies.

Unlock Full Question Bank

Get access to hundreds of Trend Analysis and Anomaly Detection interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.