Namespace Twins
What this preview is
Namespace Twins 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++ namespace and scope question tests
This is a medium-difficulty C++ language-knowledge question that probes your understanding of namespace resolution, scope, and identifier lookup rules. It rewards careful reading of code and precision about how the compiler resolves names across different declaration contexts.
To work through questions like this, you need to trace which declarations are visible at each point in the code, understand the precedence of local scope over namespace scope, and recognize how the using directive and explicit namespace qualification interact. Interviewers use these questions to verify that you think deliberately about name collisions and can predict program behaviour without running it.
- Namespace scope vs. local scope lookup order
- Qualified and unqualified name resolution
- The role of using declarations and directives
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.