LearnThatStack Ace your next interview
AI Engineering
Embeddings & Vector Databases.
Change topic Change
Practice · Questions

All questions

Showing of 55
Beginner 13
01

What is an embedding, and why are embeddings useful for search applications?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An embedding is a numeric vector that represents the meaning or features of an item. Texts with similar meanings tend to receive nearby vectors, even when they use different words.

For search, the system embeds documents once and stores their vectors. It embeds each query with the same model, compares the query vector with stored vectors, and returns the nearest results. This supports matches such as “close my account” with “cancel a subscription.”

Embeddings are useful for semantic search, recommendations, clustering, and retrieval for language models. They are not perfect relevance labels. Quality also depends on chunking, metadata, index settings, and evaluation on real queries.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

How does semantic search with embeddings differ from keyword search like BM25?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Semantic search compares learned vector representations, so it can match related meanings across different wording. BM25 (Best Matching 25) uses exact terms, term frequency, document length, and word rarity to rank documents.

Embedding search is strong for natural-language questions, synonyms, and paraphrases. BM25 is strong for names, codes, error strings, numbers, and rare terms. Dense search may return a conceptually related but wrong item, while keyword search may miss a good paraphrase.

Many production systems use both. They retrieve candidates from each method, combine the rankings, and optionally rerank them with a stronger model. Evaluate all variants carefully on the same relevance dataset.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

Compare cosine similarity, dot product, and Euclidean distance. When do they produce the same rankings?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Cosine similarity compares vector direction and ignores length. Dot product rewards both alignment and magnitude. Euclidean distance measures straight-line distance between points, with smaller values indicating a closer match.

When every vector has unit length, cosine similarity equals dot product. Euclidean distance is then a monotonic transformation of the same value, so all three produce the same ranking. Without normalization, their rankings can differ.

Choose the metric used during model training or recommended by its documentation. Normalize consistently at ingestion and query time when required. Test the full retrieval system because changing a database metric without rechecking model assumptions can quietly lower recall.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is a vector database, and why can't you just use a regular relational database for similarity search?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A vector database stores vectors and searches for nearby items efficiently. It also manages metadata filters, updates, deletion, replication, and approximate nearest neighbor indexes.

A relational database can store vectors, and extensions such as pgvector add strong similarity search. Plain SQL without a vector index usually compares every row, which becomes slow at large scale. The issue is specialized indexing, not that relational databases are unable to hold arrays.

Use a relational database with vector support when data, transactions, and operational simplicity fit one system. Use a dedicated vector engine when scale, latency, filtering, distributed indexing, or vector-specific operations exceed what the existing database handles well.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What does the dimensionality of an embedding mean, and what are the tradeoffs of higher-dimensional embeddings?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Dimensionality is the number of numeric values in an embedding vector. A 768-dimensional embedding contains 768 values. The dimensions are learned features, not usually human-readable categories.

More dimensions can represent finer distinctions, but they increase storage, memory bandwidth, network transfer, and distance-computation cost. Higher dimension does not automatically mean better retrieval because model training quality matters more.

Some models support shortened vectors trained to retain useful information. Compare available dimensions on your relevance set. Estimate index and replica memory before choosing. Use the smallest dimension that meets quality goals, and never compare vectors created with different dimensions or incompatible models.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

Explain k-nearest-neighbor search and the difference between exact and approximate nearest neighbor search.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

k-nearest-neighbor search returns the k stored vectors closest to a query under a chosen distance metric. Exact search compares the query with every eligible vector and guarantees the true nearest results.

Approximate nearest neighbor (ANN) search uses an index to examine only promising parts of the collection. It can be much faster and use less computation, but may miss some true neighbors.

Use exact search for small datasets, offline evaluation, or filtered sets that are already tiny. Use ANN for large, interactive systems. Tune it by measuring recall against exact results together with latency and memory. The best k for retrieval is separate from the number of index candidates examined.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What happens if you embed queries with a different model than the one used to embed your documents?

Part of Pro
08

Why do we chunk documents before embedding them, and what are typical chunking parameters?

Part of Pro
09

Can you give an overview of the embedding model landscape - the main commercial providers and open-source options?

Part of Pro
10

What is metadata filtering in vector search, and why is it important in real applications?

Part of Pro
11

How would you measure whether your vector search is returning good results? Explain recall@k.

Part of Pro
12

Besides search, what else can embeddings be used for?

Part of Pro
13

What is cosine similarity, and why is it the most common metric for comparing embeddings?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Cosine similarity measures the angle between two vectors. It divides their dot product by the product of their lengths, producing a high score when the vectors point in similar directions.

