Amazon interview question

reverse linked list efficient way