Linked Lists Interview Questions & Solutions
22 solutions ยท 6 Easy ยท 14 Medium ยท 2 Hard
Linked list problems are a test of careful pointer manipulation more than clever algorithms. There's no random access, so everything is about walking nodes and rewiring `next` pointers without losing track of the rest of the list. The number-one cause of bugs here is dropping a reference before you're done with it โ which is exactly what interviewers are checking you can avoid.
The solutions below drill the handful of techniques that cover most interview questions: reversing a list (iteratively and recursively), the fast-and-slow two-pointer trick for finding the middle and detecting cycles, merging sorted lists, and removing the n-th node from the end in a single pass. A recurring tip you'll see throughout is the dummy head node โ a small trick that eliminates a whole class of edge-case bugs when the head itself might change. Draw the pointers on paper as you read, and the "gymnastics" become routine.
- Merge Two Sorted ListsEasy
- Middle of the Linked ListEasy
- Palindrome Linked ListEasy
- Remove Duplicates from Sorted ListEasy
- Remove Linked List ElementsEasy
- Reverse Linked ListEasy
- Add Two NumbersMedium
- Copy List with Random PointerMedium
- Delete the Middle Node of a Linked ListMedium
- Merge In Between Linked ListsMedium
- Odd Even Linked ListMedium
- Partition ListMedium
- Remove Duplicates from Sorted List IIMedium
- Remove Nodes From Linked ListMedium
- Remove Nth Node From End of ListMedium
- Reorder ListMedium
- Reverse Linked List IIMedium
- Rotate ListMedium
- Sort ListMedium
- Swap Nodes in PairsMedium
- Merge K Sorted ListsHard
- Reverse Nodes in K-GroupHard
Practice Linked Lists the right way
SkillFlow serves you Linked Lists problems matched to your level, times you like a real interview, and tracks your proficiency as it climbs. Free.
Start practicing free โ