F5 interview question

Sort and reverse a linked list