Google interview question

Write a function for reversing a linked list