Semgrep interview question

How would you reverse a linked list?