Debugging and Testing ML Systems Questions

Finding, diagnosing, and fixing problems in ML code, data, and models, and building tests that catch these problems before they reach users. Covers common ML pitfalls (data leakage, shape mismatches, silent training bugs, mis-specified loss or metrics), root-cause analysis of model regressions and production incidents (accuracy drops, calibration drift, intermittent or hard-to-reproduce failures), distributed-training-specific failures (multi-GPU divergence, intermittent OOM, precision-related instability), and the diagnostic tooling that supports it (reproducibility artifacts, structured logging, instrumentation). Also covers testing ML systems directly: unit tests for data and feature pipelines, validation checks for datasets and features, test oracles and acceptance criteria for probabilistic or non-deterministic model outputs, and integration and regression tests that catch model or pipeline regressions before deployment. Emphasizes the engineering rigor that keeps ML systems correct and maintainable.

HardSystem Design
46 practiced

Design a chaos-engineering (failure-injection) plan to test an ML system's resilience: injecting feature corruption, missing upstream data, a spike in a particular label, and delayed inputs. Describe the specific tests you would run, how you would capture and interpret the system's response, the safety controls you would put in place so the experiment can't cause real user harm, and what you would do after a test reveals a real weakness.

MediumTechnical
50 practiced

For a model whose ground-truth labels arrive weeks after prediction (for example a churn model), monitoring shows a sudden drop in measured accuracy. How would you distinguish genuine model degradation from an artificial metric change caused by label delay or a labeling-pipeline bug? Propose monitoring adjustments, proxy metrics you could use before true labels arrive, and a concrete diagnostic plan.

HardTechnical
52 practiced

In a multi-node distributed training job, one node intermittently throws a CUDA out-of-memory error, or the job produces diverging results across otherwise-identical nodes. Outline a thorough debugging plan: what logs and traces to collect (NCCL, CUDA, system logs), how to distinguish a genuine memory leak or fragmentation from a legitimate peak-allocation spike, how to check that batch sizes and any model sharding are actually consistent across ranks, and how you would isolate WHICH rank is producing the anomaly (e.g. a NaN) when the job spans many GPUs. Give one short-term mitigation to keep the job running while you investigate.

HardTechnical
53 practiced

Construct test oracles for an ML inference pipeline whose outputs are probabilistic and non-deterministic (for example, ranking scores rather than a fixed label). Describe what acceptance criteria even mean when there is no single correct answer, what statistical tests you would use to compare a candidate output distribution against an expected one, how you would build a synthetic dataset with a known ground truth to validate the oracle itself, and techniques for detecting a regression despite the inherent run-to-run variance.

HardTechnical
45 practiced

For a product feature driven by an ML model that produces probabilistic outputs, propose a testing strategy that balances speed, quality, and cost, spanning from fast pre-merge checks through to production validation. Discuss the cost trade-offs of your recommended retraining and test-execution cadence.

Unlock Full Question Bank

Get access to all Debugging and Testing ML Systems interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.