Logo

Question preview

I hate extern.

What this preview is

About this preview

I hate extern. is a medium 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++ language-knowledge question tests

This is a medium-difficulty question that probes your understanding of extern "C" linkage in C++—a feature that frequently trips up engineers in code review and integration scenarios. It appears in technical interviews because the distinction between C and C++ linkage is subtle but consequential for real systems, especially when bridging legacy code or interfacing with C libraries.

To answer correctly, you need to understand why and when C++ code declares external C linkage, what happens to function names and calling conventions under each linkage model, and how the linker resolves symbols differently. The question rewards precise knowledge of language semantics over guesswork.

  • Name mangling and symbol resolution in C++ vs. C
  • Linkage specifications and their scope
  • Common patterns: wrapping C headers, exposing C++ APIs to C callers
  • Implications for binary compatibility and ABI