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

You scale synchronous distributed training from a small number of GPUs to many, or you enable mixed precision (AMP) and gradient accumulation, and training that was stable before now diverges or intermittently produces NaNs in the backward pass. Enumerate the plausible causes and propose a prioritized diagnostic plan: which single change you would test first, and what you would expect to observe if each cause were the real one.

MediumTechnical
40 practiced

List the common sources of nondeterministic training runs in frameworks like PyTorch or TensorFlow, and in libraries like NumPy, pandas, and scikit-learn on multi-core machines. Provide a prioritized checklist for debugging reproducibility issues, and describe what you would introduce to a legacy project that currently has none of this in place, to get the most impact for the least initial effort.

HardTechnical
49 practiced

A new model version passed all pre-deployment tests but shows notable degradation once in production. Walk through a forensic post-deployment incident-response plan: what evidence you would gather (logs, feature snapshots, model versions), how you would compare pre- and post-deployment input distributions and schemas, how you would check for a data-pipeline or feature-transformation change that the pre-deployment tests didn't cover, and what you would change about your test suite so a similar regression is caught next time.

HardTechnical
52 practiced

A production model's performance drops sharply right after a change to the upstream data-ingestion pipeline. Outline a systematic debugging approach: validating raw inputs, comparing feature distributions before and after the pipeline change, verifying schema and null-handling behavior, replaying historical data through the new pipeline to check for silent differences, and using a shadow deployment to isolate whether the regression is in the data or the model. Describe the preventative tests you would add so a future pipeline change can't cause the same regression silently.

HardTechnical
40 practiced

Production predictions for identical inputs sometimes differ between requests. List the plausible root causes at the model, runtime, and infrastructure levels. For each, describe a concrete test or configuration change that would make inference deterministic, and explain the performance trade-off you would be accepting.

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.