# Interview Questions

interview questions shared by candidates

## Interview Questions

What is 29^2? 4 Answers841 Mental math. You could do it mentally. 29 is close to 30. So the upper bound is 30*30 = 900. You would have to subtract 30 and 29. 900- 59 = 841. or, take 29 x 30 to get 870. Take away one 29, get 841. Same idea, but more elegant. You've multipled 29 thirty times, you only need 29 of them, so take one away. Show More Responses Easiest way I can think of is to mentally calculate (30-1)(30-1) and then mentally foil the answers. You end up getting 900 - 30 - 30 + 1 = 841 which is pretty easy to do in your head. |

If you have a deck of cards split into 4 piles and was offered 1:1 odds to draw a face card (J Q K A) from at least one of the piles, would you take the game? Why or why not? 4 AnswersNo, basic statistics I'm no expert but I don't see it that way. You lose the game if you draw non-face cards from all 4 piles. The probability of that is 39/52*38/51*37/50*36/49 = 30%. So you have a 70% chance of winning the game. Yes, play the game at 1:1 odds. There are 16 face cards and 4 equal piles of 13 cards. By adding the probabilities of drawing a face card from at least 1 pile, you get 16/13. (1/13 + 1/13 + 1/13 + 13/13, or 4/13 + 4/13 + 4/13 + 4/13, and so on)...Doesn't matter how the face cards are arranged in the 4 piles. Thus, you would be willing to play the game at 1:1 odds. Show More Responses If there are 4 piles and you can look at all of them then it's obvious that you're going to take it - all the cards are there. If the question is to take the top card of each of the piles, then it's equivalent to finding the probability of a face card in 4 cards dealt. That is equal to 78.25%. So you would take the bet. (Total = 52 choose 4, Not Wanted = 36 choose 4, P(A face card) = 1-Total/Not Wanted) This is different from the answer given by the previous person because the numerator is wrong: he started at 39 when there are in fact 36 non-face cards (16 face cards - 52-16=36) If, however, the question is to pick one of the piles and then see if it has a face card, it is equivalent to randomly shuffling the deck and seeing if there is at least one face card in the first 13 cards. The probability of not having a face card is 0.363% and thus, the probability of having a face card is 99.637% - this means you should take the bet. So while the question can be interpreted in different ways, you should find it that taking the bet is a good proposition. Another way to look at it is as follows: if we assume sampling with replacement, to make calculations easy, we basically have 4 (or 13, depending on how you view it), chances to pick at least one card with probability 4/13 of the deck. This means that the probability of what is asked is almost equal to 1-(9/13)^4=77.04% (really close to the first case) or almost equal to 1-(9/13)^13=99.16% (also really close to the first number). |

Roll a fair dice, if it's a prime number, you pay me that number times $100, if it's not a prime number, I pay you that number times $100. Consider 1 as a prime number. How much willing to pay to play this game. 7 Answersanything below $387.50 Don't be surprised if you have not been employed. The question is "what is the expected return of this game?": E[X]=Sum(P(Xi)*Xi)=1/6*(-1*100+2*100+...)=50$ Esco910, we make a deal when you want, I have always dreamed about to buy a ferrari 2 is a prime number, and the expected value is less than 0. So I wouldn't play this game. Show More Responses $50 is correct, the others are wrong. You would play this infinitely many times because on average, you are printing money. If you consider 1 to be a prime number then $50 is the expected value.. but mathematicians do not consider 1 to be prime. Since 1 is NOT a prime number then the EV = (1/6)(100 + 200 - 300 + 400 - 500 + 600) = 83.3333333. But to pay less than that amount for 1 try is not very practical. In the interview it is wise to ask "how many times do i get to play this game since the EV is high?" If they say once, you'd be a fool to pay $83 to play this game only once.. What would you really pay to play once? Twice? 10 times? 100 times? 100,000 times? 1,000,000 times? Infinite? It's about perception, but clearly as the number of times you play goes up then you would pay more to play each time. Mathematics is not always the solution in trading. This is a very good question to ask... anyone can calculate EV but it's definitely not about that. EV only tells you what's going to happen over time. 2 is definitely a prime number... the expectation is less than 0 Since there seems to be some confusion here is a list of all outcomes and there values 1: -100 2: -200 3: -300 4: +400 5: -500 6: +600 Since they are all equally weighted (1/6) we can average. -100/6= -16.66666 You wouldn't pay to play this game. |

