Every Linked List Operation Is Just `cur.next = ...` — Here's How to Derive, Not Memorize
Linked list questions remain a staple of technical interviews, yet most candidates memorize operations as isolated recipes and trip over edge cases under pressure. Reducing every operation to a `next` reassignment — and defaulting to a dummy node — turns fragile memorization into a derivable skill that holds up when the problem is unfamiliar.
Linked list operations collapse into one idea: changing what a node's `next` points to. Traversal moves your gaze (`cur = cur.next`), deletion skips a node (`cur.next = cur.next.next`), insertion connects the new node before breaking the old chain, and reversal flips each node's `next` to point backward. A dummy head node gives every real node a predecessor, eliminating special-case branches for the head.
Fast-slow pointers solve cycle detection and Kth-from-end problems with the same chase logic. Two-pointer path-swapping handles intersection, and a dummy plus comparison pointer merges sorted lists. The underlying pattern is always the same: identify which `next` to rewrite, then move the right pointers.
The practical takeaway is a two-step habit — draw three nodes with their `next` arrows, then write the single `xxx.next = yyy` line that does the work. Common bugs like advancing after deletion or returning `head` instead of `dummy.next` become obvious once the pointer model is clear.
The pedagogical shift from 'four operations' to 'one pointer reassignment with four shapes' mirrors how expert developers actually reason about linked structures — not as a catalog of recipes but as a tiny state machine where only `next` changes.
Most linked list bugs (advancing after deletion, reversing insert order, returning the wrong head) are symptoms of treating operations as opaque steps rather than visualizing which pointer moves where. The dummy node alone eliminates an entire class of head-special-case errors that interviewers routinely see.
The fast-slow pointer mnemonic — chase, lead, swap, compare — covers the majority of medium and hard linked list problems, yet many candidates still approach each problem as a fresh puzzle instead of recognizing the underlying pattern.