Google Interview Question

Write a function that draws N samples from a population with mean = 0, SD = 1 and plot the histogram.

Interview Answer

Anonymous

Jun 10, 2022

need to ask what distribution does the population follow. Assuming they mean a population of normal distribution with mean = 0 and sd = 1 import numpy as np import matplotlib.pyplot as plt N = 1000 normal_samples = np.random.normal(0, 1, N) ax = plt.hist(normal_samples, bins = N) plt.show()

9