C++ / a working model

LEARNING PATHS / START SMALL

You do not have to learn all of C++ at once.

Pick one path. Read one lesson, run one program, answer one question.

This guide assumes some programming experience. It is not a from-scratch tutorial on variables and loops, and it is not a substitute for the standard. The times include reading the example once, not finishing every exercise. They are a pacing suggestion, not a proficiency guarantee.

01 / RECOMMENDED

Build a working mental model

Twenty-five to forty minutes a day, seven sessions. Stop and change the code if you cannot answer the exercise.

  1. Objects, storage, and lifetimePointers and references: say who owns the object and when a handle dies.
  2. RAIIChoosing smart pointers: release resources without manual cleanup.
  3. Construction and destruction orderCopying and the Rule of Zero: copy a value versus copy a resource handle.
  4. Move semanticsPerfect forwarding: explain why std::move does not move by itself.
  5. vectorIterator invalidation: decide which handles survive a container update.
  6. Mutexes and locksMemory ordering: draw the happens-before relation for a published value.
  7. Compilation and linkingDiagnostics: compile, change the example, and explain every warning.

02 / INTERVIEW REHEARSAL

Practice saying a complete answer.

Reserve 60–90 minutes. For each prompt, speak for 60 seconds: conclusion, mechanism, boundary, example. A memorized definition is not enough.

  1. new and malloc, const, static: storage, object lifetime, linkage, and scope.
  2. Virtual functions and the object model, Virtual destructors: do not promote one ABI layout into a language rule.
  3. shared_ptr, weak_ptr: control blocks, cycles, and the thread-safety boundary.
  4. Hash containers, Ordered containers, Algorithms: complexity, degeneration, invalidation, comparators.
  5. volatile, Condition variables: a data race is not “a wrong value sometimes”; waits belong around a predicate.

03 / MODERNIZE YOUR C++

Already comfortable with C++11? Add the later tools.

Twenty to thirty-five minutes each, in dependency order. Each lesson marks the minimum example standard.

  1. auto and decltypelambdaVariadic templates and fold expressions.
  2. Type traitsCompile-time evaluationconcepts and requires.
  3. optional and variantstring_view and spanranges.
  4. CoroutinesC++23 and expected. Check your library and compiler first.

04 / READ THE SOURCE

Trace one claim back to real book pages.

Open book records, check the edition and the actual reading range, then open the original. One theme at a time: read the source, run the original practice program, change an input, explain the result. A partial reading record is not coverage of the whole book.

All book practice lessons →

05 / OSTEP

Three easy pieces, one chapter at a time.

The OSTEP walkthrough follows the free book: CPU virtualization, memory virtualization, concurrency, persistence, then security. Run the C example on Linux before you mark a chapter done. Link the official PDF rather than treating these notes as the book.

Start the OSTEP walkthrough →

Turn a claim into a program you can run

Every C++ lesson has a complete .cpp download. Use GCC or Clang with -Wall -Wextra -Wpedantic and the lesson’s -std=. Concurrency examples need -pthread on Linux. OSTEP examples are C; compile with gcc -std=c11. The browser does not run C or C++.

After a successful run, change one input, predict the output, then run again. Mark a lesson complete only when you can explain why. Progress stays in this browser.

Open the full catalog →