My name is
What this preview is
My name is is a hard quant interview question on language knowledge in Python.
- Difficulty
- Hard
- Topic
- Language Knowledge
- Discipline
- Quant development
- Language
- Python
- Companies
- 0
What this Python name-binding interview question tests
This is a medium-difficulty Python question that probes your understanding of scope, name resolution, and the order in which Python evaluates expressions. It is typical of screening rounds where interviewers want to see whether you can trace code execution carefully and predict output without running it.
To solve problems like this, you need to understand how Python resolves names in the local, enclosing, global, and built-in scopes (the LEGB rule), how assignment statements work, and the precise timing of when names become bound. Many candidates skip over subtle ordering details—especially around when a name is defined versus when it is referenced. Attention to these mechanics is valuable both in interviews and when debugging real code.
- Scope and the LEGB lookup order
- Name binding and the assignment statement
- When names are resolved during expression evaluation
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.