Amazon Interview Question for Software Engineer / Developers






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

Cant understand question.
by difference you mean angle betn hour hand and minute hand or 'number of mins"?
Or some else?

- Nik June 10, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

http://jdw6415.blogspot.com/2009/06/puzzle-difference-between-hour-and.html

- JD June 10, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

double GetAngle(double hh, double deltah, double mm, double deltamm)
{
return (30*(hh+deltah) - 5.5*(mm+deltamm));
}

To find the angle between the hands of a clock....
if "H" is the hours and "M" is the mins...then angle can be directly obtained by
ANGLE = 30H - (11/2)M
For example...when da time is 9:30...angle is
30*9 - (11/2)*30 = 270-165=105 degrees..

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

[1] Every hour, the hour hand moves 30 degrees
[2] Every minute, the minute hand moves 6 degrees
[3] For every minute, the hour hand moves 0.08 degrees

So, the difference between them in angles is (in C/C++):

diff = abs (((hour * 30) + (0.08 * min)) - (min * 6)))

- Girish Nandagudi June 24, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

[3] is wrong, Every minute the hour hand moves .5 degree

- Anonymous July 18, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

[1] Hour hand rotates 30 degree per hour thus .5 degree per minute.
[2] Minute hand rotates 6 degree per minute
so for a time HH:MM:00
Angle of Minute hand MAngle = MM * 6
Angle of Hour Hand HAngle = HH * 30 + MM * .5
Angle between the two is : abs (MAngle - HAngle)
Thanks,
Appy

- Appy July 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Girish Nandagudi's answer is fine with the replacement of .08 by .5 as mentioned by Anonymous.

- reema August 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(360/12)*(hrs%12) + (360/12)*(minutes/60) - 360*(minutes/60)

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

Try This:-

find find angles made by each hand with respect to 12.00p.m
AngleMinute = m*6
AngleHour = h*30 + 0.5*m

return AngleMinute - AngleHour

- provider April 12, 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