Testability and Shift-Left Testing Questions
Designing software to be testable and moving quality earlier in the lifecycle. Covers testability and design review, shift-left practices, collaborating with developers on quality at design time, and improving testability of existing code. Emphasizes preventing defects rather than only catching them.
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.
Behavioral: Tell me about a time you improved test coverage or test quality for an ML project. Structure your answer using STAR: what was the Situation, what Task were you addressing, which Actions did you take to change the testing practice, and what Results did you achieve in measurable terms?
A suite of UI tests passes locally but fails intermittently on pull requests in CI. What steps would you take to reproduce the issue, identify the root cause, and reduce the flakiness without simply deleting the tests?
Design automated checks that detect data leakage between training and test sets in CI. Include practical heuristics and statistical tests for leakage that can be run quickly, such as overlap checks, timestamp-based checks, and model-based leakage detectors. Explain false-positive risks and mitigation.
Write a unit test in NumPy that performs a small numerical gradient check for a custom loss function implemented as loss(x). Provide the test logic (finite difference approximation) and explain acceptable tolerance choices for floating point comparisons.
Unlock Full Question Bank
Get access to all Testability and Shift-Left Testing interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.