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.
HardTechnical
89 practiced
Leadership: You are the ML engineering lead and data scientists are reluctant to write tests because experiments change rapidly. How would you advocate for and introduce sustainable testing practices that do not slow down experimentation? Outline a rollout plan, training, and quick wins that demonstrate value.
HardTechnical
82 practiced
Explain how you would test the stability and fidelity of model explanations produced by SHAP or LIME. Propose concrete automated tests that validate explanation consistency across similar inputs, sensitivity to feature perturbation, and plausibility relative to known feature importance for synthetic datasets.
EasyTechnical
66 practiced
You have a simple Python function `standardize(column)` that returns a list of standardized values. Write pytest unit tests for this function that cover typical cases and edge cases: constant column, single element column, None or NaN values, and numerical stability for near-zero variance. Include test names and brief assertions (no implementation of `standardize` required).
HardTechnical
85 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.