Next Insurance interview question

A function to reverse to linked list.