What this C++ small-object optimization question tests
This is an easy conceptual question on a foundational C++ memory-optimization technique. It appears frequently in quant-firm interviews because trading systems and market-data handlers must minimize allocation overhead and cache misses—especially when working with high volumes of small objects like order structures or price ticks.
The question probes whether you understand how modern C++ standard library implementations balance heap allocation cost against stack/inline storage trade-offs. A clear answer demonstrates familiarity with both the why (performance under realistic workloads) and the where (string, vector, and other container implementations).
- Inline vs. heap storage and when each is chosen
- Cache locality and allocation overhead
- Trade-offs between space and speed in container design