InterviewStack.io LogoInterviewStack.io

Testability and Testing Practices Questions

Emphasizes designing code for testability and applying disciplined testing practices to ensure correctness and reduce regressions. Topics include writing modular code with clear seams for injection and mocking, unit tests and integration tests, test driven development, use of test doubles and mocking frameworks, distinguishing meaningful test coverage from superficial metrics, test independence and isolation, organizing and naming tests, test data management, reducing flakiness and enabling reliable parallel execution, scaling test frameworks and reporting, and integrating tests into continuous integration pipelines. Interviewers will probe how candidates make code testable, design meaningful test cases for edge conditions, and automate testing in the delivery flow.

MediumTechnical
0 practiced
Propose an automated CI check to detect data drift between a new incoming training dataset and the baseline dataset. Include the types of statistical tests, thresholds, feature-level checks, and how to surface findings in CI to prevent accidental model regression.
EasyTechnical
0 practiced
You are creating a CI pipeline for an ML repository but CI runners do not have GPUs. Propose a test partitioning strategy that gives fast feedback on PRs while still ensuring full GPU tests run before release. Explain how to tag tests, schedule GPU jobs, and keep overall feedback useful to developers.
HardTechnical
0 practiced
Design an adversarial property-based test for an image classifier that asserts invariance to small rotations and brightness changes. Provide pseudocode that uses a property-testing framework and an image transform library. Describe what a failure would indicate and how you would act on it.
MediumTechnical
0 practiced
Write a pytest unit test snippet that serializes a simple PyTorch model to TorchScript, loads it back, and asserts that the output of the TorchScript model is close to the original model on a small deterministic input. Include tolerances and seed control.
HardTechnical
0 practiced
You observe intermittent numeric mismatches in model outputs on CI but not locally, likely due to nondeterministic op ordering on GPUs. Describe a debugging plan and tests you would add to isolate whether differences come from hardware, library versions, parallelism, or data ordering. Include short- and long-term fixes.

Unlock Full Question Bank

Get access to hundreds of Testability and Testing Practices interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.