Amazon Interview Question for Testing / Quality Assurances






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

1.Array containing at least two elements.
2.arrays having the same data type as that in function.
3.Array with only one dimension no two dimensional arrays.
4.Arrays containing only primitive data .Array should be containing pointers to some other elements.
5.All Arrays with size >=2 but having all indexes being initialized or being static in nature.for e.g. int a[5]={1}; would be an invalid input array to this function.

- Algorithmist February 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This is a good answer

- AJB September 02, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good answer

- Raghunath March 22, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

1)find largest element in n-1. Again find largest element excepting that element in n-2. total comparisons 2n-3 i.e, O(n)
2)maintain 2 variables lar and secLar and in single loop find second largest by comparing largest with array element and secLar with lar. best case comparisons n-1, worst case 2(n-1) {increasing array} still it is O(n)
3)Order statistic blum et. al , find nth largest element in O(n).

- Roxanne September 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

read the question before attempting an answer

- Mahesh October 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Array size should be between 2 and int max size.(depends on int size, assuming int array)

- Messi September 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can someone please explain the question?

- Anonymous November 19, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

array of numbers in descending order
array of numbers in aescending order
araay of numbers which is not sorted
array of negatives numbers which is not sorted
array of negatives numbers which is sorted in ascending and descendng orrder

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

array=null.
array of size 0.
array of size 1.
array of size2.

arent these valid inputs to the function?

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

array=null.
array of size 0.
array of size 1.
array of size2.

arent these valid inputs to the function?

- nk August 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Please tell me what if duplicate elements are present in array...
Like a = [2,7,3,7]

- Anonymous November 05, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Its valid input

- rawat011 May 27, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Valid arrays could be anything that is accepted by this fucntion as arguments.
The interviewer must have asked this question to indirectly test your analytical abilities.

- nk September 02, 2012 | 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