MISSING VALUE Interview Questions

6,571,877 interview questions shared by candidates

You are given two integers, p and q. Complete the function calculatePower which takes two integers as arguments and returns p to the power of q, without using the built-in power function. We expect you to do better than O(q). A same input is p = 2 and q = 3, and the corresponding output is 8. Constraints: 0 <= p^q <= ((2^63) - 1)
avatar

Software Developer

Interviewed at AQR Capital Management

4
Jun 21, 2017

You are given two integers, p and q. Complete the function calculatePower which takes two integers as arguments and returns p to the power of q, without using the built-in power function. We expect you to do better than O(q). A same input is p = 2 and q = 3, and the corresponding output is 8. Constraints: 0 <= p^q <= ((2^63) - 1)

Viewing 3671 - 3680 interview questions

Glassdoor has 6,571,877 interview questions. Prepare for your interview. Get hired. Love your job.