Invensys interview question

reverse a linked list recursively