Quantitative Developer Interview Questions | Glassdoor

# Quantitative Developer Interview Questions

102

Quantitative developer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

Jul 31, 2009

### Quantitative Developer at Bank of America was asked...

Jul 31, 2009
 How many numbers between 1 and 1000 contain a 3?13 Answers300 numbers contain a 3, but you counted numbers of the form x33, 3x3, and 33x *twice* so you must subtract them 300-30=270, but you subtracted 333 once too many, so add it back 300-30+1=271. Answer is 271.271 does not seem right . I think it is 111. Aren't there just 11 numbers containing 3 between 0 an 100, like 3,13,23 30,33 etc. So between 0 and 1000 there are 111; after adding in for 300.There are only 19 numbers between 1 and 100 containing '3': 3, 13, 23, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 43, 53, 63, 73, 83, 93. The same logic holds for 101-200, 301-400, 401-500, 501-600, 601-700, 701-800, 801-900, and 901-1000. That is 19 * 8 = 152. There are 20 numbers between 201-300 that contain a 3: 203, 213, 223, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 243, 253, 263, 273, 283, 293, 300. That brings the sum up to 152 + 20 = 172. Finally, 99 numbers from 301-400 contain a 3. The final sum is 172+99=271. Of course, there are much more intelligent ways to count. For example, instead of counting how many numbers contain a 3, count how many do NOT contain a 3. That means that there are 9 possibilities for the 1st number (0-9 except 3), 9 possibilities for the 2nd number, and 9 possibilities for the 3rd number. Thus, there are 9 * 9 * 9 = 729 that do not contain a 3 which means that there are 1000 - 729 = 271 numbers that do contain a 3.Show More ResponsesThanks Candidate, or more simply For 300 to 399 = 100 numbers For other x00 to x99 = 19 numbers each = 19 x 9 = 171 numbers Total of 271 numbersI would go with elimination of one character from a base 10 numbering system gives you a base 9 numbering system. 9^3 = 729 permutations of a base 9 numbering system (a system with no number 3) with 3 digits, since 10^3 = 1000; 10^3 - 9^3 = 271 thus 271 numbers have a 3 in them.http://brainteaserbible.com/interview-brainteaser-numbers-between-0-and-1000-at-least-one-5 basically the same thing1000 does not contain a 3. So, count the number of 3 digit numbers without a three. There are 9 choices for the first entry, 9 for the second, and 9 for the third. So, there are 729 numbers without a 3, and 1000-729 = 271 with a 3.I have a much simpler and faster method: let A be the cardinality of numbers between 1 and 1000 that contain a 3 and let A' be the cardinality of numbers between 1 and 1000 that do not contain a 3. There are 3 digits that can take the form of (0,1,2,3,4,5,6,7,8,9), so 10 possibilities.. To obtain A' cardinality we have 9 possibilities because 3 is excluded so A' = 9^3 = 729. Hence, the amount of numbers that don't have a 3 from 1 to 1000 is 729 so to obtain the amount that does contain at least one 3 is : 1000 - 729 = 271lol im in 7th grade and this question is easy to me. first you count the numbers which DON't have a three. there are 9 choices for the first digit, 9 for the second digit, and 9 for the third. You probably noticed that this counts 0 to 999 instead of 1 to 1000 but its okay because, we count the same amount of numbers. 9^3=729 -1000=|271| (i like using absolute value cause it makes me look cool, its just a way to show "difference" in math)3xx 100 a3x a is not 3 here to reduce duplication, 10*9 ab3 a , b are neither not 3 , 9*9 =271You can use this formula to work it out for any power of 10: Tn+1=9Tn+10^n. Tn being the number of threes in the numbers between 1 and the previous power of 10. Tn+1 is simply saying the number of threes in the next power (the one you are working out). The 10^n is the power of 10 that you add on. This is the previous power of ten. You must start off knowing that there is one 3 between 1 and 10 For 100: Tn+1=9*1+10^1=19 For 1000: Tn+1=9*19+10^2=271 For 10 000: Tn+1=9*271+10^3=34391000-1-9^3+1 = 271It is an infinite number 3.1, 3.11, 3.111, 3.11111

### Quantitative Developer at J.P. Morgan was asked...

