← Whiteboard questions

Pattern

Linked List

Linked list problems change pointers in place, so draw the nodes and the arrows before you write code. Two pointers at different speeds find middles and loops, and a dummy node removes the special case at the head. Most solutions take O(n) time and O(1) memory.

Linked List interview questions and solutions