Intrusive Smart Pointer - Quant Developer Interview Question
Difficulty: Hard
Category: memory_optimization
Asked at: Akuna, Jump Trading, Tower Research, Optiver, HRT
Topics: pointers, memory-management, templates, cpp
Problem Description
Standard smart pointers often introduce unacceptable latency due to separate control block allocations and pointer indirection. Intrusive pointers address this by embedding the reference count directly within the object, ensuring a single memory allocation and improved cache locality for performance-critical applications.
Task
Implement the RefCounted base class and the IntrusivePtr class template to manage object lifecycles with embedded reference counting. The RefCounted class must handle int
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.