Amazon interview question

Write a code for reversed singly linked list.