Embeddings and RAG practice problems

17 problems · 0 solved

Retrieval-augmented generation, or RAG, gives an LLM fresh facts by first searching a document store and then passing the best passages into the prompt. Documents are cut into chunks and turned into embedding vectors, so similar meaning ends up close in vector space. It is like an open-book exam where the skill is finding the right page fast. These problems cover each piece of a retrieval pipeline. You will split documents into overlapping chunks and chunk by sentences under a token budget, retrieve the top-k chunks for a query, rank documents with BM25, combine keyword and vector scores, merge rankings with reciprocal rank fusion, re-rank for diversity with maximal marginal relevance, truncate Matryoshka embeddings, search binary embeddings by Hamming distance, search an IVF index, score vectors with product quantization, and measure recall at k. Start with the Easy problems on top-k retrieval and rank fusion. Then do chunking and hybrid scoring, and finish with BM25, MMR and the compressed indexes. RAG is one of the most common LLM features built at companies today, and interviews for applied AI roles often ask you to design or debug one.

Easy 6

Medium 7

Hard 4

Related topics

All practice problems