Bloomberg Interview Question

Phone interview 1. Remove duplicates from an unsorted singly linked list.

Interview Answer

Anonymous

Oct 2, 2015

It's a generic interview question and you can literally find an answer in every interview preparation book. I've used a hash table solution to get O(n) time and space complexity, but mentioned it is possible to solve this problem in O(n log n) time and O(1) space. You're also supposed to know about memory management, as list nodes are dynamically allocated.