Amazon Interview Question for Quality Assurance Engineers


Team: Kindle
Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
7
of 11 vote

A(5L) B(3L) C(Big)
---------------------------
0 0 9.5
0 3 6.5
3 3 3.5
5 1 3.5
0 1 3.5 (5L waste)
1 3 0.5
4 0 0.5

- Laks January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I can't come up with solution other than this...

- Kk January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

The sequences
0 3 6.5
3 3 3.5
&
0 1 3.5 (5L waste)
1 3 0.5
actually consists of 3 steps each. Wastage is more(5L) than in my case(1.5L)

- Murali Mohan January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

The solid ans which works even in case water source is 'water tab' not any container

- PKT January 12, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Since RTUser says u can't pour the water back to pool , this solution fits perfect to the situation

- Pras January 19, 2014 | Flag
Comment hidden because of low score. Click to expand.
4
of 6 vote

In SIX Steps with No Water Wastage..
Initially.. 0,0,9.5
step1: 5,0,4.5
step2: 2,3,4.5
step3: 2,0,7.5
step4: 0,2,7.5
step5: 5,2,2.5
step6: 4,3,2.5

- Mradul gupta January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

@mrudal does this solution feasible one??? the question says minimal water wastage and minimal steps ...

- Rashmi BS January 12, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Rashmi....i think according to question it's not compulsory to waste the water....and the question says minimum water wastage so i minimized the wastage of water upto atleast level....

- Mradul January 12, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 votes

there was one more condition that once you taken out water from the pool you can not put back.

- Sachdefine January 13, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 votes

@ RTUser.........Plz specify question precisely....

- Mradul January 13, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

u cannot use 3 jars . 
water wastage will be 5L

- BM July 09, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 3 vote

But you cannot use 3 jars

- SachinK January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 5 vote

From the problem statement, wastage can only happen if the user is allowed to use two jars only.

According to that assumption, I could think of following solution;
Fill the ---
5L 0
2L 3L
2L 0 (3L wastage)
0 2L
5L 2L
4L 3L => (6 attempts)

- Kumar_M January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 votes

You are using 10 lts, whereas, you only have 9.5 lts in the pool. No?

- Ajith January 13, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

5L 3L 9.5L

0 0 9.5
0 3 6.5
3 0 6.5
3 3 3.5
5 1 3.5
0 1 3.5 (-5L)
1 0 3.5
1 3 0.5
4 0 0.5

- amit deol January 28, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Let the water be distributed in the 3 jars(separated by commas) as below.

Initially:
0L,0L,9.5L, Distribute them into 5L and 3L jars as below:
5L,3L,1.5L Now throw away the 1.5 (wastage = 1.5L) so the distribution becomes

5,3,0. From here...
5,0,3
2,3,3
2,0,6
0,2,6
5,2,1
4,3,1 (Four is captured inside the 5L can in a total of 8 steps.)

- Murali Mohan January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

u cannot use 3 jars ..there are only 2 jars given to be used !!!

- Bharti July 09, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

4 steps :
1.First fill 3L and pour it into 5L and now 5L container has 3L and 2L empty
2.another 3L into 5L, so 1L will be left in 3L container
3.clear the 5L and fill it with 1L that was left in 3L
4.fill 3L into the 5L , hence 4L.

- gopinath January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The total number of steps in your procedure is 9 as opposed to 4 that you are thinking.

Each of the step listed by you indeed involves two steps:
>>. 1.First fill 3L and pour it into 5L and now 5L container has 3L and 2L empty
Filling the 3L can is one step and pouring it into 5L is another step
>> 2.another 3L into 5L, so 1L will be left in 3L container
Refilling 3L is one step and filling up 5L from 3L so 1L remains in the 3L is yet another step
>> clear the 5L and fill it with 1L that was left in 3L
Two steps again
4. fill 3L into the 5L , hence 4L.
How can you directly fill 3L into 5L can? You first have to fill the 3L can and only then will you be able to measure 3L. This step actually involves 3 steps:
I. First, you transfer the 1L from 3L can to 5L can
2. Fill up the 3L can
3. Transfer from 3L can to 5L can, which will then make up 4L

- Murali Mohan January 12, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

See the water which has been thrown out is only 3L which is in step 4th that is 2, 0, 3

- Sachdefine January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It can be done in following way but I don't know its minimal wastage or not...
I am assuming we can only use two jar not 3
5,3,9.5
-------------------
0,3,6.5
3,0,6.5
3,3,3.5
5,1,3.5
1,0,3.5
1,3,0.5
4,0,0.5
done
I understand wastage is 9L..., but this the only way I could think of using two jars

- Tester January 14, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

5 steps, no waste.
0,0,9.5
1) 3,0,6.5
2)0,3,6.5
3)3,3,3.5
4)1,5,3.5
5)4,2,3.5

- gmgdd January 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

0 Ltrs, 0 Ltrs, 9.5 Ltrs (Given)

