Qualcomm interview question

Write code to reverse a linked list.