Today, let's go over a very common interview question that's asked and it is to reverse a singly linked list. The solution is to use a while loop and reverse out pointers. However, because the implementation is a little difficult to follow, let's first go through how we can print out all the nodes first.
I will then walk through how the reverse implementation changes the structure of our list. Finally, we'll see what our reversed head node becomes.