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.

MediumTechnical
51 practiced

Describe a testing strategy for a data-preprocessing pipeline that includes unit tests, integration tests, property-based tests, and synthetic-data end-to-end checks. Name the tools you would use (for example pytest, hypothesis, great_expectations), what each test type should validate, and how you would keep test datasets small and deterministic. Include, as one concrete example, an automated check for schema drift or an unexpected distribution shift and what pandas or great_expectations code would implement it.

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

After adding a new feature or component, validation accuracy dropped. Design an ablation study to determine which change caused the regression: what controlled experiments you would run, how you would log and compare results, how you would control for run-to-run variance so you can assess statistical significance, and how you would reason about interactions between features rather than testing each one in complete isolation.

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.

MediumTechnical
43 practiced

Implement a function validate_events(events, schema) in Python that takes a list of event dictionaries and a schema dictionary (for example {'user_id': {'type': 'int', 'required': True}, 'amount': {'type': 'float', 'min': 0}, 'ts': {'type': 'timestamp', 'format': 'iso8601', 'required': True}}) and returns (valid_events, errors). The function must validate types, required fields, timestamp format, and numeric ranges. Discuss what error information you would include for each invalid record to make debugging a failed validation run fast.

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.