Amazon Interview Question for Software Engineer / Developers






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

Can you clarify the problem?

- Anonymous June 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can you explain the problem little bit more. It seems that services are like a circular queue, and the order are put in one by one. now when m>n then you dont have services left to process the order. It can be solved if you dynamically add few more services.
Thanks,
DKJHA

- dhirejha June 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

No. These are just service instances. Each represents an instance of the same service... same program, various running instances.
so orders are all stored in the database
and each service handles only those orders which hash to it by the rule:
orderid % m + 1 = service id.

- someone June 29, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

load balancing algorithm

- Anonymous June 29, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If the order ids are random integer, then it's likely at a particular time some of the service s_i may have no order to process, whereas some service s_j has more than 1 orders to process. So this is some balancing issue. A simple approach could be counting each services status dynamically. The given static approach takes O(1) time for assignment with balancing problem, dynamic approach would take O(n) time which may alleviate this problem.

Any useful link/tutorial for load balancing issues? Wiki entry doesn't have much details.

- Anonymous June 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

search for "persistent hashing"

- Jing July 07, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if m<n then service 1 will never be used.So i think this is the problem.

- JiM.iiitm July 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if N is greater than M, then there might be a chance that the order is not assigned to the service. I think may be the question is put incorrectly. I think it should be S_n % j should go to Oj. I am taking it as a Hashing problem.

- ekapil2 November 15, 2010 | 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