# Internship Interview Questions

# 56K

Internship interview questions shared by candidates### Why do you want to work at Nick?

15 Answers↳

I would really love to work at nick so that I can prove that I can handle tough competition like this. Also to inspire girls in my area Less

↳

I would really love to work at nick so that I can prove that I can handle tough competition like this. Also to inspire girls in my area Less

↳

So as get rid of stage fright and to improve my talent

### Flip a coin until either HHT or HTT appears. Is one more likely to appear first? If so, which one and with what probability?

15 Answers↳

HHT is more likely to appear first than HTT. The probability of HHT appearing first is 2/3 and thus the probability of HTT appearing first is 1/3. Indeed, both sequences need H first. Once H appeared, probability of HHT is 1/2 (b/c all you need is one H), and probability of HTT is 1/4 (b/c you need TT). Thus HHT is twice is likely to appear first. So, if the probability that HTT appears first is x, then the probability that HHT appears first is 2x. Since these are disjoint and together exhaust the whole probability space, x+2x=1. Therefore x=1/3. Less

↳

Let A be the event that HTT comes before HHT. P{A} = P{A|H}P{H} + P{A|T}P{T} = .5P{A|H} + .5P{A|T} P{A|T} = P{A} therefore, P{A|H} = P{A|T} P{A|H} = P{A|HH}P{H} + P{A|HT}P{T} = (0)(.5) + P{A|HT}(.5) Therefore, 2P{A|H} = P{A|HT} P{A|HT} = P{A|HTT}P{T} + P{A|HTH}P{H} = (1)(.5) + P{A|H}(.5) 2P{A|H} = .5 + P{A|H}(.5) P{A|H} = 1/3 and P{A|H} = P{A}, therefore, P{A} = 1/3 So, HHT is more likely to appear first and it appears first 2/3 of the time. Less

↳

Above link is the best solution I have seen for this problem http://dicedcoins.wordpress.com/2012/07/19/flip-hhh-before-htt/ Less

### When was the time you had difficulty working in a team and how did you resolve it?

9 Answers↳

divide the te ams

↳

looking the problem size and his effect and try to solve athore wise request for helping the admin Less

↳

Im currently working in danger place who had the biggest enemies to humanity ( taliban , al qaeda ....) . When i started working i was explained about my employer idea and i convience all of them ,we are not enemies we are just trying to help humanity Less

### Suppose that you have a fair coin. You start with $0. You win 1$ each time you get a head and loose $1 each time you get tails. Calculate the probability of getting $2 without getting below $0 at any time.

6 Answers↳

1/3

↳

1/3 Because if he requires 2 heads = $2, then it means he require HH out of {HH,HT ,TH,TT} We cannot consider TT because it would turn to zero. Therefore, he has 1 chance out of 3. Hence 1/3. Less

↳

Marchov chain with 2 and -1 absorbing OR geometric series 1/4^n from 1 to inf=1/3 Less

### You have 100 marbles, 50 are blue, 50 are red. You want to distribute them between two drawers, in such a way that none is left outside and no drawer is left empty. After distributing them you are gonna select a drawer randomly and from that drawer you are gonna remove one marble randomly. How do you distribute the marbles in such a way that the probability of getting a red marble is maximized?

6 Answers↳

Put one red marble in one drawer and all the others in the other drawer.

↳

In drawer #1: 1 RED 0 BLUE In drawer #2: 49 RED 50 BLUE 50% chance of selecting drawer #1 - where there is a 100% chance of selecting RED = .5 * 1.00 = .5 50% chance of selecting drawer #2 - where there is a 49/99 or .4949% chance of selecting RED = .5 * .4949 = .2474 .5 + .2474 = .7475 Less

↳

Here's a really intuitive way to see derive the solution without any actual math. You can obviously achieve 50% odds by putting all the red marbles in one drawer and all the blue marbles in the other. If you were to take a blue marble from the blue drawer and put it into the red drawer, then you slightly decrease the odds overall. Conversely, if you were to take a red marble from the red drawer and put it into the blue drawer, then you slightly *increase* the odds overall, since if you pick the red drawer you still have a 100% chance (at that point) of getting a red marble, and if you pick the blue drawer you now have a nonzero chance of getting a red marble. Repeating this, we arrive at the optimal solution posted by others: one drawer should contain one marble while the other drawer should contain all other marbles. Less

### You have 4 cards, 2 black and 2 red. You play a game where during each round you draw a card. If it's black, you lose a point. If it's red, you gain a point. You can chose to stop at any time. What's the expected value of this game?

7 Answers↳

2/3

↳

how do you get 2/3?

↳

Draw a tree. If you get 1 point, you prefer to stop because that's 1/2 expected value, and otherwise you have (1/2*1/3) to get 2, which is 1/3 expected value. Than find that in the other direction you have to play (0.5*(2/3)*0.5) just to get 1. Less

### Interview question was given a grid of 9x9 sudoku with numbers filled in already, you have to check if it's a valid suoku.

6 Answers↳

First, you tackle with a small 3x3 grid and see if the sum of the numbers match the expected sum of numbers from 1 through 9 because each number has to be distinct in a sudoku. Then you repeat this for 9 mini-sudokus. Finally, you check if for 9 rows and 9 columns if there are any missing numbers or duplicate numbers. Less

↳

But there could be a duplicate number in the small 3X3 grid. This would make it invalid sudoku but you would not catch this if you just look at the expected sum Less

↳

A duplicate number in the small 3x3 grid would not give the desired sum, because the desired sum in a 3x3 Sudoku grid is a constant i.e 55 Less

### How many digits are there in 2^50?

6 Answers↳

16 digits: 2^50 = (2^10)^5 = 1024^5

↳

every 3 powers of 2 the number of digits increases by 1. 50/3 = 16.67, so there are 16 digits. Less

↳

First answer was close, but realize its going to be 50*log(3) ~ 15.05. Since this will be 1.xxx * 10^15, thats 16 digits. (1*10^1) is 2 digits Less

### - Given a linked list, go to the middle and reverse the second half of the list - Rotate the matrix 90 degrees

6 Answers↳

How long did it take for them to get back to you

↳

2 days

↳

Did you go to the Vancouver office too?

### We each flip three fair coins. I offer to pay you $1 if we do not get the same amount of heads, if you agree to pay me $2 if we do (get the same amount of heads). Will you agree to play this game?

6 Answers↳

1/2^6 + 9/2^6 + 9/2^6 + 1/2^6 = 20/64 the probability to get same number of heads. Expected value : 20/64 X (-2) + 44*/64 * (1) = 1/16 play the game Less

↳

Can also calculate with binomial since we can see its sum of squared binomials. General solution for odds of getting same # of heads is (2n C n)/2^n Less

↳

Play the game. EV = 1/16.