Hidden Implementation
What this preview is
Hidden Implementation 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++ destructor implementation question tests
This is a medium-difficulty question about C++ class design and the relationship between declaration and definition across translation units. It probes whether you understand the consequences of forward declarations, incomplete types, and how the compiler resolves member cleanup at link time.
The core skill being tested is knowledge of the one definition rule (ODR) and how it interacts with user-declared destructors. When a destructor is declared but not defined inline, the compiler defers full instantiation until the definition is available—a technique that enables true separation of interface from implementation. The question rewards candidates who can explain why certain design patterns require the destructor to live in a separate translation unit, and what breaks if you ignore that constraint.
- Forward declarations and incomplete types
- Destructor visibility and member cleanup order
- Compiler instantiation and the ODR
- Pimpl (pointer-to-implementation) patterns
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.