If the clock is at 9:30, what angle is it at? 6 Answers9:00 = 90* 3 = 270 degree 0:30 = 90 / 6 = 15 degree Therefore 9:30 = 285 degree Isn't it 90 + 15 = 105 degrees? Yea its 105 degrees Show More Responses can you explain the 105? isnt it just 90 between the 9 and 6 on the clock face? It's 90 degrees between 9 and 6 o'clock but the hour hand will move half way towards 10. Since there's 3 hours between the 9 and 6 we can say 1 hour = 90/3 = 30. The initial 90 degrees + the additional (1/2)*30 = 105 degrees. 90+((360/60)*2.5)=105 |

What the probability of getting 2 consecutive heads in a total of N tosses (I found this one pretty hard and I didn't figure out the right answer at the time.) 5 AnswersDo you mean Prob(at least 1 observation of 2 consecutive heads appears) ?? Then since the subsets can be: 1. all tails 2. 1 head 1 tail 1 head 1 tail .... 3. at least 2 heads consecutively appear once So Pr(3) = 1- Pr(1) - Pr(2) = 1- (1/2)^N - (1/2)^N = 1 - power(1/2,N-1) I think the answer should be this: Since the probability of getting two heads in a row and getting two tails in a row is the same, we only need to figure out the probability of the total. The remaining event is: 1 head 1 tail......due to different order, events should be 2 Therefore the probability=0.5(1-2(1/2)^N)=0.5(1-(1/2)^(N-1)) Only solution I could think of, which took quite some time, was to actually start by drawing a tree of possible outcomes. From there, I could see only three different states at each node. Either I am in a state similar to my initial state (when I toss a tail), I can also be in tilt state (I have just flipped heads after flipping a tail) or I am in the done state (I have just flipped heads after having flipped heads before). I consider that someone would only continue flipping if he/she has not flipped two heads in a row. That is, is not in the done state. That is, for any toss level N, it wrong to assume that number of nodes is equal to 2^N. It will be strictly smaller as of level N = 3. Anyway, after 3-4 levels drawn, one should see a pattern, that is, the number of tails, or initial state nodes (is), at a level N is equal to the number of is's I had at level N-1 + the number of is's I had at level N-2. We can thus write: is(N) = is(N-1) + is(N-2). we then realize that at every level N, the number of tilt nodes (t) is equal to the number of initial states from the previous level. That is: t(N) = is(N-1) That makes sense, because on the level N-1, all initial states output one tail (becoming a new initial state at level N) and a heads (becoming a tilt state at level N). the other states of level N-1 are either done (so no continuation) or tilt. The possible outcomes of a tilt state are either done or initial state (if I flip heads again, I am done, so I can't go from tilt to tilt.) One then realize that following the same logic, the number of done (d) nodes for a level N is given by: d(N) = t(N-1) = is(N-2) that is, at every level (as of the second level, or two tosses), I will have a number of done outcomes equal to the number of initial states to levels (or tosses) ago. So the general recursive formula to get the number of done nodes for a certain level really is: d(N) = is(N-2) = is(N-3) + is(N-4) We note, by definition: is(N) = 0, is N<0 is(N) = 1, if N = 0, or 1 is(N) = is(N-1) + is(N-2) otherwise. Furthermore, the probability of being at any node of a level N is simply (1/2)^N. So if I want to find the probability that I observed at least one occurrence of 2 heads in a row. I simply add the number of done nodes from level 1 to N multiplying them by the probability of them occurring at each level. That is: P(hh after N tosses) = sum(from i = 1 to N) (d(i).(1/2)^i). E.g. for N = 2, I get: d(1).1/2 + d(2).(1/4) = s(-1).1/2 + s(0).(1/4) = 0 + 1/4. We know that this is true. you can test it for a larger number of tosses and see it is true. as N goes to infinity, the sum will converge to 1, as I have theoretically no chance of never tossing 2 heads in a row if I throw a coin an infinity number of times. I haven't found a solution that didn't use recursions. There probably is one, I'd be interested in seeing one. Show More Responses sorry for all the typos, the solution should be understandable in spite of that. This can be solved by considering the number of sequences of heads/tails that do NOT have consecutive heads. If N coins are tossed, you can have 0 heads in 1 way. You can have 1 head in N ways--choose 1 from any of the N positions in the sequence. You can have 2 heads as long as they are not consecutive. Imagine you have N-2 tails and you need to decide where to place the 2 heads. You can insert them before any of the tails, or after the last tail--so you need to choose 2 out of a possible N-1 positions. Similarly, for any H less than or equal to N/2, you can have H heads by selecting H positions from a possible (N-H)+1 positions. So the number of sequences which do NOT have two consecutive heads can be found by the sum: 1 + nCr(N,1) + nCr(N-1,2) + nCr(N-2,3) + ... Evaluating this starting with N = 2 gives the values 3, 5, 8, 13, 21, 34, ... These are Fibonacci numbers. The number of sequences of length N without 2 consecutive heads is given by F_{N+2}, where F_1 = 1, F_2 = 1, and F_N = F_{N-1} + F_{N-2}. It follows that the probability for obtaining two consecutive heads in N flips of a fair coin is given by 1 - ( F_{N+2}/ 2^N). Note: j-dw has a correct solution. The solution given by Charles ignores the fact that many sequences will have BOTH two consecutive tails AND consecutive heads. He treats these as non-overlapping sets. Delusion ignores all cases such as HTTHTTHTT in which there is more than one T separating the heads. |

