Skip to main content
AI Interview Question
All Questions
DEEP EXPLANATION

Distance Metrics: Cosine, Dot, Euclidean (SOLVED)

Project BasedVector DatabasesEasy8 min read

Embedding geometry and index metric choice — normalization, MIPS, and provider defaults for text retrieval.

TL;DR — Quick Answer

Cosine similarity measures directional alignment and is standard for normalized text embeddings. Dot product equals cosine on unit vectors but supports MIPS when magnitudes carry signal. Euclidean (L2) reflects absolute distance in space — common for image/audio embeddings. Match your metric to how the embedding model was trained and what your index optimizes.

The Interview Question

When should you use cosine similarity, dot product, or Euclidean distance for vector search?

Deep Explanation

Sign in to unlock full answer

Get deep explanations, PDF export & all Vector Databases questions

  • 20 more sections of deep explanation
  • Real-world examples
  • Common mistakes
  • Interviewer expectations
  • Follow-up questions
CosineDot ProductEuclideanSimilarityOpenAICohere