FastPrepSmaller Clock Hand Angle
Problems/Smaller Clock Hand Angle

Smaller Clock Hand Angle

Amazon logoAmazon● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Amazon full-time phone screen. The report gives the well-known task of finding the smaller angle between clock hands. Our function states that the hour hand moves smoothly, and it states how close the answer must be. It is about 99% the same as the reported question.

Given an analog-clock time with integer hour and minutes, return the smaller angle in degrees between the hour hand and the minute hand.

The hour hand moves continuously as the minutes advance. The answer is in the inclusive range [0, 180].

Function

clockAngle(hour: int, minutes: int) → double

Examples

Example 1

hour = 3minutes = 30return = 75.0

The minute hand points straight down, at 180 degrees. The hour hand is halfway between three and four, at 105 degrees. The gap between them is seventy-five degrees, so the answer is seventy-five.

Example 2

hour = 12minutes = 0return = 0.0

Both hands point straight up at 12, so there is no gap between them. The answer is zero.

Example 3

hour = 1minutes = 57return = 76.5

The direct difference is 283.5 degrees, so the smaller angle is 360 - 283.5 = 76.5 degrees.

Constraints

  • 1 <= hour <= 12.
  • 0 <= minutes <= 59.
  • Answers within 10^-5 of the exact value are accepted.

More Amazon Phone Screen questions

  • Course SchedulePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Search in a Rotated Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent ElementsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • LRU Cache for Query ResultsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Course Schedule IIPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Minimum Time to Spread Through a GridPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Consistent-Hash Packet RouterPHONE SCREEN · Seen Nov 2026
  • Count Connected ComponentsPHONE SCREEN · Seen Nov 2026
  • Second Largest Distinct ElementPHONE SCREEN · Seen Nov 2026
  • Task SchedulerOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Parking Fee CalculatorBreeze · PHONE SCREEN
  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Three Points in a Semicircle: Monte Carlo EstimateSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Apply Affine Array TransformationsByteDance · PHONE SCREENByteDance interview questions
  • Exponential Backoff DelaysWonderful · PHONE SCREEN
  • Add Two Integers Given as StringsJane Street · PHONE SCREENJane Street interview questions
  • Fizz and Buzz Words From 1 to nDocuSign · PHONE SCREENDocuSign interview questions
  • Recover Document Hierarchy from IndentationReducto · PHONE SCREEN

Interview reports that mention this question

  • Amazon Experienced Hire OA and Interviews: 21 Experiences

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
See Amazon hiring insights
Saved
class Solution {
    public double clockAngle(int hour, int minutes) {
        // Write your code here.
    }
}
Checking account…