Skip to content
Sharp

Control Flow · interview question

What does a strong engineer do when reasoning through while loops and retries code?

Multiple choiceMediumchapter-2-curatedpremiumcontrol-flowwhile-loops-and-retries
python
retries = 0
while retries < 3:
    print(f"retry attempt {retries + 1}")
    retries += 1
Choose one answer
Answer and explanation

Correct answer

B. 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 Control Flow

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

Start free test
All Control Flow questions →