Pointer choreography — fast/slow runners, dummy heads, recursion, and in-place reversal.
Two runners at different speeds expose cycles and midpoints.
O(1) spacenaïve O(n) spaceWhen to reach for it
Spot it in the prompt
Look for problems that involve traversing the linked list efficiently using two pointers simultaneously, often requiring pointer manipulation or comparison.
How to solve it
Move slow by one and fast by two; if they ever meet a cycle exists, otherwise fast reaches null.
Open full solutionA placeholder head erases messy edge cases.
When to reach for it
Spot it in the prompt
Problems often involve scenarios where dealing with the head of the linked list is cumbersome or requires special treatment.
How to solve it
Animation: Dummy Node Technique techniqueTraverse both lists adding digits plus carry, appending each sum node after a dummy head to simplify list construction.
Open full solutionLet the call stack walk the list for you.
When to reach for it
Spot it in the prompt
Look for problems where a recursive approach provides an elegant solution, such as dividing it into subproblems.
How to solve it
Animation: Recursion Technique techniqueRecursively swap the first two nodes, then point the first at the result of swapping the remaining list.
Open full solutionRewire next pointers to reverse without extra space.
O(1) spacenaïve O(n) spaceWhen to reach for it
Spot it in the prompt
Problems where you're asked to reverse the linked list or perform operations on segments without using additional data structures.
How to solve it
Animation: In-Place Reversal Technique techniqueIterate with prev, curr, and next pointers, redirecting each node's next to prev and advancing until the list is reversed.
Open full solutionFDE Coach is a cohort-based program in frontend, backend, AWS, and AI where you build real products and get referred to 200+ hiring partners. The free live workshop is the fastest way to see how we teach.
750+ engineers trained · frontend, backend, AWS & AI