AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Vector databases

Practice this question

Beginner — Why use a vector index?

  • It makes repeated similarity queries efficient over a growing corpus.
  • Small datasets can use exact comparison, but larger collections need indexing and careful metadata filtering for relevance and eligibility.
  • Exact search examines eligible vectors thoroughly; approximate search trades some nearest-neighbor recall for speed and scale.
  • I benchmark with realistic filters, corpus sizes, and query patterns rather than assuming ANN is always required.

Senior — Dedicated vector store or existing database?

  • I first test the existing database's vector capability against filtered recall, latency, lifecycle, security, and cost needs.
  • A dedicated store is justified when it solves measured limitations enough to offset another operational dependency.

Scenario — Unauthorized documents are removed after top-k, leaving no results. What is wrong?

  • The retrieval process selected candidates from an ineligible corpus.
  • I move supported eligibility filters into retrieval and recheck object permissions before evidence reaches the model.
  • Post-filtering alone can both underfill results and expose data upstream.
Adapted from 13_AI.MD · “29.5 Vector databases”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.