Persistent Systems interview question

write a code to reverse singly link list