Engineer Interview Questions in Bridgeport, CT | Glassdoor.co.in

Engineer Interview Questions in Bridgeport, CT, US

399

engineer 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)

5 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 a stream of directions in [up, down, left, right]. Each direction means move one unit in that direction. After completing the movements, you will return to the position where you started. Compute the area of the shape you created. I was asked this when FactSet interviewed me a very long time ago. I liked the question so I sometimes use it myself when I interview other applicants..

4 Answers

If you have a sorted array that is initialized with size 100, the values stored would be for example 1, 2, 3,.... ect. Describe an algorithm that would check if there is a duplicate number and if so return it.

4 Answers

Some questions about Java basics, and some math problems and SQL

3 Answers

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

Design a Parking Lot How would I set up a system to read, store, and analyze stock market transactions

3 Answers

Have you ever worked on a 750V power supply?

2 Answers

How many ping pong balls can fit in this room?

3 Answers

One or more comments have been removed.
Please see our Community Guidelines or Terms of Service for more information.

The people of TownX pay as much income tax(percentage-wise) as the number of rupees made per week. What's the optimal salary?

2 Answers

Know how hashing works

2 Answers
110 of 399 Interview Questions