## Kalido Interview Question for Software Engineer / Developers

Country: India
Interview Type: In-Person

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

The angle between hours and minutes for a given time x:y(x hours and y minutes) is |30*x-11*y/2|(absolute value)..this comes from the fact that a hour hand elapses 30 degrees for every hour(360/12) and minute hand elapses 6 degrees(360/60)..but for 6:50,the hour hand also elapses extra offset from its original position where it has to be there at 6:00 sharp..the offset is calculated as follows:
1.for every 60 minutes of minutes hand,hour hand elapses 1 hour..so distance travelled by hour hand when the minute hand travels 1 min is 1/60
2.so the offset is (50/60)*30 degrees for the hour hand
3.so the total angle covered by hour hand for 6:50 is 6*30 degrees+offset=180+25=205 degrees
4.angle covered by minute hand is 50*6 degrees=300 degrees
So,angle between them =300-205=95 degrees :)

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

Nice explanation mate :).

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

Thanks shyam :)

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

Awesome Explanation !! kudos !! :)

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

Thank you avenger ...this is my highest rated answer in Careercup . Thanks for the upvote :)

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

I think your answer is wrong. The angle between 0(midnight) - 6 and then 6 and 12 is 180 degrees.
50 minutes is when minutes hand is pointing 10. As you wrote an hour hand elapses 30 degrees for every hour.
So the angle is 180 - 60 = 120 degrees.
Here is how I see it:
6.00 - 180 degrees (hour hand points 6 and minutes hand points 12)
6.55 - 150 degrees
6.50 - 120 degrees
6.45 - 90 degrees
6.40 - 60 degrees
6.35 - 30 degrees
6.30 - 0 degrees (both hands points to 6 hour)

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

