InterviewStack.io LogoInterviewStack.io

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.

HardTechnical
81 practiced

A model's offline evaluation metrics improve over the previous version, but the online experiment shows no lift, or even a regression, on the actual business metric (for example, revenue, watch-time, or click-through rate). Describe a systematic checklist to reconcile the discrepancy, covering both the data pipeline feeding each metric and the model's behavior itself. Then describe how you would communicate the investigation's status and findings to a stakeholder who is skeptical that the new model is actually worse.

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
56 practiced

Explain the trade-offs between unit tests, integration tests, and end-to-end tests specifically for ML systems, in terms of speed, flakiness, maintenance cost, and how likely each is to actually catch a real bug. Given a limited testing budget, where would you invest test coverage for the highest return, and why does that answer differ from the usual advice for a typical web-service codebase?

HardTechnical
53 practiced

You receive an intentionally vague request: 'make our churn model better,' with no further specifics. Provide a structured, step-by-step investigation plan to identify potential failure modes, how you would prioritize which to investigate first given limited time, and how you would work around a limited labeling budget while still making progress.

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.

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.