Graphcore interview question

Reversing a linked list in python