Keysight Technologies interview question

Write a code to reverse a linked list.