Amazon.com

www.amazon.com

Interview Question

Senior Software Engineer Interview Seattle, WA

There are incoming numbers from a stream, print the largest

  1000 numbers.
Answer

Interview Answer

3 Answers

This post has been removed.
Please see our Community Guidelines or Terms of Service for more information.

0

Put them into a heap of size of 1000 and print it whenever u want!

Anonymous on May 6, 2012
0

“ There are incoming numbers from a stream, print the largest 1000 numbers. ”
How can you determine the largest N numbers if they are from a data stream? The stream has to stop, but at that point its no longer a stream just a set!
Did the interviewer phrase the question just as you described?

Anonymous on Oct 16, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.