Layer 3 · Go deeper · 8 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How much RAM per copy for 100 million 768-dimension vectors?
How many nodes serve those 100 million vectors at 4,000 queries a second?
Build-up · 6 steps
Walk an HNSW graph down to q
pgvector, Qdrant, Weaviate, Redis and Elasticsearch all offer HNSW. Follow one query down its layers, then see why inserts are slow and deletes leave tombstones.
Step 1 of 6
Layers, like a skip list
Each vector is a node linked to up to M close neighbours. Each layer up keeps about 1 in M of the nodes below, so 100 million vectors at M = 16 make about 7 layers.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“Your app runs on Postgres and needs semantic search over well under 10 million chunks. Where do the vectors live?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“RAG over company documents: each employee may read only some passages. How do you apply the permission filter?”
Assume each employee may read 1–10% of passages, a filter unrelated to the question’s meaning.
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Reverse image search over a billion images, 768 dimensions each. How do you hold the vectors?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“A chat assistant saves each turn as a vector. The user asks, “What did I just tell you?” Which store do you trust?”
Your move. Pick an approach: