Amazon Interview Question for Software Engineer / Developers






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

Both have their limitations but being said the elements are arranged either in array or in linked list, the answer should be array. Because it has index associated with each element and also swapping is easy.

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

array has cache invalidation problems if you're trying to update...i would have said linked list for sort and array for search...

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

for searching both take linear time..
for sorting array seems faster but with skip list (complex implementation compared to array) can reach very near to array's sort.

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

Searching an unsorted array takes linear time, but you can do binary search on a sorted array.

- Anonymous June 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

for sorting both are equivallent i think because in both cases we can do o(nlgn)
optimal solution one exception is that we can apply the counting sort in arrys in O(n) time if the ranges of numbers are given but not in linked list
as far as searching is concerned i think array is much better ecause many times we have a sorted raay and to serach that by binary search we can do the binary serach in o(lg n) time but this will not going to be possible in the case of the linked lists.

- Anonymous July 02, 2011 | 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