Linear Memory Arena - Quant Developer Interview Question
Difficulty: Medium
Category: memory_optimization
Asked at: Jump Trading, Tower Research, Citadel Securities, Optiver, HRT
Topics: c++, memory, pointers, optimization
Problem Description
Standard dynamic memory allocation introduces non-deterministic latency due to heap fragmentation and lock contention. A linear allocator, or memory arena, mitigates this by pre-allocating a contiguous block of memory and managing allocations via a simple pointer bump. This approach ensures O(1) allocation time and cache locality, which is critical for high-frequency trading and low-latency financial systems.
Task
Implement the LinearAllocator class to manage a fixed-size memory block using a p
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.