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

### Software Developer at AQR Capital Management was asked...

21 Jun 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)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 >= 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 >= 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 < 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 resultShow more responses# 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 >= 1 if negFlag: return 1 / result return resultdef power(p,q): if q == 0: return 1 for i in range(2, int(np.ceil(np.sqrt(q)))): if q%i == 0: return power(p, q/i) * power(p, q/i) return p * power(p, q-1)

### Software Engineer at FactSet was asked...

17 Nov 2013
 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 AnswersThere is no answer. The interviewer just wants to have a good discussion with you about algorithms and running time.Does this mean the area of steps taken (not including duplicate steps)? Or the area of the steps taken AND area of the shape within those steps (assuming the steps produce a complete shape)?use the floor function of (number of moves / 2). [n/2]Show more responses@Roshan your solution won't work. It fails for this example up-right-up-right-down-down-left-left

### Software Engineer at FactSet was asked...

27 Feb 2015
 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 Answersthis seems not using the sorted condition, there can be better solutionThis is a sorted array. So the duplicates, if present must be side by side. We can use XOR operation to find this. public class DuplicateElementInArray { public static int checkDup(int array[]) { for(int i=0; iPerform binary search where A[mid] == A[mid-1] || A[mid]==A[mid+1] with care for Array index bounds. This will be done in log nShow more responsesif the values are 1..100 with one of them repeated, add them up and subtract sigma(1,100) = O(n)

### Junior Java Software Engineer at Interactive Brokers was asked...

12 Nov 2016
 Some questions about Java basics, and some math problems and SQL3 AnswersCould you please post the questions or at least topics on which questions were asked?I have an onsite interview coming up. Could you recollect any questions and any tips would be appreciated.Teju, Will you please share your experience?

### Software Developer at AQR Capital Management was asked...

21 Jun 2017
 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 Answersimport re def segment_sort(string): segments = re.split('([0-9]+)', string) # Splitting the String into Segments sorted_segments = [''.join(sorted(segment)) for segment in segments] return ''.join(sorted_segments) def main(): string = "AZQF013452BAB" print(segment_sort(string)) if __name__ == '__main__': main()A way to do this without regex is to simply try to convert each string character to an int. In python, doing int("A") will result in a ValueError, so you can just use a try-except ValueError clause, and whenever you switch from a region in which you can or cannot convert to int, you know you are at a splitting point, so just save those indices.not sure for python, but for java, all the char have a integer number associated. You can convert char to int, so if the char is greater than '0' and less than '9', this can be an indicator of integer. Use this check you can find all the integer or alpha sub arrays. For each sub array, either add another sort method to sort the char array, or you can use the char comparator default compare method to sort the array. At last, concatenate all the subarrays to form the output.

### Software Engineer at FactSet was asked...

8 Jan 2020
 Design a Parking Lot How would I set up a system to read, store, and analyze stock market transactions3 AnswersHi, Can you share what quetions were asked in phone screen round. Thank youWhat code were asked to review in the code review round?Following

### Electrical Engineer at ASML was asked...

8 Dec 2017
 Have you ever worked on a 750V power supply?2 Answers250V is the highestYou clearly won’t accepted at asml.

### Design Engineer II at ASML was asked...

12 Dec 2013
 How many ping pong balls can fit in this room?3 AnswersAssume ping pong balls are ~ 40x40x40 mm^3 cubes.The model of ping-pong ball should be regarded as body-centered cubic structure, so for D^3 (D is 2 times of single ball) volume, it is stands for 2 balls. One or more comments have been removed. Please see our Community Guidelines or Terms of Service for more information.

### Web Developer at Interactive Brokers was asked...

10 Oct 2012
 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 AnswersLet x be the income. Net income is x - x/100. Take first order derivative of that and set it 0 and solve for x for the optimal salary. The answer is 100.I think this solution is incorrect. The net income is the gross pay less the gross pay multiplied by the tax rate: Net = Gross - Gross * Gross/100 Net = Gross - Gross^2 / 100 Calling the net pay N, and the gross pay G, N is maximized when dN/dG = 0, or: 1 - G /50 = 0. Solving for G yields an optimal pay of 50 rupees. I knew your answer was incorrect because a pay of 100 rupees corresponds to a 100 percent tax, that is, ZERO net pay! IBKR remember my name, I will submit my application upon graduating from college. Mike Mancini mancini0@gmail.com

### Applications Developer at Interactive Brokers was asked...

31 Dec 2017
 Know how hashing works2 Answersyou need to override the "public int hashcode()" function as well as equals.Yeah. It is called as contract of hascode() and equals() method. Do you remember you spoke about hashmap architecture as well?
110 of 399 Interview Questions