## Questions d'entretien

Entretien pour Data Scientist

-

# We have two options for serving ads within Newsfeed: 1 - out of every 25 stories, one will be an ad 2 - every story has a 4% chance of being an ad For each option, what is the expected number of ads shown in 100 news stories? If we go with option 2, what is the chance a user will be shown only a single ad in 100 stories? What about no ads at all?

Répondre

## Réponses aux questions d'entretien

16 réponse(s)

11

For the questions 1: I think both options have the same expected value of 4 For the question 2: Use binomial distribution function. So basically, for one case to happen, you will use this function p(one case) = (0.96)^99*(0.04)^1 In total, there are 100 positions for the ad. 100 * p(one case) = 7.03%

rh le

11

For "MockInterview dot co": The binomial part is correct but you argue that the expected value for option 2 is not 4 but this is false. In both cases E(x) = np = 100*(4/100) = 4 and E(x) = np=100*(1/25) = 4 again.

Josito le

7

Chance of getting exactly one add is ~7% As the formula is (NK) (0,04)^K * (0,96)^(N−K) where the first (NK) is the combination number N over K

Filip le

8

Bin(100, 0.04,1) Bin(100, 0.04, 0) Bin(n,p,r) = Binomial distribution for n trials, p probability of being ad and r number of ads.

Chaiwala le

3

1. Calculate the probability of getting 1 ad and 99 no ads = (.04)^1 * (.96)^99 2. Calculate the number of combinations where order does not matter (meaning you can be served an ad on the 25th story or 1st story -- it does not matter) = 100! / (99!*1!) = 100 multiple 1 * 2 which gives you 7% of being served an ad.

Utilisateur anonyme le

2

1) What is the Expected count of ads per 100 stories? For mode 1 the probability of 4 ads is 1, and all other counts is zero. The expected value is 4. For mode 2: The count of successes in n independent trials of probability p is distributed Binomial(n,p). The expected value of Binomial(n,p) is np. The expected value of mode 2 is also 4. This matches our intuition. 2) What is the probability of just one ad in a sequence of 100? We will consider only mode 2 (since mode 1 is obviously zero). This is equivalent to the probability of just one success in a sequence of 100 Bernoulli trials with probability .04. Again, the count of successes is distributed B(100, .04). Let us consider the PMF of Bernouli: (nCk) p^k q^(n-k) , where k is the count of successes. Substituting we have (100c1) .04^1 * .96^99 = .0702... Finally, let us consider the case where k = 0. Substituting the pmf again, we find p(k=0) ~= .0168...

Utilisateur anonyme le

1

Given: Case 1 : P(ad) = 1/25 = 0.04 Case 2: P(ad) = 0.04 Q1: Expected number of Ads in 100 stories = 100 * P(ad). Case 1: (1/25)*100 = 4 Case 2: (0.04)*100 = 4 Q2. Chance a user will be shown only a single ad in 100 news stories: P(X=1) = (100)*(0.04)*(0.96)^99 = 0.07 ~ 7% P(X=0) = (0.96^100) ~ 1.7%

Anonymous le

0

Can someone explain why the answer for part 2 is not 4? What is the evidence that we should use binomial?

Goosal le

0

For each option, what is the expected mean and variance a user will be shown 2 back-to-back ads?

NAYEON le

0

4. My question is does the 4 ads pay for the cost 100 news feeds?

Utilisateur anonyme le

0

for the follow up: p = 0.04 1-p = 0.96 Ho: p=0.04 Ha: p<0.04 z_stat = 0.01-0.04/np.sqrt((0.04*0.96)/100)=-1.5 A whole lot of chance for 1 in 100 stories to happen.. cannot reject the null.

Anonymous le

0

what is the expected mean and standard deviation to have back to back ads in those two method?

Utilisateur anonyme le

7

Expected number of ads in option 1 is 4. Expected number of ads in option 2 is 0.04 * 100, which is also 4.

Utilisateur anonyme le

0

Thanks Josito! you are right -- 4 is the asnwer, sorry for the confusion!

MockInterview dot co le

2