← All Posts
DSA · Linked Lists · Part 27 of 28

Curated Problem Catalog

There are hundreds of linked-list problems on the judges and maybe fifty distinct ideas among them. This catalog is those fifty, grouped by the eight patterns from the Interview Pattern Catalog and ordered from easy to hard within each group. Every row names the single insight the problem is actually testing and the post in this series that teaches it. Solve one representative from each pattern and you have covered the space; solve the whole list and nothing in an interview will surprise you.

Difficulty follows LeetCode's own labels: Easy, Medium, Hard. Do not skip the easies — they are where you build the muscle memory that makes the hards feel mechanical.

1. Dummy Head / Sentinel & Deletion

Removal problems where the head itself may go. A sentinel in front removes the special case.

#ProblemDifficultyThe one insightPost
203Remove Linked List ElementsEasyA dummy before the head means deleting the first node is not special.sentinels
83Remove Duplicates from Sorted ListEasyCompare cur and cur.next; skip while equal.traversal
82Remove Duplicates from Sorted List IIMediumDelete the entire run; a dummy keeps prev valid across it.partitioning
1474Delete N Nodes After M NodesEasyTwo nested counters: keep m, then unlink the next n.traversal
2487Remove Nodes From Linked ListMediumReverse, drop any node smaller than the running max, reverse back.reversal
1171Remove Zero Sum Consecutive NodesMediumPrefix sums in a hash map; a repeat means splice out the span between.arithmetic

2. Prev–Cur & Pointer-to-Pointer

In-place edits at a node you found, and the design of a list's own operations.

#ProblemDifficultyThe one insightPost
237Delete Node in a Linked ListMediumNo predecessor? Copy the next node's value in and unlink it.pitfalls
707Design Linked ListMediumEvery op is prev–cur surgery; a dummy head simplifies all of them.singly list
817Linked List ComponentsMediumCount maximal runs whose values are all in the set.traversal
1019Next Greater Node In Linked ListMediumA monotonic stack of indices, resolved as you walk the nodes.traversal

3. Fast & Slow Pointers

Two speeds expose the middle, a cycle, and pair structure — all in one pass, all in O(1) space.

#ProblemDifficultyThe one insightPost
876Middle of the Linked ListEasySlow moves one, fast moves two; slow lands on the middle.fast & slow
141Linked List CycleEasyIf fast ever meets slow, there is a cycle.cycle detection
234Palindrome Linked ListEasyFind middle, reverse the second half, compare halves.recursion
142Linked List Cycle IIMediumAfter they meet, a pointer from head meets slow at the entrance.cycle detection
143Reorder ListMediumSplit at the middle, reverse the tail, then interleave.reordering
2095Delete the Middle NodeMediumKeep a prev for slow so you can unlink the middle.fast & slow
2130Maximum Twin SumMediumReverse the second half; sum node i with its twin.recursion

4. Fixed-Gap Two Pointers

A constant offset between two cursors turns "from the end" and "intersection" into one pass.

#ProblemDifficultyThe one insightPost
160Intersection of Two Linked ListsEasySwitch heads at the end; both walk a + b and meet.traversal
19Remove Nth Node From EndMediumOpen a gap of n, then walk both; a dummy handles removing the head.fast & slow
61Rotate ListMediumClose the list into a ring, then cut len - k%len along.rotation
1721Swapping Nodes in a Linked ListMediumThe k-th from start and k-th from end via one fixed gap.fast & slow
2058Min/Max Between Critical PointsMediumTrack first and last local extremum; min gap is adjacent extrema.traversal

5. Reverse a Segment

The three-pointer loop, applied to the whole list, a sub-range, or fixed blocks.

#ProblemDifficultyThe one insightPost
206Reverse Linked ListEasySave–rewire–advance; prev ends as the new head.reversal
24Swap Nodes in PairsMediumk-group reversal with k = 2; a dummy anchors the relinking.k-group
92Reverse Linked List IIMediumReverse only [m, n]; remember the node before and the future tail.k-group
369Plus One Linked ListMediumReverse (or recurse) to propagate a carry from the least digit.arithmetic
445Add Two Numbers IIMediumReverse both (or use stacks) so digits align by place value.arithmetic
25Reverse Nodes in k-GroupHardReverse each full block of k; leave a short remainder as is.k-group

6. Build Two Lists and Stitch

