By Rahul — Google Frontend Engineer
Why This Appears in Interviews
This is not a coding question. It tests your ability to break down a problem systematically and handle edge cases. The same skill applies to debugging complex frontend issues.
The Key Insight Most People Miss
At 3:15, the hour hand is NOT pointing exactly at 3. It has moved partway toward 4. This is where most candidates get it wrong.
Step-by-Step Solution
Minute Hand at 3:15
15 minutes = 15/60 of a full revolution = 1/4 × 360° = 90° from 12 o'clock.
Hour Hand at 3:15
The hour hand moves 360° in 12 hours = 0.5° per minute.
At 3:00, the hour hand is at 90° from 12.
In 15 minutes, it moves 15 × 0.5° = 7.5° more.
So at 3:15, the hour hand is at 90° + 7.5° = 97.5° from 12 o'clock.
The Angle Between Them
97.5° − 90° = 7.5°
General Formula
function clockAngle(hours, minutes) {
// Minute hand: 6° per minute
const minuteAngle = minutes * 6;
// Hour hand: 0.5° per minute + 30° per hour
const hourAngle = (hours % 12) * 30 + minutes * 0.5;
// Absolute difference
let angle = Math.abs(hourAngle - minuteAngle);
// Take the smaller angle (clock has two sides)
return Math.min(angle, 360 - angle);
}
clockAngle(3, 15); // 7.5
clockAngle(12, 0); // 0
clockAngle(6, 0); // 180
clockAngle(9, 45); // 22.5Why This Matters for Engineers
The real lesson is: do not assume. The hour hand moves continuously, not in discrete jumps. In frontend engineering, similar assumptions cause bugs — animation timing, scroll position calculations, and viewport measurements all involve continuous values that people treat as discrete.
Summary
At 3:15, the angle is 7.5°, not 0°. The hour hand moves 0.5° per minute. Always account for continuous movement in any time-based calculation.