Skip to content
Sharp

Type Hints · interview question

What does a strong engineer do when reasoning through protocols code?

Multiple choiceMediumchapter-10-curatedpremiumtype-hintsprotocols
python
from typing import Protocol

class PaymentGateway(Protocol):
    def charge(self, amount: int) -> str: ...
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 Type Hints

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

Start free test
All Type Hints questions →