NEC Corporation interview question

reverse a linked list