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)
Engineer Developer Interview Questions
466,953 engineer developer interview questions shared by candidates
Write code to parse a string and count the number of occurrences of each word.
Code Review
Reverse an array
What is the time complexity to find the median in an array?
Given a value in a binary search tree, write an algorithm that returns the next greatest value. The tree is assumed to contain the given value.
If there are two lists, and each have an identical number in them except for one unique number, how do you find the unique number?
Given unsorted array, find the 2 max numbers in it.
How to find a number in a array which is repeated?
u have 10 red socks and 10 blue in ur cupboard .you have to take 1 pair of socks but ur room is completely dark.how many minimum no. of socks required to take so that u ll be sure to get atleast a pair of same coloured socks?
Viewing 521 - 530 interview questions