Logo

Question preview

It's unique, but is it big?

What this preview is

About this preview

It's unique, but is it big? is a cooked quant interview question on language knowledge in Cpp, asked at Quant.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

Understanding size and alignment in C++ memory layout

This is an easy C++ question that tests your grasp of how the compiler lays out data members in memory. It requires you to reason about object size, padding, and alignment rules on a 64-bit system—knowledge that matters in performance-critical quant systems where memory efficiency and cache locality directly affect latency.

To answer questions like this, you need to understand how the compiler allocates space for class members, respects alignment boundaries, and adds padding to satisfy alignment constraints. Even small optimizations in data structure layout can meaningfully reduce cache misses in tight trading loops.

  • Alignment requirements and padding in structs and classes
  • How the sizeof operator accounts for layout and alignment
  • Differences between logical member count and actual byte footprint