UKG Interview Question

Write the code to reverse a linked list.