Two Sigma Interview Question

genreate some random variable and a DB issue to solve