What happens when the notion of distance is poorly defined in KNN?

Updated May 16, 2026

Short answer

KNN fails because neighborhood relationships become meaningless.

Deep explanation

KNN entirely depends on the distance metric. If the metric does not reflect semantic similarity, the nearest neighbors are not truly relevant, leading to poor predictions. This is common in categorical or poorly scaled feature spaces.

Real-world example

Using Euclidean distance on categorical user preferences leads to incorrect recommendations.

Common mistakes

  • Assuming Euclidean distance always works.

Follow-up questions

  • What is a better alternative metric?
  • Why is metric choice critical?

More K-Nearest Neighbors interview questions

View all →