Mathematics

Cache Locality

The degree to which a program accesses memory that is already in fast cache.

An L1 hit costs about a nanosecond; a main-memory miss costs on the order of a hundred. That ratio dominates performance in low-latency code.

The consequence that surprises people: std::vector usually beats std::list even for operations where the list has better asymptotic complexity, because contiguous memory is prefetchable and pointer chasing is not.

Related patterns: struct-of-arrays beats array-of-structs when you touch one field across many objects, and false sharing - two threads writing different variables on the same cache line - destroys multithreaded scaling until you pad them apart.

Full guide

C++ for Low-Latency Interviews

Trading technology interviews go far below language syntax. Memory layout, cache behaviour and what actually costs time.

Related terms

Practise this

Put it into practice

Knowing the definition is not the same as spotting where it applies under time pressure. Work the question bank free.

Start practising free

Browse the full quant interview glossary