Pergunta de entrevista da empresa Amazon

Reverse a linked list in O(N), the most optimized solution was expected