Stitch Fix Interview Question

1 coding question : Write a function for sampling from a multimodal distribution. Your inputs are: Keys (i.e. green, red, blue) Weights (i.e. 2, 3, 5.5) N (number of samples drawn from this distribution ( i.e. n=5) Output : list of n keys: Example n = 5: [blue, blue, blue, red, green] Hint: draw a rv of uniform distribution. Calculate the normalized weights for each key. - Machine Learning question : we have a list of items and how many times each item is purchased (range from 10 to 100000 times). For each user the probability of user buying each item is uniform (same across all users). Let’s say we have an item "A" that has been recommended 10 times, has been purchased 10 times. What is the long term probability of being purchased for this item ?

Interview Answer

Anonymous

Jul 31, 2020

- first question: couldn't answer thoroughly at the time but after the intreview: def sample_multivar_3(k = ['green', 'red', 'blue'], w = [2,3,5.5] ,n = 3): if len(k) != len(w) or len(w) != n: print('wrong entry') samples = np.random.uniform(0,sum(w),n) res = samples for i in range(len(k)): trues = (samplessum(w[:i])) res = np.where(trues== True, k[i],res ) return samples, res - ML question : I thought I should propose an ML model, therefore suggested Recommended system collaborative filtering, etc. It seemed like they were expecting me to answer this question using bayesian statistics. It wasn't that I didn't know how to answer it using bayesian statistics, my understanding of the point of question was wrong! The interviewer had a background in statistics and both questions were addressed to measure my understanding of probability. Not a good method in my opinion.