AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Embeddings

Practice this question

Beginner — Explain an embedding.

  • It is a numerical vector that represents useful features of content, often meaning.
  • Similar wording or meaning tends to produce nearby vectors, enabling retrieval of “vehicle collision” for a query about “car accident.”

Intermediate — What does cosine similarity tell you?

  • It compares vector direction and helps rank related content.
  • A high score is not a probability that the passage is true or sufficient.
  • I use a compatible metric and calibrate thresholds on domain-specific queries.

Senior — How do you upgrade embedding models?

  • I version models and index data, re-embed the intended corpus into a separate compatible space, evaluate filtered retrieval, and switch query/index routing together.
  • I preserve source data and support rollback instead of mixing arbitrary old and new vectors.

Scenario — Policy-code search fails despite good semantic search. What do you do?

  • I add exact identifier fields and lexical/hybrid retrieval.
  • Embeddings may not preserve rare codes or precise numbers well.
  • I test actual identifiers and keep them intact during query rewriting and text preprocessing.
Adapted from 13_AI.MD · “29.4 Embeddings”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.