Is it used?
What this preview is
Is it used? is a easy quant interview question on language knowledge in Cpp.
- Difficulty
- Easy
- Topic
- Language Knowledge
- Discipline
- Quant development
- Language
- Cpp
- Companies
- 0
What this C++ template instantiation question tests
This is an easy conceptual question about how C++ template member functions are instantiated by the compiler. It probes whether you understand that templates are compiled lazily—that is, which member functions actually generate code at compile time.
To answer correctly, you need to reason about what the compiler does when you instantiate a template class and call only some of its member functions. The key insight is understanding the difference between class template instantiation and member function instantiation, and recognizing which functions the compiler must generate code for versus which it can safely skip.
- Template instantiation models (eager vs. lazy)
- Point-of-instantiation rules
- Unused member function elision
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.