Apr 30, 2012
 You have a chest of 8 drawers. With probability 1/2, you put a letter in one of the drawers. With probability 1/2, you don't put a letter in any drawer. I open the first 7 drawers, all are empty. What is the probability there is a letter in the 8th drawer?9 Answers1/9It should be 1/2 as initially u started with 1/8 but as you keep opening drawere and finding them empty .. you keep improving the chance that there will be a letter in the remaining drawer, finally you reached the last drawer and now its back to the basic ... that is maybe you have put the letter in drawer or notNo, you clearly don't understand conditional probability.Show More ResponsesConditional probability gives 1/9, but suppose we conduct the experiment one million times, and each time the opened 7 drawers are empty, what is the expected number of times that one finds the ball in the 8th drawer?should be 9.82%.Why is it not 1/2? since there is only one drawer left, there would be a 50/50 change that it is there or isn't. I don't understand how you get 1/9100%As the 7 drawers are already opened, now we don't need to consider the probability . Answer is 1P(in 8th|first 7 empty) = P(first 7 empty and in 8th)/P(first 7 empty) = (1/2*1/8)/[(1/2*1)+(1/2*1/8)] = 1/9

### Quantitative Developer at Tower Research Capital LLC was asked...

Oct 15, 2010

Dec 4, 2010
 Given a m*n matrix with values -1 or 1, try to flip the values in a given row and a given line efficiently.3 Answersfor(i=0;iR: given row, C: given column for i = 0 to m: Matrix(i, C) *= -1 for j = 0 to n: Matrix(R, j) *= -1 Matrix(R, C) *= -1you can get even more efficiency if you go down to the bit level, since multiplication is expensive. python code follows: let's call the matrix M, and the given row and column r,c respectively for i in range(0,m): M[i][c] = ~M[i][c] + 1 for j in range(0,n): M[i][r] = ~M[i][r] + 1

### Quantitative Developer at AKUNA CAPITAL was asked...

May 14, 2016
 What is the probability of an integer from 1 to 60,000 not having the digit 6?5 Answers27.9%My guess, number of integers not having the digit 6=6*9*9*9*9-1=39365 So the probability is about 0.6561.The number of integers in [1,60000] that contains digit 6 is 6*(10^4-9^4)+1. The answer is verified by writing a testing program.Show More Responses6 x 9 x 9 x 9 x 9 = 39,366 numbers between 1 and 60,000 with a "6" digit 60,000 total numbers 39,366 / 60,000 = .6561 probability of having a "6" digit 1 - .6561 = .3439 probability of not having a "6" digitIf we are to find the answer from 0-59999, the probability of not having a 6 will be (9/10)^4. We rescale the probability to make the denominator 60000 and get (9^4*6)/(10^4*6). Now we shift our range to 1-60000 and we have one case, 60000, to delete from our previous result. We delete that case and get (9^4*6-1)/(10^4*6).

### Quantitative Developer at WorldQuant was asked...

May 30, 2014
 There were bunch of ridiculously difficult probability questions and computer science algorithm questions. Nothing worth to mention here2 AnswersAttacking Asian people or people of any other race because you're not qualified is not helping anyone.The technical interview IS a test and you need to study harder to pass it.The finance companies seem to normally ask those type of questions

### Quantitative Developer at Goldman Sachs was asked...

Jun 8, 2010
 There are 50 noddles in a bowl. Each time you randomly select two ends of the noddles from the bowl and tie together. What is the expected number of loops formed from this process?3 Answersyou can try with a small number like 2, 3. and then generalize the answerlet E_n be the expected number of loops you get when you start with n noodles. Pick an end of the noodle. There are 2n - 1 noodle ends left. All but one of them lead to no increase in the number of loops, while one of them leads to another loop ( the case where you pick both ends of the same noodle). So E_n = 1/(2n - 1) + E_{n - 1}. Therefore E_50 = 1/99 + 1/97 + ... + 1/1.The answer should be 1. The probability of forming a loop is 1/n. Since we have n ropes, the expected value is n X (1/n)

### Quantitative Developer at Bloomberg L.P. was asked...

Mar 17, 2010
 Implementing the LRU algo2 AnswersI used hash table with LRU for each bucket, writing code on the spot was really difficultSimple (to write code for) solution would be to use queue - first in first out.

### Quantitative Developer at AKUNA CAPITAL was asked...

Feb 7, 2018
 keep throw a coin if two head A will win if first is head second is tail B will win, keep throwing until have a winner. who has better chance to win?2 AnswersThe probability of both A and B winning the game is same irrespective of the number of turns taken to win P(Win,A)= 1/4 = P(Win,B)In this case it's 50/50. HH - A wins HT - B wins TTHH - A wins TTHT - B wins THH - A wins THT - B wins It get's interesting if it's TH rather than HT
110 of 102 Interview Questions