Implement local maxima, bagging, and k-means | Coinbase Interview Question