Vector Databases interview questions

30 questions from the Vector Databases course, each with the correct answer and an explanation. Try to answer before you open the answer.

What a Vector Database Is

1. What does a vector database add beyond an ANN index library?

  1. Free GPUs
  2. A new embedding model
  3. Durability, updates, filters, access control, replication and operations
  4. Perfect recall always
Show answer

Answer: Durability, updates, filters, access control, replication and operations

The database turns a fast index into a dependable system.

Lesson: Why Vectors Need a Database

3. Why derive record IDs from document ID and chunk number?

  1. Databases forbid other IDs
  2. IDs must be random
  3. It makes vectors smaller
  4. Re-ingesting overwrites instead of duplicating
Show answer

Answer: Re-ingesting overwrites instead of duplicating

Stable IDs make updates idempotent.

Lesson: Data Model: Collections, Records, Payloads and Namespaces

4. What does "eventual consistency" mean for a new write in some vector engines?

  1. It is searchable before it is written
  2. It may become searchable after a short delay
  3. It is never searchable
  4. It replaces the index
Show answer

Answer: It may become searchable after a short delay

Do not assume read-your-writes unless the engine documents it.

Lesson: What to Expect: Approximate, Eventually Consistent, Not a General Database

pgvector: Vectors Inside PostgreSQL

5. What happens if you insert a vector of the wrong dimension into a vector(3) column?

  1. It is silently padded
  2. An error is raised
  3. It is stored as text
  4. The database restarts
Show answer

Answer: An error is raised

Dimension checks catch mixing of embedding models early.

Lesson: Creating a Table With a vector Column

6. Why is <#> the negative inner product?

  1. Inner products are negative by nature
  2. It is a bug
  3. To save space
  4. So ascending ORDER BY always returns nearest first for every operator
Show answer

Answer: So ascending ORDER BY always returns nearest first for every operator

A larger inner product means closer, so it is negated to fit "smaller is closer".

Lesson: Distance Operators and ORDER BY

7. Which is a strength of pgvector for filtering?

  1. Full SQL: joins, ranges, row-level security
  2. No filtering is possible
  3. Only equality on one field
  4. Filtering only in the prompt
Show answer

Answer: Full SQL: joins, ranges, row-level security

The vector is just another column in a relational database.

Lesson: Filtering With WHERE: SQL and Vectors Together

8. What benefit do transactions give vector data?

  1. Higher recall automatically
  2. Faster embeddings
  3. Atomic updates of text and embedding, and rollback
  4. No need for backups
Show answer

Answer: Atomic updates of text and embedding, and rollback

Row-level ACID semantics apply to the vector column too.

Lesson: Transactions and Types: vector, halfvec

Indexing in Practice

9. Why keep the exact scan even after adding an index?

  1. Indexes cannot be used without it
  2. It is always faster than the index
  3. It provides ground truth to measure the index's recall
  4. It reduces storage
Show answer

Answer: It provides ground truth to measure the index's recall

Recall is only defined relative to the exact answer.

Lesson: Without an Index: The Exact Sequential Scan

10. How do you confirm that PostgreSQL uses the HNSW index?

  1. EXPLAIN shows Index Scan using the index
  2. The table gets smaller
  3. The row count changes
  4. By restarting the server
Show answer

Answer: EXPLAIN shows Index Scan using the index

The plan is the source of truth about what the planner does.

Lesson: Creating an HNSW Index and Reading the Plan

11. How do you measure the recall of an HNSW index?

  1. It cannot be measured
  2. Count its rows
  3. Read the table name
  4. Compare its results with exact search on a sample of queries
Show answer

Answer: Compare its results with exact search on a sample of queries

Recall = overlap of approximate and exact top-k results.

Lesson: Measuring and Tuning Recall (ef_search)

12. Which index type usually gives better recall at the same speed in pgvector?

  1. IVFFlat
  2. HNSW
  3. Neither; they are identical
  4. A B-tree
Show answer

Answer: HNSW

IVFFlat trades some recall for faster builds and smaller memory.

Lesson: Index Size, Build Time and IVFFlat

Filtered and Hybrid Search

13. Why can a very selective filter with an HNSW index return too few rows?

  1. Filters are not allowed
  2. The index returns a fixed number of nearest candidates and the filter then removes most of them
  3. The table is empty
  4. Vectors cannot have tenants
Show answer

Answer: The index returns a fixed number of nearest candidates and the filter then removes most of them

Post-filtering a small candidate set can leave nothing; use iterative scans or filter-aware search.

Lesson: The Filtered-Search Problem

14. For a few very large tenants, which design gives each tenant an accurate index?

  1. Filtering in the UI
  2. One index with no tenant column
  3. No indexes at all
  4. A partial index (or partition) per tenant
Show answer

Answer: A partial index (or partition) per tenant

Each index then contains only rows that can match.

Lesson: Pre-Filtering, Partial Indexes and Partitions

15. Why is rank-based fusion popular for hybrid search?

  1. Keyword and vector scores are on different scales; ranks are comparable
  2. It needs no ranking
  3. It removes the need for vectors
  4. It makes queries slower on purpose
Show answer

Answer: Keyword and vector scores are on different scales; ranks are comparable

RRF avoids calibrating incompatible scores.

Lesson: Hybrid Search: Full-Text Plus Vectors

16. What makes Qdrant's filtered search robust?

  1. It only supports exact search
  2. It ignores filters
  3. Payload conditions are checked during graph traversal, with payload indexes
  4. Filters run in the browser
Show answer

Answer: Payload conditions are checked during graph traversal, with payload indexes

Filter-aware traversal avoids returning too few results.

Lesson: Filtering in a Dedicated Engine: Qdrant

