What this Python language-knowledge question tests
This is a medium-difficulty Python question that probes your understanding of how the language handles naming, scoping, and method resolution. It rewards careful reading of code flow and familiarity with Python's execution model rather than heavy computation or algorithm design.
To solve it, you need to trace through the code step-by-step, paying attention to how variables are bound, how methods are called, and what actually gets evaluated at runtime. Quant firms ask questions like this to verify that candidates can read unfamiliar code confidently and reason about its behaviour without running it first—a skill that matters when debugging trading systems or reviewing colleagues' implementations.
- Variable scoping and binding
- Method calls and attribute lookup
- Python's execution order and evaluation semantics