InterviewStack.io LogoInterviewStack.io

Test Case Design and Edge Case Analysis Questions

Systematically deriving the cases, inputs, and conditions most likely to expose defects. Covers formal test-design techniques (equivalence partitioning, boundary value analysis, decision tables, state transitions, and pairwise/combinatorial design) and writing clear, maintainable test cases with documented expected results. Also covers the edge-case mindset: boundary conditions, invalid and unexpected inputs, corner cases, and the attention to detail that anticipates failures when validating complex behavior.

HardTechnical
88 practiced

Design a fuzz-testing approach to detect numerical instability and catastrophic cancellation in algorithms such as log-sum-exp or softmax. Describe how to generate test inputs across many orders of magnitude (very large positive, very large negative, and mixed signs), how to detect instability (e.g., NaNs, infinities, huge relative errors), and provide a stable alternative implementation and tests that prove its numerical advantages.

EasyTechnical
68 practiced

Write unit tests in Python using pytest for the following function signature: def normalize_username(s: str) -> str. The function should trim whitespace, lower-case the string, and replace consecutive internal spaces with a single underscore. Provide 5 test cases including edge, empty, and unicode inputs.

HardTechnical
89 practiced

Explain the 'oracle problem' in testing ML systems, where there is no single deterministic correct output. Propose practical strategies to create test oracles for ML correctness including invariants, distributional checks, statistical assertions, contract tests, and sample-based golden datasets. Provide example tests that illustrate each strategy.

MediumTechnical
76 practiced

Implement a Python function robust_mean(values: List[Optional[float]]) -> float that computes the arithmetic mean while ignoring None and NaN. It should raise ValueError if no valid numbers are present. Consider numerically stable accumulation to reduce overflow risk when values have large magnitude; mention algorithm choice (Kahan or incremental). State complexity, behavior on infinities, and assumptions about IEEE floats.

MediumTechnical
89 practiced

Explain floating-point comparison pitfalls in software, including rounding and representation differences. Provide test strategies and code-level best practices an SDET should apply when writing assertions that compare floats in unit and integration tests, including examples of relative and absolute epsilon checks.

Unlock Full Question Bank

Get access to all 21 Test Case Design and Edge Case Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.