The Remove Nth Node From End of List interview question asks you to delete the node that is exactly n positions from the end of a singly linked list, then return the head of the modified list. The challenge is to do this in a single pass through the list, without first counting the total length.
This problem is a staple at Apple, Uber, Goldman Sachs, Microsoft, Meta, Amazon, Google, Bloomberg, and Adobe because it is the canonical demonstration of the two-pointer (fast/slow) technique applied to linked lists. The problem is simple enough to code quickly but tricky enough that candidates without the two-pointer intuition will instinctively make two passes. It also tests dummy-node usage for clean head-deletion handling.
The pattern is the two-pointer linked list technique with a dummy head. Create a dummy node pointing to head. Set fast and slow both to dummy. Advance fast exactly n+1 steps. Then advance both fast and slow simultaneously until fast is null. At this point, slow is the node just before the target node. Set slow.next = slow.next.next to remove the target node. Return dummy.next.
List: 1 → 2 → 3 → 4 → 5, n = 2.
Result: 1 → 2 → 3 → 5.
fast exactly n steps instead of n+1, causing slow to land ON the target node rather than before it.n+1 steps, especially when n equals the list length.For the Remove Nth Node From End of List coding problem, the two-pointer linked list interview pattern is the golden solution. Memorize the formula: advance fast n+1 steps, then move both pointers together. The dummy node ensures zero special-casing. Interviewers at Walmart Labs and TikTok sometimes ask "can you do it in one pass?" — the answer is yes, using exactly this technique. Trace through an example where n equals the list length to prove your dummy-node approach handles it.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Rotate List | Medium | Solve | |
| Remove Duplicates from Sorted List II | Medium | Solve | |
| Delete the Middle Node of a Linked List | Medium | Solve | |
| Partition List | Medium | Solve | |
| Swapping Nodes in a Linked List | Medium | Solve |