Amazon Interview (on-campus - Software Dev Engineer) with answers/solutions
Round 0 (online): There was online test for 300 students. 25 were selected for interviews. There were 4 back-to-back rounds on the same day. Round 1: 1. Given 1 billion integers. Find 100 maximum integers. Memory available is insufficient to store 1 billion integers. Solution: Use a min heap of max size 100 (remember, heap can be implemented using array as it is a full binary tree). Compare every integer with value at 'root' of heap. if element>root_value remove root from heap. insert element in heap. Do this for all integers. 2. Given array of N integers ranging from 0 to N-1. Output maximum repeating integer. Use only O(1) memory.