← Questions

Embedding retrieval with cosine similarity

0
HarveyCodingLast asked Sep 2026

A coding interview question asked in Harvey's coding round, last asked Sep 2026. It tests embeddings, retrieval and similarity.

Given a query embedding and a small set of candidate embeddings, return the candidates most similar to the query by cosine similarity. Then explain the metric: how cosine relates to the dot product and to Euclidean distance, and when…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Harvey · Coding · Last asked Sep 202660 min · Live practical coding · Candidates report freedom to use the tools and languages they know; confirm with your recruiter

What it tests

embeddings · retrieval · similarity

Your code and the AI tutor open when you unlock this question.