Day 316 — Enough C++ to read a codebase without guessing

Friday, 18 June 2027 · Week 46 of 52 · Production · Study day · 60 min

You will be shown C++ in an interview and you will want to read exchange and engine code, and reading is a far smaller skill than writing, which is what this week targets.

What you should be able to do tonight

  • Read a short C++ function and say what is copied, what is referenced and what is moved.
  • State what the compilation model does that Python’s does not, and what that buys.

Tasks 60 min

35 min Work through LearnCpp’s chapters on fundamental types, references and pointers, and const. The three ideas you need are that objects have declared types known at compile time, that a reference is an alias rather than a pointer, and that const is part of the type.

25 min Read and annotate: take twenty lines of real C++ from the LEAN engine or any open source order book, and annotate every line with what is copied and what is referenced. Getting this right is most of what reading C++ requires.

Resources

Deliverable

Twenty lines of real C++ annotated line by line with what is copied, referenced and moved.

Checkpoint

Given a function signature taking a const reference, say what that guarantees the function will and will not do.

Prepare for tomorrow

Ten minutes tonight so Day 317, Saturday, 19 June 2027 starts clean. This is what the evening email sends you.

Write two C++ programs that sum a large array: one over an array of structs, one over a struct of arrays.

Time both.

The difference will be large and tomorrow explains it.