@thelineofcode your thinking is wrong. at 6:00 its is 180 deg but at 6:55, its not 150 deg as the MINUTES hand is less by 5 min(its not HOUR's hand). And you will also have an offset there as the hour's hand wont be pointing at 7 exactly..it will be very close to 7 but not 7. Please watch your clock more carefully

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

(11/2) * M - (30) * H
Here M is minute and H is hour.
ANS= 95 degree.

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

At 6:50 angle is 115 digree

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

``Angle in Degree=(abs(1/2*(60*Hours+minutes) - (6*minutes))``

More details refer :
//en.wikipedia.org/wiki/Clock_angle_problem

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

95 degrees

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

How did you find it out?? Please tell me..!!!

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

how??

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

simple at 6:50 minute hand will be at 10 and the hour hand would have moved 50/60 parts ahead of 6 ie it will be at 6 5/6. Now 360 degrees = 12 parts then 10 - 6 5/6 parts = (360/12) * (19/6) = 95 degrees.

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

95! duh

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

Angle = (h*30 + (m/60) * 30) - (m * 6)

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

For hour hand,
1 hour = (360/12) = 30 degrees movement
1 minute = (30/60) = 0.5 degree movement

For minute hand,
1 minute = (360/60) = 6 degrees movement

So, if time is H:M
Angle between two hands = |((30*H)+(0.5*M))-(6*M)|

6:50 will give 95 degrees

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

Answer wouldn't be 120, because hour hand also been moved ahead of 6 answer must be reduced from 120. so 120-25=95

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

Hey guys. My math skills suck but please explain why wouldn't it be 120°, since it's the only answwer I coud actually explain to my interviewer.

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

@AAA see my answer above :)

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

formula: 30H-(11/2)M

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

angle b/w the hands of watch=|(11 m-60 h)/2|

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

- At 6:50, the minute hand is sitting on 10 and the hour hand is just shy of sitting on the 6.

- There are 12 hours in 360*, so one hour = 360/12 = 30 deg

- The angle between 6 and 10 = (10 -6) * 30 = 120 deg

- The hour hand is 10/12 of the way from the 5 to the 6:

30 * 10 / 12 = 25 deg

So the hour hand is 30 - 25 = 5 deg away from the 6.

- Total angle between hour & minute hand = 120 + 5 = 125 deg

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

I also got 95 degrees. Here's how.

Suppose the hour and minute hands were pointing to 6:00, then there's a 180 degree angle since it's a straight line.

Now, return to the time of 6:50. The minute hand sits on the 10. For each increase in number, there is a 360/12 = 30 degree rotation. So the angle between the 12 and 10 is 2*30 = 60 degrees.

Now consider the angle between the hour hands at 6:00 and 6:50. This is 5/6 of an hour, or 5/6 of a number change. Thus, the angle is 30*(5/6) = 5*5 = 25 degrees.

Since 12:00 and 6:00 make a straight line (180 degrees), we have

60 + x + 25 = 180
x = 180 - 60 - 25
x = 95

Kind of a long response. But easy to explain.

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

Hour hand:

Rotates by 360 degrees in = 12 hours
In an hour = in 60 minutes = 360/12 = 30 degrees
in a minute = 30/60 = .5 degree
In 6 hours = 30 * 60 = 180 degrees
in 50 minutes = 50 *.5 = 25 degrees
in 6 hours 50 minutes = 180 +25 degrees

Minute hand:

Rotates 360 degrees = 60 minutes
1 minute = 360/60 = 60 degrees
in 50 minutes = 300 degrees

Difference between the two hands in degrees = 300 -205 = 95 degree

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

Obtuse angle

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

/* This is program to find the angle between Hour Hand and Minute Hand*/

#include<stdio.h>
#include<math.h>
int main()
{
int hour = 2;// totally 360 degrees ,12 hours(760 Minutes) = 360 degress, 1 minute = 0.5 degress
int minute =20;// totally 360 degrees ,60 minutes = 360 degress, 1 minute = 6 degress
int degree = 0;
hour = (hour*60+minute)/2;
minute=(minute*6);
printf(" The angle betwenn hour and minute hand is %d\n",hour-minute);
return 0;
}

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

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

osm

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

A method to solve such problems is to consider the rate of change of the angle in degrees per minute. The hour hand of a normal 12-hour analogue clock turns 360° in 12 hours (720 minutes) or 0.5° per minute. The minute hand rotates through 360° in 60 minutes or 6° per minute.

Angle b/w hour and minute hand is => ½ *(total minutes) - 6 * minutes
for 6:50 then angle will be
½*(6*60 + 50) - 50*6 => ½ * (410) - 3000 => 205-300 => 95 degrees

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

In 12 hours, the hands of a clock are at right angles 11 times to the left of the number 12, and 11 times to the right of the number 12 – that is, 22 times
Therefore, in 24 hours, they are at right angles 44 times.

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

I'm reading Cracking the coding interview and she suggests the answer is (30h - 5.5m) % 360 but I did not understand how she got that and I tried some tests and maybe i'm mistaken but it doesn't seem to work.

My thinking was that if you consider noon to be 0 and you first look for the angle of the hour hand from 0 and get that number and then do the same thing for the minute hand and then subtract the two you would get your answer (ofcourse checking if the angle was greater than 180 and if so subtracting by 360 to get the smaller angle).

So at 1 PM, the hour hand is at 1 and the angle from noon is 360/12 = 30.
And at 12:01 pm, the minute hand is at 1 minute and the angle from noon for the minute hand is 360/60 = 6.

can someone tell me if this is the right or wrong answer?

``````static int GetAngle(int h, int m)
{
int hAngle = 30 * (h % 12);
int mAngle = 6*m;
int diff = Math.Abs(hAngle-mAngle);
if (diff > 180)
{
diff = 360 - diff;
}
return diff;
}``````

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

Also do not forget the 24 hour system

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

``````public class Angle {
public static void main(String args[]){
float hr=12;  //time hour
float min=5;  //time minute
if (hr>=12){
hr-=12;
}
float ang=360/60;         //Unit Angle
float mv=(float)5/60;     //Hour hand movement per minute
float hr1=hr*5+mv*min;    //Hour hand position
System.out.println("hr1: "+hr1);
if(hr1>min){
float temp=hr1-min;
System.out.println("Angle="+temp*ang);
}
else{
float temp=min-hr1;
System.out.println("Angle="+temp*ang);
}
}``````

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

264 degree / 96 degree..

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

for acute angle:
(11/2) * M - (30) * H = angle/answer
M=minute
H=hour

for reflex angle:
(11/2) * M - (30) * H = answer

ref: saumya

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

nice explanation..thank u

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

9.9

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

Angle between hour hand and minut hand at 7:19

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

Areeb@16

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

``i luv u``

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

The answer is 92.72 Degrees to be accurate all other methods are just rough ones!!!!

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

12:30

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

What will be the angle at 7:38?

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

Nice explanation dude.....

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

95

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

30H-(11/2)×min
Eg. Time is 12:20
Then,
Angle = 30 ×(H) - (11/2) ×min
=30×12 - 11/2) ×20
=360 -110
=250 degree

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

What is the angle between 9to 9:35

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

1:30

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

Hour hand angle for a hour= 360/12=30deg
Hour hand angle for a min=360/(12*60)=0.5deg
Min hand angle for a minute= 360/60=6 deg
Hour hand moves 30 deg for an hour and 0.5 deg for min
Minute hand moves 6 deg for min
Hour hand angle = (6*30)+(0.5*50)=205deg
Minute hand angle=(50*6)=300deg
Angle between= 300-205=95deg

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

what is the angle between 3hours to 12minute

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

Formula for finding clock angle= |(30*hour + min/2) - (6*min)|
Since the answer should always be in positive.

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

Formula for finding clock angle= |30*hour + min/2 - (6*min)|
The answer should always be in positive.

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

this is an equation I made to solve angles,
(|60*h-11*m|)/2
h is the hour
m is the min
| means absolute value

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

Find the time between 5 or 6 when the angle is 60 degree

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

2:10:15 par braht angel

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

Use this formula
1/2(60H-11M) for degree
For Example 3 hour 15min
1/2(60x3-11x15)
=1/2(180-165)
=1/2x15
=7.5 degree.

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

How to prove 1 degree is equal to 60 minutes? By calculative method

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.