## Microsoft Interview Question for Program Managers

Team: Visual Studio
Country: United States
Interview Type: In-Person

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

Minutes Angle = (360 * m) / 60 = 6 * m where m is the minutes.
Hour Angle = ((360 * h) / 12) + (360 * m / 12 * 60) = 30 * h + m / 2
From the above two values get the difference by subtracting the bigger value from the smaller value.
If the difference is more than 180 then 360 - diff will be the acute angle else diff itself is the acute angle.

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

It was a pretty easy problem.. but what they were looking for is how you approach a problem. The first thing I did was ask about the format of the input. If its a string you'd need to parse it and convert into integer, if its in 24hr format.. you would need to convert it to 12 hr, and other things like that... Then, I asked about the format of the output, at which point the interviewer clarified she wanted the acute angle.
Also, while solving it out on the board, you should explain each step instead of just doing it all in your head and then writing the formula. Thats what they are looking for in a PM.

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

This is really helpful for new grads to understand what does the company really want

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

You're welcome! Good luck!

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

Minutes Angle = (360 * m) / 60 = 6m where m is the minutes.
Hour Angle = ((360 * h) / 12) + (360 * m / 12 * 60)

Hour Angle - Minutes Angle = 30h - 11m/2

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

difference between the minute and hour clock travel, so

(360/60) m - (360/12) h - (30/60)m
which comes to

30 * h - 5.5 * m

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

Solution is correct.
But in question which angle they want , its not mentioned so better return angle <180 degree always.

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

I think this problem needs lots of clarifying questions.

1) between which hands: hour-minute; minute-second; hour-second
2) how are we reading the input form the clock?
3) Does clock hand move contiguously or they tick?
4) Do we want to calculate the angles at each given time or we want to have program contiguously display the angles.
5) do want to store these angles?
...

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

Those are the questions you should ask the interviewer when presented with a vague problem.

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

hr_angle = 1/2(60*h+m)
min_angle = 6m
angle = hr_angle - min_angle.

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

``every 1 min diffference is carried by five and half degree....``

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

Triangle

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

time/12*360 = angle

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.