X interview question

Reverse linked list