Thread each node onto one of two running chains, terminate, and join.

#ProblemDifficultyThe one insightPost
86Partition ListMediumTwo dummies for <x and ≥x; terminate the second or you cycle.partitioning
328Odd Even Linked ListMediumOdd chain and even chain by position; join odd-tail to even-head.partitioning
725Split Linked List in PartsMediumCount length, give the first len % k parts one extra node.partitioning
1669Merge In Between Linked ListsMediumWalk to a-1 and b+1, splice the second list into the gap.partitioning
2181Merge Nodes in Between ZerosMediumAccumulate a running sum, emit a node at each zero boundary.arithmetic

7. Merge / Divide and Conquer

The dummy-tail two-way merge, and everything built on it: k-way merge, merge sort, sorted conversions.

#ProblemDifficultyThe one insightPost
21Merge Two Sorted ListsEasyDummy tail; splice the smaller head, then attach the remainder.merging
147Insertion Sort ListMediumMaintain a sorted prefix; walk from a dummy to find each slot.sorting
148Sort ListMediumMerge sort is the list sort; bottom-up gives O(1) space.sorting
109Convert Sorted List to BSTMediumInorder build: consume the list left-to-right as you construct.sorting
1367Linked List in Binary TreeMediumDFS from every tree node, matching the list as a downward path.recursion
23Merge k Sorted ListsHardMin-heap of heads, or pairwise divide and conquer: O(N log k).merging

8. Hash Map + List & Design

Compose a map for lookup with a list for order. The densest and highest-signal group in interviews.

#ProblemDifficultyThe one insightPost
705Design HashSetEasySeparate chaining: an array of buckets, each a small list.singly list
1290Binary Number to IntegerEasyShift the accumulator left, OR in each bit as you walk.arithmetic
138Copy List with Random PointerMediumWeave clones between originals to resolve randoms in O(1) space.clone
146LRU CacheMediumHash map to nodes of a doubly linked list; move-to-front on use.LRU cache
355Design TwitterMediumPer-user tweet lists; merge k of them for the feed.merging
622Design Circular QueueMediumA ring: head and tail indices, or a circular linked list.circular
382Linked List Random NodeMediumReservoir sampling: keep each node with probability 1/i.traversal
1472Design Browser HistoryMediumA doubly linked list of pages; visit truncates the forward tail.doubly list
430Flatten a Multilevel Doubly Linked ListMediumDFS: splice each child list in before continuing on next.flatten
114Flatten Binary Tree to Linked ListMediumReverse-preorder threading, or Morris-style right-spine splicing.flatten
460LFU CacheHardFrequency buckets, each a list; track the current min frequency.LFU cache

A Four-Week Study Order

Do these in order. Each week builds on the last; do not jump to Week 4 designs before reversal and merge are automatic.

WeekThemeProblems, easy first
1Fundamentals & traversal206, 876, 21, 83, 141, 203, 234, 160
2Pointer surgery & reversal24, 92, 19, 82, 86, 328, 61, 25
3Fast–slow, merge, sort, arithmetic142, 143, 147, 148, 2, 445, 2095, 23
4Design & advanced structures146, 138, 622, 1472, 430, 355, 707, 460
The 15-problem shortlist. If you have one evening, not one month, do exactly these and you will have touched every pattern: 206, 92, 25, 21, 23, 19, 141, 142, 876, 234, 143, 148, 86, 138, 146.

The Five You Are Most Likely to Get

Across real phone screens and on-sites, these five dominate. Know exactly what each is probing.

#ProblemWhat it is really testing
206Reverse Linked ListWhether the three-pointer loop is truly automatic, and whether you can also give the recursive version and its O(n) stack cost.
21Merge Two Sorted ListsThe dummy-tail idiom and clean remainder handling — the primitive behind merge sort and merge-k.
142Linked List Cycle IIFloyd's algorithm and, crucially, whether you can explain why resetting to the head finds the entrance.
19Remove Nth From EndThe fixed-gap two-pointer trick and the empty/head edge cases a dummy makes disappear.
146LRU CacheComposing a hash map with a doubly linked list for O(1) get and put under time pressure — the classic design ask.

Check Yourself

You are given a problem. Pick the optimal technique and its complexity.

How to Practise

The catalog is only useful if you practise it the right way. Four rules turn "I solved it" into "I own it":