Implement K-Means Clustering from Scratch

Asked at Coinbase · ML Fundamentals & Algorithms · Difficulty: Medium · Last asked Feb 8, 2026

K-means is the standard algorithm for splitting points into K groups by distance. Implement it from scratch for a given set of starting centers, so that the result is deterministic.

Loading the problem…