Redfin Interview Question

If you have an unsorted array of 1,000,000 elements, how would you sort this array?

Interview Answers

Anonymous

Nov 30, 2017

Iterate over the array and use a hashmap to store elements as keys and increment for every value it goes up by. Then, iterate over the hashmap in order to make a sorted array.

Anonymous

Jan 29, 2018

Huh? You can't sort this better than O(n log n) but nice try. Plus I don't see the "sorting" part in your answer. Your solution is more for removing duplicates.

Anonymous

Jul 6, 2018

bucket sort!?