Selective Setup
What this preview is
Selective Setup is a medium quant interview question on language knowledge in Cpp.
- Difficulty
- Medium
- Topic
- Language Knowledge
- Discipline
- Quant development
- Language
- Cpp
- Companies
- 0
What this C++ language-knowledge question tests
This is a medium-difficulty code-observation question that assesses your understanding of C++ initialization semantics and object lifetime. Rather than asking you to write code, it presents a concrete snippet and asks you to predict its behaviour—a common pattern in technical interviews where interviewers want to know whether you grasp the why behind language rules, not just the syntax.
To answer accurately, you need to reason about constructor invocation, default initialization, copy semantics, and how the compiler handles object setup in different contexts. These distinctions matter in performance-critical code, especially in finance and systems programming, where unexpected object copies or uninitialized state can cause subtle bugs or latency spikes.
- Default vs. value initialization
- Copy constructors and move semantics
- Temporary object lifetime and scope
- Compiler optimisations and elision
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.