Publicis Sapient interview question

reversing a linked list , binary search