E
edgecase
quant prep

C++ / HFT

Modern C++ patterns with HFT-grade explanations.

18 items
0 of 18 mastered18 unseen
modern C++

constexpr — Pay at Compile Time, Not Runtime

Signal: Whether the candidate uses the compile-time evaluator to push work off the hot path.

Tap to reveal pattern
HFT

Hot Path Discipline — A Checklist

Signal: The 'do you think about latency' question. Tests breadth and ability to reason about microarchitectural effects.

Tap to reveal pattern
modern C++

Move Semantics — When to Copy, When to Move

Signal: Tests whether the candidate understands rvalue references and how to avoid unnecessary copies. Critical for hot-path code.

Tap to reveal pattern
foundations

References vs Pointers — Nullable vs Non-nullable

Signal: Whether the candidate uses the right tool. Reaching for raw pointers when references suffice signals C-with-classes thinking.

Tap to reveal pattern
memory

No Allocations on the Hot Path

Signal: Whether the candidate knows allocations cost orders of magnitude more than ALU ops, and how to write code without them.

Tap to reveal pattern
HFT

Branch Hints — [[likely]] / [[unlikely]]

Signal: Knowing when and how to hint the optimizer. Mostly cosmetic but reveals familiarity with branch predictor behavior.

Tap to reveal pattern
modern C++

Aggregates + Designated Initializers

Signal: Whether the candidate writes self-documenting struct initializations. Mostly cosmetic but reveals fluency with C++20.

Tap to reveal pattern
memory

Cache Lines & False Sharing

Signal: Whether the candidate knows why two atomics in the same struct can destroy performance even when they're never touched together.

Tap to reveal pattern
modern C++

Templates + Concepts (C++20)

Signal: Whether the candidate writes generic code and uses concepts to constrain it. Error messages drop from 50 lines of template spew to 1 line.

Tap to reveal pattern
memory

Smart Pointers — unique_ptr vs shared_ptr

Signal: Tests whether the candidate defaults to unique_ptr (correct) or shared_ptr (overused).

Tap to reveal pattern
memory

PIMPL — Pointer to Implementation

Signal: Tests whether the candidate knows how to control compile times and ABI stability in large codebases.

Tap to reveal pattern
concurrency

thread_local — Per-Thread State

Signal: Whether the candidate knows about TLS overhead and when to use it instead of locking.

Tap to reveal pattern
HFT

SoA vs AoS — Data Layout for the Cache

Signal: Whether the candidate optimizes for the access pattern of their hot loop, not for OOP cleanliness.

Tap to reveal pattern
HFT

Order Book — Sorted Map vs L2 Ladder

Signal: Whether the candidate has actually built or read an order book. Reveals data structure judgment under realistic constraints.

Tap to reveal pattern
concurrency

std::atomic + Memory Orderings

Signal: The deepest C++ topic an interviewer can probe. Separates senior from staff.

Tap to reveal pattern
HFT

Virtual Dispatch vs CRTP

Signal: Whether the candidate knows compile-time polymorphism exists, and when each tool is right.

Tap to reveal pattern
foundations

RAII — Resource Acquisition Is Initialization

Signal: The single most important concept in C++. Reveals whether the candidate writes exception-safe code by default.

Tap to reveal pattern
concurrency

Lock-free SPSC Ring Buffer

Signal: The canonical 'design a lock-free data structure' interview problem. Tests memory ordering, false sharing, and ABA.

Tap to reveal pattern
#1 of 18