Low-latency roles interview C++ at a depth that surprises candidates from general software backgrounds.
Memory layout and cache
The single most important practical topic.
A cache miss costs on the order of a hundred nanoseconds; an L1 hit costs about one. That ratio dominates performance in the code these firms write.
Consequences you should be able to state:
- std::vector usually beats std::list, even for operations where the list has better asymptotic complexity, because the vector is contiguous and prefetch-friendly while the list chases pointers.
- Struct-of-arrays often beats array-of-structs when you touch one field across many objects.
- False sharing - two threads writing different variables on the same cache line - destroys scalability, and padding fixes it.
Allocation
Heap allocation in a hot path is a common disqualifier. Know about arena and pool allocators, why allocation is unpredictable in latency terms, and why many trading systems pre-allocate everything on startup.
Move semantics and copies
Be able to say exactly where copies occur and how to avoid them: pass by const reference, return by value relying on copy elision, use std::move deliberately and know that a moved-from object is valid but unspecified.
The rule of zero, three and five is expected knowledge.
RAII
Resource lifetime tied to object lifetime. Know why it makes exception safety tractable and how unique_ptr and shared_ptr differ - including that shared_ptr's reference counting is atomic and therefore not free.
Concurrency
Data races, memory ordering, atomics, and why lock-free structures are hard. You are not usually expected to implement a lock-free queue on the spot, but you should know what makes it difficult and what a memory fence does.
Implementing containers by hand
Some firms ask you to implement a hash map or a deque with correct iterator-invalidation semantics. That is a different exercise from an algorithm puzzle: it tests whether you know how the standard library actually works.
Practise in programming and DSA.