Pregunta de entrevista de Semgrep

How would you reverse a linked list?