NatWest Group interview question

2.reverse a linked list