Basic Linked List Problems for Coding Interviews
31 basic Linked List problems from real coding interviews, each with test cases you can run online. By difficulty they split into 31 basic, 0 intermediate and 0 advanced. The companies that ask them most often are Amazon, Google, Bloomberg, Meta.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Remove Nth From End (Basic)
- Reverse Linked List (Basic)
- Merge Two Sorted Lists (Basic)
- Palindrome Linked List (Basic)
- Delete Nodes Listed in an Array (Basic)
- Middle of the Linked List (Basic)
- Merge Nodes Between Zeros (Basic)
- Split Linked List Into Parts (Basic)
- Delete the Middle Node (Basic)
- Insert GCDs Between Adjacent Nodes (Basic)
- Binary Linked List to Integer (Basic)
- Plus One Linked List (Basic)
- Merge Two Lists Alternately (Basic)
- Element Frequencies in a Linked List (Basic)
- Kth Node From End (Basic)
- Remove Every Kth Node (Basic)
- Odd Values Before Even Values (Basic)
- Sort a List of 0s 1s and 2s (Basic)
- Insert Into Sorted Linked List (Basic)
- Remove Linked List Elements (Basic)
- Delete N Nodes After M Nodes (Basic)
- Zigzag Linked List (Basic)
- Interleave List Halves (Basic)
- Prefix Sums of a Linked List (Basic)
- Sorted Union of Two Lists (Basic)
- Sorted Intersection of Two Lists (Basic)
- Reverse Second Half of a Linked List (Basic)
- Delete Nodes at Prime Positions (Basic)
- Fill Gaps Between Adjacent Nodes (Basic)
- Group Sums of Every K Nodes (Basic)
- Move Minimum Node to the Front (Basic)
Related
Frequently asked questions
How do I get good at linked list problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run linked list problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.