Repertoire
You cannot improvise on an instrument until you can play a major scale without thinking, and
programming and physics are no different. There are pieces you should be able to write out
cold — a unique_ptr, a binary search, the Schrödinger equation — and the way you
get there is the way a musician learns a scale: you play it, and play it again.
The point is not the code on the screen and not memorizing syntax. Writing the syntax out — by hand, repeatedly, spaced over days — is what lays down the pathways; the understanding is the byproduct. Passive reading cannot do this. So this works like a language app: you copy each piece down, your reps are counted, and a mastery level climbs as you return to it across multiple days. The components light up as you type so you can feel the shape of what you're building.
Open a piece, write it out beside the reference (or hide the reference to test yourself), and log the rep. Come back tomorrow. Everything is stored locally — nothing to sign in to.
C++
unique_ptr from scratch
Implement a single-ownership smart pointer template — your own unique_ptr<T>. It must own a heap object, free it exactly once, forbid copying, allow moving, and expose the pointer-like interface.
shared_ptr from scratch
Implement a reference-counted shared smart pointer — your own shared_ptr<T>. Copies share ownership through a control block holding a reference count; the managed object is destroyed only when the last owner goes away.
Algorithms
Binary search (no off-by-one)
Write an iterative binary search over a sorted array that returns the index of target, or -1 if absent. Get the bounds and the midpoint exactly right.
Quicksort (Lomuto partition)
Implement in-place quicksort on an array using Lomuto partitioning: pick a pivot, partition smaller elements to the left, place the pivot, and recurse on both sides.