Amdocs interview question

reverse linked list