Fill and Align
What this preview is
Fill and Align 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++ language-knowledge question tests
This is a medium-difficulty code-reading question that probes your understanding of how C++ handles memory layout, alignment, and padding in data structures. Rather than writing code from scratch, you are asked to trace through an existing snippet and predict its output—a skill that separates candidates who can reason about low-level behaviour from those who rely on intuition.
To answer correctly, you need to understand how compilers arrange struct members in memory, how alignment requirements affect total size, and how language features like sizeof interact with these rules. These details matter in high-frequency trading and systems programming, where memory efficiency and cache locality directly impact performance.
- Struct member layout and alignment rules
- Padding and its effect on data-structure size
- The
sizeofoperator and its guarantees - Platform-dependent vs. portable code
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.