Logo

Question preview

Can you list what's initialized?

What this preview is

About this preview

Can you list what's initialized? 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++ initialization question tests

This is an easy C++ language-knowledge question that probes your understanding of how variables are initialized (or left uninitialized) in different scopes and contexts. It rewards precision about the C++ standard and careful reading of code.

To answer correctly, you need to distinguish between automatic variables, static storage, stack vs. heap allocation, and the rules governing default initialization versus value initialization. Many candidates rush through these details and guess at output; the question is designed to catch that.

  • Automatic vs. static storage duration
  • Default initialization and zero-initialization
  • Uninitialized variables and undefined behaviour