Angle Between Hands of a Clock
A medium-tier problem at 64% community acceptance, tagged with Math. Reported in interviews at Epic Systems and 2 others.
You're staring at a clock problem. Epic Systems, UKG, and Siemens all ask it. The acceptance rate sits at 64%, which means one in three candidates who attempt it fail. Most people instinctively reach for angle formulas and trip over edge cases: what happens at 12 o'clock, how do you handle minute-to-hour hand movement, which angle do you return when two answers exist. This is a Math problem that looks trivial until you're live and the proctor is watching. StealthCoder surfaces a working solution in seconds if you blank on the formula or the edge-case logic.
Companies that ask "Angle Between Hands of a Clock"
Angle Between Hands of a Clock is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoderThe trick is understanding that both clock hands move continuously, not in discrete jumps. The hour hand drifts at 0.5 degrees per minute, and the minute hand moves at 6 degrees per minute. Most candidates calculate the raw angle difference correctly but fail to normalize it. You'll get an angle between 0 and 360. The problem wants the smaller angle, so if you compute 270 degrees, you need to return 90. The other pitfall: floating-point precision. Test values like 3:00 (90 degrees), 12:00 (0 degrees), and 6:00 (180 degrees) to verify your formula handles minute and hour inputs without rounding errors. StealthCoder becomes invaluable when you're unsure whether to return the acute angle or handle the 180-degree case differently on the fly.
Pattern tags
You know the problem.
Make sure you actually pass it.
Angle Between Hands of a Clock recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Angle Between Hands of a Clock interview FAQ
Is this problem still actively asked at major companies?+
Yes. Epic Systems, UKG, and Siemens are known to ask it. The 64% acceptance rate suggests it's a solid screening problem, not a throwaway. It filters candidates who skip the continuous-motion detail or panic on edge cases.
What's the actual trick nobody talks about?+
Both hands move at different rates per minute. The hour hand doesn't stay still between hours. Calculate hour angle as (hour % 12) * 30 + minute * 0.5, minute angle as minute * 6, then normalize the difference to the 0-180 range.
How do I avoid the floating-point trap?+
Work in degrees and test boundary cases: 12:00, 3:00, 6:00, 9:00. If your answer varies by more than a rounding error at these points, your formula is wrong. Consider rounding the final result to a reasonable precision if the problem specifies it.
Should I return the smaller angle or both?+
The problem asks for the angle between the hands, which conventionally means the smaller of the two possible angles. If you calculate 270 degrees, return 90. Always take min(angle, 360 - angle) as your final step.
Is this really a 'Medium' or is the difficulty inflated?+
At 64% acceptance, it's legitimately Medium. The formula is straightforward, but the continuous-motion logic and edge-case handling trip up candidates who rush. A few minutes of clear thinking solves it.
Want the actual problem statement? View "Angle Between Hands of a Clock" on LeetCode →