BNY Interview Question

sort an linked list and find middle node