Angle Between Hands of a Clock

Medium · Math & Number Theory · about 10 minutes

Asked at Salesforce, Amazon, Bloomberg, Meta, Google, Microsoft, Workday, Okta, SAP, Rippling, Gusto.

Given hour (1–12) and minutes (0–59), return the smaller angle in degrees between the hour hand and the minute hand. Answers within 10⁻⁵ of the actual value are accepted.