IBM Interview Question

How does the KNN algorithm work?