JetBrains Interview Question

You have a single-linked list. Write code to reverse it.