Bloomberg Interview Question

Write a function that takes in a sorted array and removes duplicate elements from the list.

Interview Answers

Anonymous

Mar 22, 2015

It is important to clarify all the requirements for implementing above. Is the array in ascending/descending order? What would you do if size parameter is not given to you? How to take into account extremes (max integer value, etc.)? I didn't ask those questions and hence he drilled me on those after I implemented my code and hence messed up. Also I suppose I should have used hash table for checking duplicates.

Anonymous

Oct 10, 2015

Try using a TreeMap