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 :)

- Karthik vvs October 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 votes

Nice explanation mate :).

- Shyam October 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Thanks shyam :)

- Karthik Vvs October 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Awesome Explanation !! kudos !! :)

- Avenger June 27, 2013 | Flag
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 :)

- Karthik Vvs June 27, 2013 | Flag
Comment hidden because of low score. Click to expand.
-2
of 4 votes

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)

- thelineofcode December 12, 2013 | Flag
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

- Karthik Vvs December 13, 2013 | Flag
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.

- Saumya December 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

At 6:50 angle is 115 digree

- Sahazad March 31, 2019 | Flag
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

- Mukesh Singh Rathaur September 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

95 degrees

- The Artist October 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

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

- NRR October 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

how??

- Anonymous October 23, 2012 | Flag Reply
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.

- The Artist October 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

95! duh

- Rahul Arakeri October 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

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

- Senthilmanikandan October 24, 2012 | Flag Reply
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

- akashj November 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

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

- Anandh January 12, 2013 | Flag
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.

- AAA December 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

@AAA see my answer above :)

- Karthik Vvs December 04, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

formula: 30H-(11/2)M

- sandeep December 07, 2012 | Flag Reply
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|

- Anonymous December 10, 2012 | Flag Reply
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

- bbattey December 15, 2012 | Flag Reply
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.

- Ethan December 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

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

- Rashmi January 30, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Obtuse angle

- Anonymous July 31, 2013 | Flag Reply
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;
}

- sakthivel Sethu October 24, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Worth noticing there is an article about this problem at wikipedia:Clock_angle_problem

- gagomes December 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

osm

- Anonymous January 17, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Answer should be 95 degress.

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

- jayasagar January 19, 2014 | Flag Reply
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.

- shake February 03, 2014 | Flag Reply
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;
	}

- Amit August 16, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Also do not forget the 24 hour system

- freakpao February 18, 2015 | Flag Reply
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);
		}
	}

- Pratyush May 21, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

264 degree / 96 degree..

- a khan May 26, 2015 | Flag Reply
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
answer + 360 = angle/answer

ref: saumya

- Anonymous August 12, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

nice explanation..thank u

- sujai November 19, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

9.9

- Anonymous February 02, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Angle between hour hand and minut hand at 7:19

- Sonu January 19, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Areeb@16

- Areeb February 18, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i luv u

- dinesh.u March 04, 2017 | Flag Reply
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!!!!

- Aditya May 15, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

12:30

- Anonymous May 15, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

What will be the angle at 7:38?

- pc July 03, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Nice explanation dude.....

- Anonymous August 06, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

95

- Anonymous August 12, 2017 | Flag Reply
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

- Anonymous September 07, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

What is the angle between 9to 9:35

- riya February 20, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1:30

- ABHISHEK RATHOD September 04, 2018 | Flag Reply
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

- Anonymous May 29, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what is the angle between 3hours to 12minute

- Anonymous July 25, 2019 | Flag Reply
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.

- Dude 1237 August 10, 2019 | Flag Reply
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.

- Dude 1237 August 10, 2019 | Flag Reply
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

- cyber_tech September 20, 2019 | Flag Reply
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

- Harshit December 12, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

2:10:15 par braht angel

- Paraveen Kumar December 14, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use this formula
1/2(60H-11M) for degree
Note:- If there is negative answer in bracket remove negative answer
For Example 3 hour 15min
1/2(60x3-11x15)
=1/2(180-165)
=1/2x15
=7.5 degree.

- Chhatra Khadka August 24, 2020 | Flag Reply
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

- Abhishek October 09, 2020 | 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