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.

EasyTechnical
51 practiced

List and briefly define at least five common failure modes in production ML/AI systems (for example poor data quality, label errors, data leakage, training instability such as vanishing or exploding gradients, numerical-precision problems, overfitting/underfitting, and hardware failures). For each, give a concrete one-to-two-sentence production example, one quick detection signal you would monitor to catch it early, and how you would feed the lesson back into your development process to prevent recurrence.

HardTechnical
40 practiced

A model's offline validation metrics stay stable, but production performance drops. Propose a prioritized diagnostic framework that distinguishes between a genuine change in the relationship between features and the label, a bug that corrupted values somewhere in the data pipeline, a change in how or when ground truth is generated, and a change in a feature's meaning or format upstream. For each candidate cause you identify, name one statistical method or check that would specifically implicate it and rule out the others.

MediumTechnical
47 practiced

Review this simplified training script and identify the bug(s):

python
# train.py (simplified)
X, y = load_all_data()
X = (X - X.mean(axis=0)) / X.std(axis=0)  # normalization on full dataset
model.fit(X, y)
print('val_score', model.score(X_val, y_val))

Explain why each issue causes a problem in practice, propose a fix, and describe a unit test that would have caught it before it shipped.

EasyTechnical
46 practiced

Write a SQL query to find duplicate primary keys and NULL values in critical columns of a feature table features(user_id, feature_a, feature_b, event_time). Explain concretely how duplicates and unexpected NULLs in this table can cause bugs during training or serving, and suggest a database constraint or an ETL-level check that would prevent them from ever reaching this table.

EasyTechnical
52 practiced

Name three lightweight tools or techniques you would use to profile latency, memory, or compute usage for deep-learning workloads, covering both the training side and the inference/serving side. For each, give a one-sentence description of what it measures and one clear trade-off it makes.

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.