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

During code review you find a pull request that caches computed features without any invalidation logic, risking stale predictions being served. How do you evaluate the safety of this change, what tests and mitigations would you require before approving it, and how would you communicate your concerns to the author and the product owner? Sketch a short, concrete PR review comment you would leave.

MediumTechnical
42 practiced

Describe a safe strategy for managing feature-schema migrations in a production ML system, so a new schema version can roll out without breaking either model serving or training. Include how you would version schemas, how you would write and test transformation functions between versions, and what contract tests would give you confidence the migration didn't silently change any feature's meaning.

MediumTechnical
40 practiced

Write a Python-based smoke-test harness for an inference service that validates: (1) deterministic responses for a fixed set of seeded inputs, (2) response time under a threshold, and (3) memory usage within a limit. Describe the specific checks your harness makes and provide a simple example you would run as part of continuous integration before every deploy.

HardTechnical
71 practiced

A subtle off-by-one shift in feature timestamps affected a small fraction of users (well under 1%) and degraded downstream metrics in a way that existing tests didn't catch. Describe a thorough root-cause investigation plan to find a bug this narrow, propose detection rules that would have caught it earlier, and outline automated checks you would add to the feature-store and backfill process to prevent a recurrence of this specific class of bug.

MediumTechnical
51 practiced

A deployed ML model interacts closely with a downstream business rule engine, and a change to the rules recently caused a user-visible regression even though the model itself didn't change. How would you design contract tests and integration tests between the model and the rule engine, and what deployment gating would you add so a future rule change can't cause the same kind of regression again?

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.