Logo

Question preview

Where did it go?

What this preview is

About this preview

Where did it go? is a easy quant interview question on language knowledge in Cpp.

Unlock full access to getcracked

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

What this C++ code-reading question tests

This is an easy C++ question that asks you to trace the execution of a code snippet and predict its output. It probes your understanding of how C++ handles memory, scope, and object lifetime—concepts that matter in any performance-critical environment where unexpected behaviour can be costly.

To solve problems like this, you read the code carefully, track variable declarations and assignments through each scope, and reason about what gets printed or returned. The question rewards attention to detail: small syntactic features or implicit conversions often determine whether an output is valid or undefined.

  • Variable scope and lifetime in C++
  • Stack vs. heap allocation
  • Implicit type conversions and default values
  • Control flow and conditional execution