Amazon interview question

Sort 100 million 10-bit integers extremely quickly

Interview Answers

Anonymous

1 Oct 2013

A 10 bit integer is max 1024 so use an array of size 1024. Then use each element as a counter for the number of occurrences. Ensure the elements are big enough to handle the potential count sizes.

Anonymous

27 Dec 2013

Bucket sort