PATTERN 5: Linked List Thinking (Pointer Manipulation Mastery)

D

Qubits of DPK

April 11, 2026

Core DSA
This should sit between:
Pattern 4 (Two Pointers)
and
Pattern 6 (Sorting & Ordering)
Because Linked List builds on:
  • Traversal
  • Two pointers
  • Pointer control
  • Edge case awareness

Core Idea (lock this)

“You don’t have indices. You only have pointers.”
Linked List problems are about:
  • Rewiring connections
  • Controlling next pointers
  • Avoiding null pointer mistakes
If arrays are about indexing,
Linked Lists are about reference control.

How to Recognize This Pattern

Think Linked List when:
  • Problem explicitly uses nodes
  • You must:
  • You hear:
Trigger words:
  • “cycle”
  • “reverse”
  • “middle”
  • “merge”
  • “reorder”

30 MUST-DO INTERVIEW PROBLEMS

EASY (Pointer Control Basics)

  1. #
    Reverse Linked List — LC 206
  2. #
    Middle of Linked List — LC 876
  3. #
    Linked List Cycle — LC 141
  4. #
    Merge Two Sorted Lists — LC 21
  5. #
    Remove Linked List Elements — LC 203
  6. #
    Delete Node in Linked List — LC 237
  7. #
    Palindrome Linked List — LC 234
  8. #
    Remove Duplicates from Sorted List — LC 83
  9. #
    Intersection of Two Linked Lists — LC 160
  10. #
    Convert Binary Number in Linked List to Integer — LC 1290
After these:
You must be comfortable with:
  • Slow–fast pointers
  • Dummy node technique
  • Pointer rewiring

️ MEDIUM (Structural Manipulation)

  1. #
    Reverse Linked List II — LC 92
  2. #
    Reorder List — LC 143
  3. #
    Swap Nodes in Pairs — LC 24
  4. #
    Rotate List — LC 61
  5. #
    Remove Nth Node From End — LC 19
  6. #
    Add Two Numbers — LC 2
  7. #
    Add Two Numbers II — LC 445
  8. #
    Odd Even Linked List — LC 328
  9. #
    Partition List — LC 86
  10. #
    Maximum Twin Sum of Linked List — LC 2130
This section tests:
  • Controlled pointer rewiring
  • Multi-step logic
  • Dummy nodes
  • Edge cases

HARD (Pointer Engineering)

  1. #
    Reverse Nodes in k-Group — LC 25
  2. #
    Merge k Sorted Lists — LC 23
  3. #
    Sort List — LC 148
  4. #
    Flatten a Multilevel Doubly Linked List — LC 430
  5. #
    Design Skiplist — LC 1206
  6. #
    Remove Zero Sum Consecutive Nodes — LC 1171
  7. #
    Reverse Nodes in Even Length Groups — LC 2074
  8. #
    Linked List Cycle II — LC 142
  9. #
    Insert into Sorted Circular Linked List — LC 708
  10. #
    Split Linked List in Parts — LC 725
Now you're in pointer surgery territory.

Why Linked List Must Be Separate

Because Linked List teaches:
  • Edge case discipline
  • Null safety
  • Pointer confidence
  • Dummy node trick (interview gold)
Many strong coders fail interviews due to pointer bugs.
This pattern prevents that.

INTERVIEW REVISION CARD — Pattern 5

1️⃣ Pattern in One Line

"Rewire next pointers in-place — you don't have indices, only references."

2️⃣ Recognize It When...

  • Input is explicitly a linked list
  • Problem says "in-place", "O(1) space", "constant memory"
  • Trigger words: "reverse", "cycle", "middle", "merge", "reorder"
  • Must avoid using extra arrays

3️⃣ Don't Confuse With...

  • Two Pointers (P4) → arrays use indices; linked lists use node references
  • Tree Recursion (P11) → trees have two children; linked lists are linear
  • Hashing (P2) → cycle detection can use hash but Floyd's is O(1) space

4️⃣ Approach in 3 Steps

  1. #
    Always draw the pointer rewiring on paper first
  2. #
    Use dummy node to handle edge cases at head
  3. #
    Save next pointer BEFORE rewiring — never lose your reference

5️⃣ Invariant to Maintain

"At every step, I have not lost any node reference — prev, curr, next are all accounted for."

6️⃣ Complexity to Justify

  • Time: O(N) — single pass for most problems
  • Space: O(1) — in-place pointer manipulation
  • Why: No auxiliary array, just pointer rewiring

7️⃣ Edge Cases to Always Check

  • Null head (empty list)
  • Single node list
  • Two node list
  • Cycle present when not expected
  • Even vs odd length list

8️⃣ One Line to Say in Interview

"I'll manipulate pointers in-place using a dummy node to handle edge cases, achieving O(N) time and O(1) space."