Logo

Question preview

I'm empty inside 4

What this preview is

About this preview

I'm empty inside 4 is a easy 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++ object-size question tests

This is an easy C++ question about empty class optimization and memory layout. It asks you to predict the compiled size of an object, which depends on how your compiler handles empty data members and inheritance.

The question assumes familiarity with the earlier "I'm empty inside" problems in the series, building on foundational concepts around object representation. To answer correctly, you need to understand the rules governing padding, alignment, and when the compiler is permitted to optimize away seemingly-unused space. The answer is language-specific and implementation-dependent, so the question asks for the theoretical minimum across standard-compliant compilers.

  • Empty class optimization (ECO)
  • Object size and alignment requirements
  • Compiler-dependent behaviour in C++
  • Memory layout of inheritance hierarchies