It is common because direction often captures semantic information while vector magnitude may be unrelated to relevance. If all vectors are normalized to length one, cosine similarity and dot product produce the same ranking and can be computed efficiently.

Use the metric recommended for the embedding model. Some models are trained for dot product or Euclidean distance, and changing the metric can hurt quality. A high cosine score is not a universal proof of relevance, so select thresholds with labeled data.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

Intermediate 20
14

How are modern text embedding models trained? Explain contrastive learning at a high level.

Part of Pro
15

What is the difference between a bi-encoder and a cross-encoder, and how do rerankers fit into a retrieval pipeline?

Part of Pro
16

What are Matryoshka embeddings and why are they useful?

Part of Pro
17

How does the HNSW algorithm work, and what do its main parameters control?

Part of Pro
18

How does IVF indexing work, and how does it compare to HNSW?

Part of Pro
19

Explain product quantization, scalar quantization, and binary quantization. What are the memory and recall tradeoffs?

Part of Pro
20

Walk me through setting up semantic search in Postgres with pgvector.

Part of Pro
21

When would you choose pgvector over a dedicated vector database, and when would you not?

Part of Pro
22

How would you compare the major vector databases, and what criteria would you use to choose one?

Part of Pro
23

When does it make sense to use Elasticsearch or OpenSearch for vector search?

Part of Pro
24

Explain pre-filtering versus post-filtering in vector search. Why is filtering hard for ANN indexes?

Part of Pro
25

What is hybrid search, and why do production systems combine BM25 with dense retrieval?

Part of Pro
26

How does Reciprocal Rank Fusion work, and why is it often preferred over score-based merging?

Part of Pro
27

Why do some embedding models require different handling for queries versus documents?

Part of Pro
28

How would you estimate the memory footprint of an HNSW index?

Part of Pro
29

How do chunk size and overlap affect retrieval quality, and how do you choose them?

Part of Pro
30

How do you keep embeddings in sync when source documents change?

Part of Pro
31

How would you build an evaluation harness for retrieval quality?

Part of Pro
32

How do you handle near-duplicate results and result diversity in retrieval, for example with MMR?

Part of Pro
33

How do you choose an embedding model for a new project, and how much should you trust MTEB scores?

Part of Pro
Expert 22
34

Your users apply highly selective metadata filters and ANN recall collapses. What is happening and how do you fix it?

Part of Pro
35

Your embedding provider deprecates your model. Walk me through a zero-downtime migration to a new embedding model.

Part of Pro
36

How do you shard and scale a vector search system beyond a single node?

Part of Pro
37

Explain binary quantization with rescoring as used in modern vector search engines.

Part of Pro
38

How do multimodal embeddings work, and what should you watch out for when using them?

Part of Pro
39

What normalization pitfalls arise with dot product versus cosine, and how does a model's training constrain your metric choice?

Part of Pro
40

How would you tune HNSW parameters to hit a recall target under a latency budget?

Part of Pro
41

When would you use a disk-based ANN index like DiskANN, and how does it work?

Part of Pro
42

Compare single-vector dense retrieval with learned sparse (SPLADE) and late-interaction (ColBERT) approaches.

Part of Pro
43

Walk me through the cost drivers of an embedding-based search system and how you would reduce them.

Part of Pro
44

How would you design multitenancy in a vector database?

Part of Pro
45

Chunk embeddings lose surrounding document context. What techniques address this?

Part of Pro
46

Design an embedding pipeline for a corpus of 100 million documents that receives continuous updates.

Part of Pro
47

How does ANN index quality degrade over the lifetime of a heavily updated production system, and what practices counter it?

Part of Pro
48

Why can't you use a fixed similarity score threshold to decide whether a result is relevant, and what should you do instead?

Part of Pro
49

Retrieval quality has degraded in production but nothing obvious changed. How do you debug it systematically?

Part of Pro
50

Your hybrid search uses RRF but underperforms on your evaluation set. How would you tune fusion in a large-scale system?

Part of Pro
51

An enterprise needs vector search with strict data-residency compliance, 50 million vectors, complex metadata filters, and a two-person platform team. How do you choose the stack?

Part of Pro
52

When should you fine-tune an embedding model on your own data instead of using an off-the-shelf one?

Part of Pro
53

How can embeddings leak sensitive data, and how would you secure a vector store?

Part of Pro
54

How do deletions work in HNSW-based indexes, and what problems do they cause over time?

Part of Pro
55

How do you scale a vector search system to high query throughput?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Embeddings & Vector Databases? Send them this set.
Pro · $10/mo

48 of 55 Embeddings & Vector Databases answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git