Logo

Question preview

Quantum Defaults

What this preview is

About this preview

Quantum Defaults is a medium quant interview question on language knowledge in Python.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

What this Python language-knowledge question tests

This is a medium-difficulty Python question that probes your understanding of how the language handles default arguments and mutable state. It's the kind of gotcha that separates candidates who have read the Python docs carefully from those who rely on intuition alone.

To answer correctly, you need to trace through the execution model: when defaults are bound, how mutable objects behave across multiple function calls, and what the interpreter actually prints to stdout. The question rewards precision—a single character or line break out of place is wrong.

  • Default argument evaluation (when and where it happens)
  • Mutable vs. immutable objects as defaults
  • Object identity and reference semantics
  • Function call side effects