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.

EasyTechnical
119 practiced
Discuss reproducibility in ML tests and training jobs. List the places where nondeterminism can arise (random seeds, multithreading, CUDA, data shuffling) and describe concrete steps and environment controls you would apply in CI to make tests reproducible across runs and machines.
MediumTechnical
75 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.
MediumTechnical
65 practiced
You are asked to apply Test Driven Development (TDD) while building a new feature engineering pipeline component that computes aggregated time-windowed features. Describe a practical TDD workflow tailored to ML engineering: which tests you would write first, how to iterate on failing tests, and how to balance writing tests and exploratory data analysis.
EasyTechnical
122 practiced
Write a short pytest fixture that creates an isolated temporary directory for a test that writes model artifacts and ensures cleanup. Name the fixture and show how a test would use it. Focus on clarity and test isolation rather than full implementation details.
HardTechnical
66 practiced
Propose a test plan and test cases to validate model artifact serialization and backward compatibility across versions. Include tests for format changes, config schema evolution, and how to test that older clients can still load models or fail gracefully with migration messages.

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.