PayPal interview question

reverse linked list with given index