FreeCareerPath
Build the PrimitiveEasy

Reverse Linked List

Write `reverse_list(head)` returning the head of the reversed list. 1 -> 2 -> 3 becomes 3 -> 2 -> 1 Save the next node before you overwrite the current pointer, or the rest of the list is gone. Interviewers usually ask for the iterative version and then the recursive one, so have both.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Reverse Linked List" are saved to your account — logging in takes a few seconds.

Reverse Linked List — FreeCareerPath