G-Research interview question

Coding and stats problems I had to solve.