Handbook 1 notes
中文EN

Quant Interview Prep · C++

Every concept here is backed by C++ that actually ran

No memorising here — real C++, actually written and run. Every page below is a record of predicting first, then measuring.

Notes

Numbered in syllabus order. Open one for the full write-up and the measured numbers.

Sat · 1 hour

Week 1 · Sat 2026-08-15

size, capacity, and that factor of 2

A vector carries two lengths. Confusing them is one of the most common C++ mistakes, and “why is the growth factor 2?” is the best handle for pulling the whole thing apart — because the standard never specified it.

measured factor 2.00 (libc++)1000 pushes 11 reallocationstotal moves 1023 ≈ nreserve 1.78×
How to read these — Before reading a page, write down your own prediction on paper, then read on. Where you were wrong is the payoff; where you were right is only confirmation.