Check whether an integer has no prime factors other than 2, 3 and 5
Company: GitHub
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
Overview: Decide whether a signed 32-bit integer is an ugly number, meaning a positive integer with no prime factors other than 2, 3 and 5. Tests basic number theory, careful handling of 1, zero and negative inputs, and reasoning about how many division steps the check needs.