Linked lists interview questions
Reversal, fast and slow pointers, cycles, merging and reordering.
13 questions solved with this pattern, most asked first. Reported by candidates in public interview write-ups and reworded by Scrivio. How the reports are counted
Your progress: 0 of 13 done, 0 saved
Write code that reverses a singly linked list.
Reported 156 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2017, geeksforgeeks.org 2023, geeksforgeeks.org 2016
Detect whether a singly linked list contains a loop.
Reported 119 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2021, geeksforgeeks.org 2021, geeksforgeeks.org 2019
Return the middle node of a singly linked list.
Reported 80 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2014, geeksforgeeks.org 2012, geeksforgeeks.org 2021
Merge two sorted linked lists into one sorted linked list.
Reported 59 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2021, geeksforgeeks.org 2021, geeksforgeeks.org 2020
Reverse the nodes of a linked list in groups of k.
Reported 59 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2019, geeksforgeeks.org 2017, geeksforgeeks.org 2017
Detect a loop in a linked list and remove it.
Reported 47 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2016, geeksforgeeks.org 2024, geeksforgeeks.org 2024
Make a deep copy of a linked list where each node also has a random pointer.
Reported 45 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2021, geeksforgeeks.org 2020, geeksforgeeks.org 2020
Find the node where two singly linked lists merge.
Reported 43 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2016, geeksforgeeks.org 2016, geeksforgeeks.org 2017
Add two numbers stored as singly linked lists of digits.
Reported 42 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2022, geeksforgeeks.org 2017, geeksforgeeks.org 2017
Delete a node from a linked list when you are given only a pointer to that node.
Reported 32 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2024, geeksforgeeks.org 2013, geeksforgeeks.org 2017
Find the nth node from the end of a linked list.
Reported 26 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2017, geeksforgeeks.org 2024, geeksforgeeks.org 2019
Detect whether a linked list contains a loop and, if it does, find the loop's length.
Reported 20 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2020, geeksforgeeks.org 2024, geeksforgeeks.org 2017
Rotate a linked list to the right by k positions.
Reported 15 times
Read the solutionLinked listsExample sources
3 of the write-ups counted: geeksforgeeks.org 2024, geeksforgeeks.org 2022, geeksforgeeks.org 2020