What this C++ struct alignment question tests
This is an easy C++ language-knowledge question that probes your understanding of memory alignment and padding in compiled structs. It's the kind of low-level systems knowledge that distinguishes candidates who reason carefully about performance and memory layout from those who rely on intuition alone.
To answer correctly, you need to recall how compilers on 64-bit systems arrange struct members to meet alignment requirements, and how "holes" in the layout result in padding bytes. The question rewards understanding the rules—not guesswork—and the ability to trace through a specific struct definition step by step.
- Alignment requirements per data type
- Compiler layout algorithms and member ordering
- Calculating total struct size including padding