Cognizant interview question

Reverse the linked list using java