What is an embedding, why is cosine similarity used, and what would make two nearby vectors not actually similar?

Answer it out loud before you open anything. The value of the flags below is in comparing them to what you actually said — including whether you asked about the data before naming a model.

The production scenario behind the question

A retailer built a "similar products" feature from product embeddings and cosine similarity. It works well for shoes and badly for groceries, where a bag of rice is "similar" to a bag of flour and also to a bag of charcoal. A 2D plot of the embeddings in a slide deck looks convincing.

What it is really testing

Whether the candidate understands what an embedding encodes — whatever the training objective made it encode — and can therefore explain when the geometry is meaningful, why cosine is used rather than Euclidean distance, and why a 2D projection is not evidence of anything.

Where the mechanism is taught