← Back to modules

Vector Databases & ANN Search — Core

What a vector DB is, ANN vs exact search, HNSW/IVF/PQ indexes, distance metrics, metadata filtering, quantization, and vendor concepts (Pinecone, Qdrant, Milvus, Weaviate, Chroma).

Medium50 questions

Sample questions

1

What is the core job of a vector database?

  • To store embeddings and find nearest vectors by similarity
  • To train the embedding model that produces the vectors
  • To translate SQL queries into natural language
  • To compress images into thumbnails for display

Why

A vector database indexes embedding vectors and serves fast nearest-neighbor (similarity) search, usually with metadata filtering and CRUD. It doesn't train the embedding model, translate SQL, or process images.

2

How does a vector database differ from a standalone ANN library like FAISS?

  • It wraps ANN with persistence, filtering, scaling
  • It cannot perform nearest-neighbor search at all
  • It only stores text, never vectors
  • It replaces the need for embeddings entirely

Why

A vector DB wraps ANN search with production features: durable storage, payload/metadata filtering, distributed sharding/replication, security, and live updates — beyond a raw index library. It does do ANN search, stores vectors, and still needs embeddings.

3

Why do vector databases use Approximate Nearest Neighbor (ANN) search instead of exact search?

  • Exact search over millions is too slow
  • Exact search changes the stored vectors
  • ANN returns more results than exact search
  • ANN is required to compute cosine similarity

Why

Exact nearest-neighbor compares the query against every vector (linear cost), which is too slow at scale; ANN trades a little recall for sublinear search. It doesn't alter vectors, return more results, or enable cosine.

4

HNSW, a popular ANN index, is best described as what kind of structure?

  • A single flat list scanned linearly
  • A hash table mapping vectors to exact buckets
  • A balanced B-tree over scalar keys
  • A multi-layer graph searched greedily from the top

Why

HNSW builds a hierarchy of proximity graphs: search starts in a sparse top layer and descends, greedily hopping to closer neighbors — fast, high-recall ANN. It is not a flat scan, a hash table (that's LSH), or a B-tree.

5

In HNSW, what do the upper (sparser) graph layers do during a search?

  • Long hops reach the query's region fast
  • They store the raw document text for each vector
  • They hold the metadata filters for the query
  • They compress the vectors to save memory

Why

Sparse upper layers have long-range links, so the search covers big distances fast to reach the query's neighborhood, then refines in denser lower layers. They don't store text, filters, or perform compression.

Free account

Take the full module

These are the first few of 50 questions. A free account opens the rest as a scored drill.

  • Every question in this module
  • Instant feedback and supporting reading
  • Your score and progress, saved

Free · your email is used for progress only.