Adobe Interview Question for Developer Program Engineers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
3
of 9 vote

Use max heap of k size, update(Heapify) it whenever new number comes

- shani July 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

should use min heap, which will tell you the smallest number in the heap (which is the kth largest in the stream). max heap does not tell you that.

- Daru July 04, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

yes, we should use minimum heap in this case, insert first k numbers to minimum heap. Now for every other number just check with the root of heap, if its less than the root of the min heap( that is smallest element) do nothing but if its greater than the root of the min heap, remove the root and in its place insert the new element ,apply min heap on root.This way every time heap will represent first k maximum number)

- DJ July 17, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

can you elaborate with example?

- Arulmozhi July 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

when u put the question please put with some input and expected output. The Question is sometimes not understandable.

- Anonymous July 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes

- dex August 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Is the question means the following.
Input : 2 5 6 8 4 85
Maximum 2 numbers are 85,8
Maximum 10 numbers will return in a message saying "there is no sufficient input"

- Samurai July 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Right

- dex August 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can use a Binary search tree to insert the numbers and return k numbers from the reverse of the In order traversal.

- Samurai July 07, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More