PharmEasy interview question

Reverse a linked list, complete code with all test cases covered.