Implement K-means clustering from scratch | Microsoft Interview Question