Put the Fries in the Bag
What this preview is
Put the Fries in the Bag is a cracked quant interview question on language knowledge in Python.
- Difficulty
- Cracked
- Topic
- Language Knowledge
- Discipline
- Quant development
- Language
- Python
- Companies
- 0
What this Python language-mechanics question tests
This is a Cracked-difficulty Python question that probes your understanding of mutable default arguments and how CPython handles function definitions. It rewards careful reading of code flow and knowledge of when function defaults are evaluated.
To solve problems like this, you need to trace through object identity and mutation, understand the distinction between assignment and modification, and predict what gets printed based on CPython's execution model. The question tests whether you can reason about subtle but real gotchas that appear in production code.
- Mutable vs. immutable default parameters
- When function defaults are created (definition time vs. call time)
- Reference semantics and object identity
- List mutation and aliasing
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.