Machine Learning Interview Question 4 - Solution