Senior Python Developer Interview Questions

6,402 senior python developer interview questions shared by candidates

Implement the power(int b > 0, int n >= 0) function. What is its time complexity? Extend the function to also accept int n < 0. Assuming the time complexity of the implemented function was O(n), also implement an O(log n) variant. Note that use of recursion is acceptable for the O(log n) implementation, but not for the O(n) implementation. Only an iterative implementation is acceptable for the O(n) variant.
avatar

Python Developer

Interviewed at HedgeServ

3.8
Dec 26, 2016

Implement the power(int b > 0, int n >= 0) function. What is its time complexity? Extend the function to also accept int n < 0. Assuming the time complexity of the implemented function was O(n), also implement an O(log n) variant. Note that use of recursion is acceptable for the O(log n) implementation, but not for the O(n) implementation. Only an iterative implementation is acceptable for the O(n) variant.

Viewing 1711 - 1720 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 6,402 interview questions and reports from Senior python developer interviews. Prepare for your interview. Get hired. Love your job.