IBM interview question

Reversing the linked list