Skip to content
Sharp

Testing · interview question

What does a strong engineer do when reasoning through parameterized tests code?

Multiple choiceMediumchapter-9-curatedpremiumtestingparameterized-tests
python
import pytest

@pytest.mark.parametrize("subtotal,expected", [(50, 6.5), (120, 0)])
def test_shipping_fee(subtotal: float, expected: float) -> None:
    assert shipping_fee(subtotal) == expected
Choose one answer
Answer and explanation

Correct answer

C. Narrate the data shape, the state changes, and the exact rule order step by step.

Why

Interviewers often use simple code to test whether you can reason through execution without bluffing.

Test yourself on Testing

A free test with instant, explained results. No account needed.

Start free test
All Testing questions →