5 Ltrs, 2 Ltrs, 2.5 Ltrs (Now given changes to)

4 Ltrs, 3 Ltrs, 2.5 Ltrs (Given remains the same)

- dsr January 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Everyone is over thinking the problem. Assuming you have 5L and 3L beaker, and 9.5L of water....

1) Put the 3L beaker inside the 5L beaker, fill the remaining space inside the 5L beaker to the rim with water. You should now have 2L of water in the 5L beaker, transfer that water into the 3L beaker.

2) Repeat the same motion, you should now have 2L of water inside the 3L beaker, and another 2L of water inside the 5L beaker, which equals a total of 4L!!!

two steps, no water wasted. Don't over think life.

- easydoesit January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Pour half to 5 ltr i,e 2.5 ltr and full to 3 ltr , remaining water is 9.5-2.5-3 = 4ltr

- PHada February 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

9.5L 5L 3L
9.5 0 0
1.5 5 3
0 5 3
3 2 3
6 0 2
1 5 2
1 4 3

- kk February 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Fill 5L can , pour 3L to 3L can.
2. put remaining 2L in 5L can to 3L can.
3. Fill 5L can and pour 1L of the 5L to 3L can.
Now you have 4L in the 5L can

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

0 0 9.5
5 0 4.5
2 3 4.5
2 0 7.5
0 2 7.5
5 2 2.5
4 3 2.5

- Maddy.88k March 16, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

fill 5l transfer 5 to 3 remaining 2 l
do same process 2l exists
2l+2l=4l

- bhavani March 28, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Step1 : Pour from 3L to 5L.
Step2 : Now 5L has 3L and 3L flask empty. Fill the 3L flask and pour into 5L flask.
Step3: Now 5L flask is full and 3L flask has 1L remaining.
Step4: Throw the water from 5L flask and get the 1L from 3L flask.
Step5: Fill the 3L flask with water and pour into 5L which already has 1L in it. Altogether it makes 4L in flask 5L.

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

3 5 9.5l
0 0 9.5
3 5 1.5
3 5 0 (1.5 - waste)
3 0 5
0 3 5
3 3 2
0 5 2 (1l - waste)
3 2 2
3 4 0

- vsagar June 09, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

step1: pour 5L in 3L (you will have 2L in 5L container)
step2: empty 3L container and now pour remaining 2L (from 5L container ) in 3L
Step3: fill 5L container again
step4: pour 5L container now in 3L container which already has 2L water, so it can only contain extra 1L.

So in 5L container you will have exact 4L

- vishal June 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

step1: pour 5L in 3L (you will have 2L in 5L container)
step2: empty 3L container and now pour remaining 2L (from 5L container ) in 3L
Step3: fill 5L container again
step4: pour 5L container now in 3L container which already has 2L water, so it can only contain extra 1L.

So in 5L container you will have exact 4L

- vishal June 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

first fill the 3L and pour it in the 5L and again do the same by filling the 5L completely now there is 1L of water is remaining in the 3L and pour it to the 5L and now fill the 3L and pour it again in the 5L now there is exactly 4L of water in the 5L bottle with the wastage of 5L of water

- G.Sridhar July 05, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Put the 3L container into the 5L (supposed more large).
Fill the 5L (2L).
Put the content into the 3L.
Repeat :
Put the 3L container into the 5L (supposed more large).
Fill the 5L (2L).
Pour the 3L container into the 5L.

No waste

- John Doe May 10, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

9.5;0;0
1.5;5;3 (1.5 waste)
0;5;3
3;2;3
6;2;0
6;0;2
1;5;2
1;4;3

- Ramona Sonoc August 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

#include<studio.h>
#include<conio.h>
return();
int;
char[ ] [ ]

- priyanka January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

5 3
---------------------------
5 0
2 3
2 0
0 2
4.5 2
4 2.5

- SachinK January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

@ Sachin your solution in the last step doesn't work. could you please tell me how will you measure 0.5 litre using 5 or 3 litre jar???

- Rashmi BS January 12, 2014 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

vol(A) - 5, vol(B) - 3, water thrown/wasted
0, 0, 0
5, 0, 0
2, 3, 0
2, 0, 3
0, 2, 3
5, 2, 3
4, 3, 3
in A I get 4L with wastage of 3L

- User123 January 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Fantastic answer.. I don't think it can be optimized more.

- Sachdefine January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Max water is 9.5L. You have used 10L

- Its wrong. January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

But I can see only 3 Ltr wastage.

- Sachdefine January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

that last step is 4,3,3 so total water is 10. So wrong..

- User123 January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Fill the 5. Pour slowly into the 3 until the bottom of the 5 container is almost exposed. That is 2.5. Using the water already in it, do the same with the 3, that is 1.5. Pout that into the big container 2.5+1.5 = 4
total wastage 2.5-1.5 = 1 litre.
4 steps


/
/ /
/ /
/

- KK January 20, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol...

- Blah January 20, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

rofl

- Amit February 18, 2014 | 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