Preallocated Object Pool - Quant Developer Interview Question
Difficulty: Medium
Category: architecture & logic
Asked at: Jump Trading, Tower Research, Optiver, Akuna, HRT
Topics: memory-management, optimization, data-structures, c++
Problem Description
Dynamic memory allocation on the critical path introduces unpredictable latency due to heap fragmentation and system calls. To mitigate this, developers employ the Object Pool pattern to pre-allocate contiguous memory blocks and efficiently recycle objects using a free list. This approach ensures deterministic performance and maximizes cache locality for latency-sensitive order management components.
Task
Implement an OrderPool class that manages Order objects using a std::vector for contiguous
Practice this medium developer interview question on MyntBit - the LeetCode for quants with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.