Logo

Question preview

Tear it out root and stem

What this preview is

About this preview

Tear it out root and stem is a medium quant interview question on language knowledge in Cpp, asked at Quant.

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-interpretation question tests

This is a medium-difficulty question that asks you to trace through a C++ code snippet and predict its output. It assesses whether you can reason carefully about language semantics—including scope, variable lifetime, and how the compiler handles certain constructs—rather than relying on guesswork or half-remembered rules.

Questions like this appear in technical screens at quant firms because they distinguish candidates who truly understand the language from those who write by habit. A correct answer requires you to walk through the code step by step, pay attention to declarations and initializations, and understand the order of evaluation and side effects.

  • Variable scope and shadowing
  • Lifetime and initialization order
  • Control flow and side effects
  • Output stream behaviour