Amazon Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Could you please explain why in sample 1 The “total request finish time” of input is 14; and output is 10?

2. “total request finish time” of input is 19; and output is 15?

- datacoder October 23, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

first example:
finish time of inut with out any reordering
id:1 time to finsh : 4
id:2 time to finish : 2
id:3 time to finsh : 4
id:4 time to finish : 4
sum = 14
time to finish is to finish last sub request
time to finish output
id:1 time to finsh : 1
id:2 time to finish : 2
id:3 time to finsh : 3
id:4 time to finish : 4
totol sum = 10

I hope this explains how to calculate for second input also

- RAM October 26, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Solution for offliine instance:

create N min proirity queues for N servers
give priority to each id = no of sub requests

this will finish request with few sub request first then go for huge subrequest it will reduce total finish time. Please let me know if you have another efficient solution

- RAM October 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Sample Output 2:
2 1 6
3 1 5 4
2 1
2 1 6 4
3
6 5

so the cost is 14

- Phil January 12, 2014 | 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