Infosys interview question

Reverse the linked list