Amazon Interview Report
- 4of 4 votes
AnswersConsidering a stream of integers coming in. Design a datastructre to store only n of them. Insert if if does not exist in the datastructre. And if it reaches n, remove the first one inserted into the datastructure.
- anonymous August 11, 2013 in India
Datastructure should provide, addition, deletion and search all in O(1) time.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures - 2of 2 votes
AnswersGiven 3 Arrays of integer sorted in ascending order, get the sum of minimum difference using one element from each array.
- anonymous August 11, 2013 in India
where a, b, c are the elements from each array.
diff = |a-b| + |b-c|+|c-a|
complexitiy: worst case O(n)| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.