Other Engines and How to Compare Them

17. What does Chroma do if you add documents without embeddings?

  1. Stores them as images
  2. Refuses all inserts
  3. Calls a configured embedding function to create them
  4. Deletes the collection
Show answer

Answer: Calls a configured embedding function to create them

Convenient, but it may download or call a model; pass your own vectors for control.

Lesson: Chroma: A Developer-Friendly Embedded Store

18. Why compare engines with questions about your workload rather than feature tables?

  1. Feature lists look alike and change often; behaviour on your data decides
  2. Features never matter
  3. Vendors forbid comparison
  4. Tables are always wrong
Show answer

Answer: Feature lists look alike and change often; behaviour on your data decides

Test with your vectors, filters and load before choosing.

Lesson: Comparing Engines: A Practical Checklist

19. Why must a benchmark report recall along with latency?

  1. Latency is meaningless
  2. Recall is a type of latency
  3. It is required by SQL
  4. A system can look fast simply by returning worse results
Show answer

Answer: A system can look fast simply by returning worse results

Compare engines at equal recall, not at default settings.

Lesson: Benchmarking Honestly

Operating at Scale

20. Why make writes idempotent with deterministic IDs?

  1. To make vectors bigger
  2. So retries after failures cannot create duplicates
  3. To avoid indexes
  4. To speed up embeddings
Show answer

Answer: So retries after failures cannot create duplicates

Upserting the same ID twice leaves one record.

Lesson: Bulk Ingestion and Batching

21. How is a query answered in a sharded vector database?

  1. Only the first shard is searched
  2. Each shard returns its local top-k and a coordinator merges them
  3. The client searches the disks
  4. Shards are merged at write time
Show answer

Answer: Each shard returns its local top-k and a coordinator merges them

Fan-out and merge gives the global nearest neighbours.

Lesson: Sharding: Splitting Data Across Machines

22. With N=3 copies, which setting guarantees read-your-writes?

  1. Replication cannot guarantee it
  2. W=1 and R=1
  3. W=0 and R=3
  4. W=2 and R=2
Show answer

Answer: W=2 and R=2

W + R > N means the sets overlap: 2 + 2 > 3.

Lesson: Replication, Quorums and Read-Your-Writes

23. What should you do after a paper capacity estimate?

  1. Confirm with a load test on a representative sample
  2. Buy hardware immediately
  3. Ignore overhead
  4. Skip replicas
Show answer

Answer: Confirm with a load test on a representative sample

Engines add their own overhead; real measurements beat formulas.

Lesson: Capacity Planning: Memory Is the Budget

Security, Backups and Choosing

24. Where should tenant isolation be enforced?

  1. Only in the UI
  2. Only in the prompt
  3. In the database (row-level security, collections or namespaces), tested automatically
  4. Nowhere
Show answer

Answer: In the database (row-level security, collections or namespaces), tested automatically

Isolation must hold even if application code or prompts are wrong.

Lesson: Security and Multi-Tenancy

25. How should you switch to a new embedding model?

  1. Replace the model and keep old vectors
  2. Mix old and new vectors in the same index
  3. Build a new index, re-embed everything, compare, then switch with a rollback option
  4. Delete the sources
Show answer

Answer: Build a new index, re-embed everything, compare, then switch with a rollback option

Different models produce incompatible spaces.

Lesson: Backups, Migrations and Re-Embedding

26. Which metric catches a silent loss of search quality after an upgrade?

  1. Recall@k on a golden set or sampled queries vs exact search
  2. Server uptime alone
  3. CPU temperature
  4. Number of tables
Show answer

Answer: Recall@k on a golden set or sampled queries vs exact search

Uptime can be perfect while results quietly get worse.

Lesson: Monitoring and Cost

Putting It Together

27. Why does the case study start with PostgreSQL + pgvector?

  1. Vector search is impossible elsewhere
  2. PostgreSQL is always the fastest option
  3. Dedicated engines cannot filter
  4. It keeps vectors with existing data, supports row-level security, and the team already runs it
Show answer

Answer: It keeps vectors with existing data, supports row-level security, and the team already runs it

Start with what you operate; move only when measured needs demand it.

Lesson: Case Study: Choosing and Running a Store for a SaaS Knowledge Base

28. You add a `WHERE tenant = 7` filter to an HNSW query and get zero rows although tenant 7 has data. What is the likely cause and a fix?

  1. The data was deleted by the index
  2. Post-filtering of a small candidate list; enable iterative scans or use partial indexes/filter-aware search
  3. Vectors cannot be filtered
  4. The server clock is wrong
Show answer

Answer: Post-filtering of a small candidate list; enable iterative scans or use partial indexes/filter-aware search

The index returns nearest candidates first; the filter then removes them.

Lesson: Revision: Cheat Sheet and Self-Check

29. Which statement about HNSW tuning is correct?

  1. ef_search has no effect
  2. Raising ef_search raises recall and latency; measure recall against exact search
  3. Lower ef_search always improves recall
  4. Recall cannot be measured
Show answer

Answer: Raising ef_search raises recall and latency; measure recall against exact search

Recall and latency trade off along the ef_search knob.

Lesson: Revision: Cheat Sheet and Self-Check

30. Your cluster keeps 3 copies of each shard. Which write and read settings guarantee you read your latest acknowledged write?

  1. Neither matters
  2. Write to 1 and read from 1
  3. Write to 1 and read from 2 only if lucky
  4. Write to 2 and read from 2
Show answer

Answer: Write to 2 and read from 2

W + R > N guarantees the write and read sets overlap.

Lesson: Revision: Cheat Sheet and Self-Check

← Back to the course