Pergunta de entrevista da empresa Semgrep

How would you reverse a linked list?