All topics

Coding & systems

Low Latency

Cache-friendly C++, hot paths, nanoseconds

Overview

About low latency questions in quant interviews

C++ patterns asked at HFT desks: cache-friendly layouts, branch-prediction-aware code, and the hot-path optimisations that separate quant-dev offers from rejections.

How to study this topic

A path that works

  1. 1

    Start with the easy set

    Warm up with the 8 easy low latency questions. Quick wins build pattern recognition before complexity ramps.

  2. 2

    Drill the medium tier next

    15 medium questions sit in the sweet spot where most interview questions cluster. Time yourself, then redo any you missed two days later.

  3. 3

    Stress-test on hard problems

    11 hard questions simulate the on-site round. Skip looking at solutions for at least 20 minutes, then write up your approach.

The library

All 34 low latency questions

easyRDTSC Cycle CountereasyCompiler Barrier FenceeasyForce-Inline and No-Inline Tick Rounding (__attribute__ Annotation)easyCircular Buffer LoggingeasySoftware Prefetch for Sequential Price Array ScaneasyTimespec Elapsed Nanoseconds (clock_gettime Arithmetic Pattern)easyBranch-Free Min/MaxeasyZero Copy Binary Parsing with SpanmediumFixed-Point Price Arithmetic (FixedPoint<4> with Integer Backend)mediumCRC32 Packet Checksum (Scalar Equivalent of SSE4.2 _mm_crc32_u8)medium__restrict__ Pointer Alias Hint for Vectorized Price UpdatemediumHot/Cold Data Splitting for Cache-Efficient Trade Structmedium4x Loop-Unrolled Exponential Moving AveragemediumFlat Array Symbol Table: O(1) Metadata LookupmediumPage Warmup via Sequential Touch (Huge Page Pre-fault Pattern)mediumSIMD Batch FX Price ConversionmediumCache-Oblivious Recursive Matrix Transpose for Correlation MatricesmediumComputed Goto Message Dispatch (GCC Label Address Extension)mediumMarket Data LRU CachemediumLow-Latency Timer HeapmediumRisk Group NettingmediumBranchless Absolute Value via Arithmetic ShiftmediumHorizontal Sum of Portfolio Positions (Scalar Equivalent of SIMD hadd)hardLock-Free SPSC Ring BufferhardLock-Free Append-Only Timestamp Log (Atomic Fetch-Add Slot Allocation)hardDynamic SIMD-Optimized BitsethardSpeculative Execution Fence for Sequence-Number Guard (lfence / Spectre Mitigation)hardO(1) Order Cancel with Doubly-Linked List and Hash MaphardSIMD-Accelerated Order Price FilterhardJSON Delimiter Scanner (Scalar Equivalent of simdjson SIMD Byte Search)hardSimplified TCP State Machine (Kernel-Bypass Connection Lifecycle)hardBranchless Order Router: 4-Venue TournamenthardCache-Friendly B+ TreehardTemplate-Inlined Strategy Dispatch (Zero Virtual Overhead)
View all 34 low latency questions