Logo

Question preview

Forever single

What this preview is

About this preview

Forever single is a cracked 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 type-checking question tests

This is a Cracked-level question that probes your understanding of how modern Python typecheckers like mypy infer and represent types. It asks you to think like the tool itself—to predict what a static type-checker would conclude about a variable's type based on code inspection alone, without running it.

The question rewards familiarity with type inference rules, union types, and how typecheckers handle assignments and reassignments. You need to understand the difference between runtime behaviour and what the type system can statically prove. This matters because production codebases increasingly rely on type annotations and tooling to catch errors before deployment.

  • Type inference and flow-sensitive typing
  • Union types and type narrowing
  • How assignment patterns affect inferred types