Concept Cases
Shopping cart, search, login, inventory, pagination, todo list, rate limiter, job queue — each taken from "I need X" through meaning, state, operations, rules, examples, structure, pseudocode and code, only as far as its version justifies.
Start with "implement a shopping cart" and nothing else. Meaning, state, operations, rules, examples, data structure, pseudocode, code, tests, persistence, API, frontend, failures — in that order, each derived from the one before.
"Search products by name" is, in V1, a loop over products checking whether a name contains the query. Meaning, state, operations, rules and examples first; database search, a full-text index and a search engine only when a measured reason arrives.
Login is: credentials arrive, the identity is verified, an authenticated session is created, and future requests are associated with it. The concept and its operations are derivable; the security-sensitive mechanics — hashing, tokens, CSRF — are learned from Security Engineering, not improvised.
Inventory is the available quantity of a product. Increase, decrease, reserve, release — then inject "stock = 1, Alice buys, Bob buys at the same moment" and watch the concept meet concurrency, and route the mechanism to Concurrency and Database.
A hundred products fit on one page; ten thousand do not; ten million change the algorithm. Pagination derived from "show a slice of a list" — slice an array, then LIMIT / OFFSET, then a cursor — with the trigger for each level named.
The simplest concept with identity: a todo has an id, a title and a done flag; the operations are add, toggle, remove, list. The first place a learner meets "one entry per id" — and the place to learn the whole loop on something small enough to hold in one hand.
N requests per window, per key. The state is a counter and a window start per key; the representation choice is fixed window against sliding window, and it changes what "N per window" means at the boundary. V2 is "shared across servers", and it changes where the state lives.
Enqueue, dequeue, ack, retry. The state is a job with a status — pending, running, done, failed — and the rule that makes the queue honest: a job can run more than once, so its handler must be idempotent. Derived from "send the confirmation email later", as far as one process justifies.