Oracle interview question

They asked to write algorithm for reversing a linked list .