## Amazon EFI Interview Question for Software Engineer / Developers

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

|5.5m - 30h|
If greater than 180, subtract from 360.
This accounts for the change in hour hand for every minute (There is 0.5 degree change in the hour hand for each minute).

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

Hour hand of a normal 12-hour clock turns 360° = 0.5° per minute = 30° per hour
Minute hand rotates through 360° in 60 minutes = 6° per minute.

SO, hour hand rotates = 4*30° + 40*0.5° = 140°.
and minute hand rotates = 40*6° = 240°

So the angle between them = 240-140 = 100°

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

theta = 30Y - 6X.

where 30 and 6 are the angles covered in 1 hr and 1 min respectively.
thus if time is 1hr 1 min. Then Y = 1, X = 1
so theta = 30-6 = 25deg

If X is 1 min then Y = 30/60 = 0.5
so theta = 30*0.5 - 6 as state above.

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

// hour's hand angle
(hr%12)*360/12 + (min%60)*30/60 (The 2nd part is the movement added by the min hand to the hr hand)

//min's hand angle
(min%60)*360/60

difference between (1) & (2) is the answer.

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

Assume time to be ( 'a' hours:'b' minutes: 'c' seconds)

a= a%12;
theta1 = (a + b/60 +c/3600)*2*pi/12 ;
theta2 = (b + c/60)*2*pi/60 ;

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

en.wikipedia.org/wiki/Clock_angle_problem

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

let time is X:Y(like 7:15) then angle=60X(1/2)+(1/2)Y-6Y=(30X-(11/2)*Y)%360

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

Answer: 100 degrees. Is it correct?

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

The angle between them (in degrees) for h hours and m minutes is

(h*60 + m)*5.5 modulo 360. (where x mod 360 for an arbitrary real is defined as (x - ([x] mod 360), [x] is integer part of x)

We arrive at this by thinking in terms of relative angular velocities.

Maybe overkill.

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

Math.abs(6.0 * min - (min / 2.0 + (hour * 30)));

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.

### 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.