FastPrepIs a Power of Ten
Problems/Is a Power of Ten

Is a Power of Ten

Goldman Sachs logoGoldman Sachs● EasyFULLTIMEPHONE SCREEN

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report names a power-of-ten live-coding exercise. This practice selects the conventional integer-membership interpretation and supplies the exponent convention, signed input bounds and boolean interface. These are practice assumptions; the approximate source match is 65%.

Given a signed integer n, return true exactly when n = 10^k for some nonnegative integer k.

1 is a power of ten because 10^0 = 1. Zero and negative integers are not powers of ten.

Function

isPowerOfTen(n: long) → boolean

Examples

Example 1

n = 1000return = true

1000 equals 10 cubed.

Example 2

n = 120return = false

120 is not an integer power of ten.

Example 3

n = 1return = true

The exponent may be zero.

Constraints

  • -10^18 <= n <= 10^18.

More Goldman Sachs Phone Screen questions

  • House Robber IIIPHONE SCREEN · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · Seen Nov 2026
  • Best Average Student ScorePHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Check a Complete Binary TreePHONE SCREEN · Seen Oct 2026
  • Meeting RoomsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Count Staircase WaysPHONE SCREEN · Seen Oct 2026
  • Minimum Traveling Salesperson TourPHONE SCREEN · Seen Oct 2026
  • Square Root with Newton IterationPHONE SCREEN · Seen Oct 2026
  • First Non-Repeating CharacterPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Root of the Largest TreePHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Parking Fee CalculatorBreeze · PHONE SCREEN
  • Merchant Payout Reserve CalculatorStripe · PHONE SCREENStripe interview questions
  • Sqrt(x)LinkedIn · PHONE SCREENLinkedIn interview questions
  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Circular Primes Below a LimitAmazon · PHONE SCREEN
  • Palindrome NumberKotak Mahindra Bank · PHONE SCREENKotak Mahindra Bank interview questions
  • Streaming AverageXantium · PHONE SCREEN
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
All Goldman Sachs interview questionsSee Goldman Sachs hiring insights
Saved
class Solution {
    public boolean isPowerOfTen(long n) {
        // Write your code here.
    }
}
Checking account…