Amazon Interview Question for Software Engineer / Developers






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

@seeksree is it asked in AMazon US or India..???

- Martin April 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Amazon US

- seeksree April 27, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

it will give u idea www dot ravenbrook dot com/project/mps/
also check wiki for memory pool in java we can use ByteBuffer allocate & clear method for allocating & freeing memory respectively

- wgpshashank April 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Was this onsite or phone?

- RandGuy April 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Onsite interview

- seeksree April 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

did they ask about Reference? It seems that SoftReference and ReferenceQueue can do this.

- byanmaro May 02, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The interviewer did not ask about reference. He gave hint about using specific ByteBuffer API methods to use.

- seeksree May 02, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Assume 4 bytes addressing: The first 4 bytes of buffer shall point to first free buffer.
Free Buffer: [--- 4 bytes address of next free buffer --][--- 4 byte buffer size ---][--- actual buffer of size mentioned in size --]

In-Use Buffer: [--- 4 byte buffer size ---][--- actual buffer of specified size --]

Mimimum size of allocation: 4 (next) + 4 (size) + 4 (atleast 4 bytes) = 12 bytes

When you want to allocate memory, traverse the free list and find the buffer aligned 4 byte boundary greater than or equal to size requested. If free buffer is 12 more than allocation size then split it and add it to free chain. Otherwise use the entire buffer.

To deallocate, traverse the list keeping the prev free list and current free list address. If they are adjacent then merge them in one. Also if the other adjacent buffer is free merge that as well.

- Ashish Kaila June 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Is it for USA OR India ?????????

- Rahul June 13, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 Question : How knowing the location will impact the solution ?

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

You have completely failed to understand the purpose of that question.

- Anonymous October 24, 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