### Equity Trader at Lynx Capital Partners was asked...

How many times will you write 'nine' if you wrote out the numbers 1 to 100? 6 Answers20 The correct answer is 11 correction to the above, if you're writing the numbers with letters as opposed to numerically the correct answer is 10. Show More Responses 9,29,39,49,59,69,79,89,99...19 isn't one..so 9 Why wouldn't you count 90, 91, 92, etc? divide the 100 numbers to 10 groups just in natural order, group 1-9 each has a "9",eg 9,19,...89, for group ten, there are 10 "9"s, 91,...99. So the total number is 9+10=19 |

How does raising capital by issuing equity affect the income statement? 3 AnswersNot sure... I believe it would simply increase "other income" No effect on Income Statement. Increase in interest income, increase in shares outstanding |

### Junior Trader at TransMarket Group was asked...

Two butterflies are trading on an underlying: a 50 butterfly and a 100 butterfly. Both are 5 wide and implied volatility is the same. Which one is more expensive? 5 AnswersDoes anyone know the answer to this question? By 50/100 butterfly do you mean a buterrfly for the underlying = 50/100? and other variables constant? By 5 wide do you mean we long a put/call with strike K, long a call/put with K+5, short a call and a put with strike (K+5)/2? If you're referring to a five cent wide butterfly trading at an underlying price of 50 and another trading at an underlying price of 100, then with all things constant, the one trading at an underlying price of 50 would be more expensive. 5 cents is a much wider spread relative to an underlying price of 50, compared to 100. You'd be buying much more vol. (and premium) by buying atms and selling wings. The wings would be cheaper relative to the body, therefore the price of the spread would be more expensive. Now, assuming these are the same products, the max gain on the strategy is the same regardless of where the underlying is trading (5 cents). You'd just be paying more premium if underlying is 50. Show More Responses Easiest way to think of it: The option makes money if you stay within the spread. The spread is the same size for both, however it is relatively half as small in the case of the 100 butterfly (in terms of percentage). Therefore, the 50 butterfly is a better deal. Depends where the underlying is trading at. This question is unclear. The more expensive butterfly will be the one closer to the money and closer to expiration. |

How to use concurrency to make matrix multiply computation faster? what is the complexity? 3 Answersmake each row of left matrix and each column of right matrix to be an independent thread. complexity is O(n^3). If it's a 4x4 matrix & you're running on modern processing hardware then don't use threads at all... Use a single SIMD matrix multiply instruction... check Foxes and Cannon's algorithmes. With the case of Fox algorithm the matrix is divided by sqrt(p), where p - is number of processes. Then, for each submatrix, with separate process computes subresult element C (Cij+=Aik* Bkj ). The rows of matrix A are being shifted right (i+j mod p positions), and columns of matrix B being shifted upwards. Repeat, until i<p. Time complexity = O(n^2) with n processors |

### Junior Trader at TransMarket Group was asked...

Suppose there's a 60% chance of rain on saturday, and a 80% chance of rain on sunday. Given that it rained over the weekend, what's the chance it rained saturday? 3 AnswersUse Baye's formula: b=p(rain over weekend)=1-p(no rain over weekend)= 1-(.4*.2)=.92 a=(p rain on saturday)=.6 p(b given a)= 1 since if it rained on sautrday, it had to rain overhe weekend so p(a)*p(b given a)/p(b)=.6/.92=.65=p(a given b)=p( rain on saturday given it rained on the weekend) 0.65 > 0.5 dude... think again The first answerer is correct I think. One of the following happened: It rained on Saturday only: 0.6 * 0.2 = 0.12 It rained on Sunday only: 0.4 * 0.8 = 0.32 It rained on Saturday and Sunday: 0.6 * 0.8 = 0.48 Add these up: 0.92 total of it raining over the weekend. But the question is stated that it's given that it rained over the weekend. So: Pr(Saturday) = (0.12 + 0.48) / 0.92 = 0.6 / 0.92 = .652 (roughly 2/3) |