Fixed-Size Slab Allocator (PMR) - Quant Developer Interview Question
Difficulty: Hard
Category: memory_optimization
Asked at: Jump Trading, Tower Research, Citadel Securities, Optiver, HRT
Topics: c++17, memory, pointers, optimization
Problem Description
Heap allocations on the critical path introduce non-deterministic latency due to lock contention and system calls, which is unacceptable in high-frequency trading systems. C++17 Polymorphic Memory Resources (PMR) allow developers to redirect allocations to pre-allocated stack buffers, ensuring deterministic execution times by avoiding the heap entirely.
Task
Implement a custom std::pmr::memory_resource class named StackMonotonicResource that manages a fixed-size memory buffer. The allocator mus
Practice this hard 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.