Samsung Electronics interview question

write a program to reverse a link list.