Walmart interview question

write a code to reverse a linked list