Qualcomm Interview Question

Write a function to reverse the linked list