Amazon Interview Question for Software Engineer / Developers


Country: United States




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

I would MSG.process() takes the most process and should allocate the most no. of threads. MSG.send() just need to send out the request and that's it. MSG.get() will only need to check whether there is new message and retrieve it.

- Jay March 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Msg.Get and Msg.send() are IO bound in the problem statement. So we do not want Msg.Process to wait for a long time to start processing. We should be able to send messages quickly in order to keep Msg.Process. We need 1 thread for Msg.Get for sure and it should be enough as Msg.Get is very lightweight operation.

So if there are n cores and 70% time goes in IO then 7 threads will be able to send 7 * (1-.7) = 2 messages will be sent per unit of time.
So we need 2 threads processors.

final answer is 7(msg.send) + 2(msg.process) + 1 (msg.get) = 10

- m March 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Assuming the question is asking about thread allocation at the server side specifically.

The number of thread allocation depends on the data on which is being worked on and the load the server is facing.

Please correct me if the argument is flawed. :-)

- nik March 22, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

wrong!

- Hello world August 09, 2013 | Flag


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