Linked List Summary Resource - aloalgo

Linked List Summary

A quick reference for linked list techniques and problems to practice. A linked list is a linear data structure where each element (node) contains a value and a pointer to the next node. Unlike arrays, linked lists do not store elements in contiguous memory, which means insertions and deletions at any position take O(1) time if you have a reference to the node, but accessing an element by index takes O(n).Linked list problems in interviews are fundamentally about pointer manipulation. They test your ability to carefully manage references between nodes while avoiding common pitfalls like losing track of pointers or creating null reference errors. The good news is that there are only a handful of core techniques, and once you master them, linked list problems become very predictable.

Key Techniques

Most linked list problems can be solved using one or more of the following four techniques. Recognizing which technique applies is the first step to solving any linked list problem efficiently.
TechniqueUse When
Fast & Slow PointersFinding middle, detecting cycles
Dummy NodeHead might change, building new list
Two Pointers with GapNth from end, maintaining distance
Reverse PointersReversing list or portion of list

Chapters

See also: Fast & Slow Pointers in the Two Pointers section for cycle detection and finding the middle.

Practice Problems

Easy

Medium

Hard

Common Mistakes

Linked list bugs are notoriously tricky because they often produce correct-looking output for simple cases but fail on edge cases. Here are the most common mistakes to watch out for:
  1. Losing references: Save pointers before overwriting them. When reversing a list, for example, you need to save the next node before pointing the current node backward, or you will lose the rest of the list.
  2. Null pointer errors: Always check if a node exists before accessing its properties. This is especially important at list boundaries and when the list might be empty.
  3. Forgetting to return new head: After modifications, the head may have changed. Using a dummy node that points to the head eliminates this issue entirely.
  4. Off-by-one errors: Clarify if "nth from end" is 0-indexed or 1-indexed. Drawing out a small example and counting nodes manually can prevent these mistakes.
Was this helpful?
© 2026 aloalgo. All rights reserved.