Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 50. Pow(x, n)
Compute x raised to the integer power n (n may be negative and within 32-bit bounds), returning a double. The challenge is to handle negative exponents and large magnitude n efficiently using binary/exponentiation-by-squaring in O(log |n|) time while avoiding edge-case overflow (e.g., n = INT_MIN).
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early November, 2025
Meta
Mid-level
Late October, 2025
Meta
Mid-level
Late October, 2025
Meta
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.