Software Developer Interview Questions in Bridgeport, CT | Glassdoor.co.in

Software Developer Interview Questions in Bridgeport, CT, US

47

Software developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

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)

4 Answers

# p^q without using math.pow in O(log(n)) using memoization def p_power_q(p, q): """ p: p is base q: q is exponent """ if q == 0: return 1 elif q == 1: return p negFlag = 0 if q &gt;= 1 if negFlag: return 1 / result return result

# Without using modulus def power_no_mod(p, q): """ p: p is base q: q is exponent """ if q == 0: return 1 elif q == 1: return p negFlag = 0 if q &gt;= 1 if negFlag: return 1 / result return result

# p^q without using math.pow in O(log(n)) using memoization def p_power_q(p, q): """ p: p is base q: q is exponent """ if q == 0: return 1 elif q == 1: return p negFlag = 0 if q &lt; 0: q = -1 * q negFlag = 1 half = p_power_q(p, q // 2) if q % 2 == 0: result = half * half else: result = p * half * half if negFlag: return 1 / result return result

You are given an alphanumeric string. Complete the function sortSegments that will segment the string into substrings of consecutive letters or numbers and then sort the substrings. For example, the string "AZQF013452BAB" will result in "AFQZ012345ABB". The input letters will be uppercase and numbers will be between 0 and 9 inclusive.

3 Answers

Basic SQL and OO questions

1 Answer

Find the area of circle given the input as diameter.. was easy just had to use a double return method

1 Answer

Tell me about yourself and why should we hire you?

1 Answer

They asked puzzle questions like, if you have 5 gallon bucket and a 3 gallon bucket, how do you get 4 gallon of water... I'm not sure if incorrect answer effect your chance of landing the job.

1 Answer

Given a lot of numbers (each number is inputted one at a time), find and maintain a list of the 100 biggest numbers.

1 Answer

Mostly personal questions designed for cultural fit.

1 Answer

You are given an integer array n. Complete the function sortIntegers which takes as argument, an integer array n of up to 1 million integers such that 1 <= n_i <= 10 for every element n_i in the array, and returns the sorted array. The sort does not need to occur in-place. Please do not call a standard sorting function like quicksort, you can do better. A sample input is {3, 1, 4, 1, 5, 9, 2, 6, 5} and the corresponding output is {1, 1, 2, 3, 4, 5, 5, 6, 9}. Constraints: i <= 10^9; 1 <= n_i <= 10

1 Answer

Are you familiar with SQL and .NET

1 Answer