Two Sigma Interview Question

About prob question (hard)