Amazon Interview Question for Software Engineer / Developers






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

2 scale needed ..
1> 1-50
2> 25-75
if(1==on&&2==on) weight is 25-50
if(1==on&&2==of) weight is 1-25
if(1==of&&2==of) weight is 75-100
if(1==of&&2==on) weight is 50-75

- awsomist October 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice soln...

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

two scales of 0-25 and 50-75 are needed.
Any weight between 25-50 &75-100 will be meaesured as follows:
measure two reference weights y1=>(0-25) and y2=>(50-75).
Now,for any unknown weight x, if both (x+y1)&&(x+y2) false=>
x belongs to (75-100) else (25 to 50) group.
correct me if wrong.

- vijay October 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

"you can weigh only 1 ball at a time"

- Sean December 08, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ans is 2

1st Scale category (1-50)
if BULB IS ON

- Nitin October 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Ans is 2

1st Scale category (1-50)
if BULB IS ON
2nd Scale Category (1-25)
if BULB IS ON
Put in Bucket A
if BULB IS OFF
Put in Bucket B
if BULB IS OFF
2nd Scale Category (50-75)
if BULB IS ON
Put in Bucket C
if BULB IS OFF
Put in Bucket D

- Nitin October 03, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Ans is 2

1st Scale category (1-50)
if BULB IS ON
{
2nd Scale Category (1-25)
{
if BULB IS ON
Put in Bucket A
else
Put in Bucket B
}
}
else
{
2nd Scale Category (50-75)
{
if BULB IS ON
Put in Bucket C
else
Put in Bucket D
}
}

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

Quick question,
what if the weight is 50.. where would you put it/?? 25-50 or 50-75??

- chennavarri October 04, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

If the weight is 50, we can keep in A or B. Its our choice..

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

2 scales needed
its a simple binary representation as we have 4 buckets
00
01
10
11

scale->	25-75	50-100	bucket
weights
  |
  v
 12	  0	  0	   A

 28	  1	  1	   B

 60	  1	  1	   C

 89	  0	  1	   D

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

A small edit to my example

scale->	25-75	50-100	bucket
weights
  |
  v
 12	  0	  0	   A

 28	  1	  0	   B

 60	  1	  1	   C

 89	  0	  1	   D

- ketz February 01, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The wording here is a bit unclear. Which category does a 25kg ball fit into? 0-25 or 25-50?

- Sean December 08, 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