WellDev interview question

Implement a method to reverse a linked list