IndiaMART Interview Question

write a code for reversing a linked list.