Skip to content
Sharp

Type Hints · interview question

A bug appears around typeddict and shaped data. What is the strongest first debugging move?

Multiple choiceMediumchapter-10-curatedpremiumtype-hintstypeddict-and-shaped-data
python
from typing import TypedDict

class OrderRow(TypedDict):
    sku: str
    quantity: int
Choose one answer
Answer and explanation

Correct answer

B. Trace one concrete example, inspect the state transitions, and compare them to the intended rule before rewriting anything.

Why

That approach is reliable because it creates evidence. Passing around raw dicts with undocumented keys makes integration code brittle and review-heavy.

Test yourself on Type Hints

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

Start free test
All Type Hints questions →