Infosys interview question

Q: Reverse a linked list