Sample questions
Question 1Easy
What is the main job of a vector database in a RAG system?
- Training the embedding model on new documents as they arrive
- Generating the final answer text from the retrieved chunks
- Tokenizing user prompts
- Storing embeddings and finding the nearest ones to a query
Answer: D. Storing embeddings and finding the nearest ones to a query
Explanation
Vector stores use approximate nearest neighbour (ANN) indexes such as HNSW to search millions of vectors quickly.
Step-by-step solution
- Documents are embedded and stored as vectors with their text and metadata.
- At query time the query is embedded too.
- The vector database finds the nearest stored vectors quickly, usually with an approximate nearest neighbour index.
Why the other options are wrong
- A. Training embedding models is separate from storing and searching vectors.
- B. The LLM writes the answer; the database only supplies chunks.
- C. Tokenization happens inside the model pipeline, not the vector store.
Tip: Vector DB: store embeddings, return nearest neighbours.
Question 2Easy
- The first sentence of a document, used as a short summary of what it contains
- A list of keywords chosen by hand for each document
- A compressed zip file of the original document's text
- A numeric vector representing the meaning of text (or other data)
Answer: D. A numeric vector representing the meaning of text (or other data)
Explanation
Similar meanings map to nearby vectors, enabling semantic search.
Step-by-step solution
- An embedding model turns text into a list of numbers (a vector).
- Texts with similar meaning get vectors that are close together.
- This lets software compare meaning by measuring distance.
Why the other options are wrong
- A. A first sentence is text, not a numeric representation.
- B. Hand-picked keywords are manual tags, not learned vectors.
- C. Zip compression preserves the bytes, not the meaning.
Tip: Similar meaning, nearby vectors.
Question 3Easy
What is Retrieval-Augmented Generation (RAG)?
- Compressing a model by pruning weights so it can run on smaller devices
- Generating synthetic documents to enlarge the pre-training set
- Fetching relevant documents and adding them to the prompt as context
- Retraining the model every time a source document changes
Answer: C. Fetching relevant documents and adding them to the prompt as context
Explanation
RAG grounds answers in up-to-date or private data without changing model weights.
Step-by-step solution
- The user's question is used to search a document store.
- The most relevant passages are fetched.
- They are added to the prompt so the model answers from them.
Why the other options are wrong
- A. That describes model pruning.
- B. Generating synthetic data is a training technique, not RAG.
- D. RAG avoids retraining; only the index is updated.
Tip: RAG = search first, then answer with what you found.
Question 4Medium
Why are documents split into chunks before embedding in RAG?
- Embedding models cannot process punctuation, so chunks are split at every full stop
- Chunking makes the LLM's weights smaller and faster to load
- Focused chunks retrieve more precisely and fit the context window
- Chunking encrypts the documents so they can be stored safely
Answer: C. Focused chunks retrieve more precisely and fit the context window
Explanation
Very large chunks dilute meaning and waste context; very small chunks lose surrounding context. Overlap helps keep related sentences together.
Step-by-step solution
- A whole document is too long for one focused embedding and may not fit the prompt.
- Smaller chunks each cover one idea, so a query matches the right part.
- Only the relevant chunks go into the context window.
Why the other options are wrong
- A. Embedding models handle punctuation fine; chunking is about size and focus.
- B. Chunking affects the documents, not the model's weights.
- D. Chunking does not encrypt anything.
Tip: Chunk for precision, overlap for continuity.
Question 5Medium
What is the cosine similarity between the vectors (1, 0, 1) and (1, 1, 0)?
- 1
- 0
- 0.71
- 0.5
Answer: D. 0.5
Explanation
Dot product = 1 x 1 + 0 x 1 + 1 x 0
= 1.
Each vector's length is sqrt(2).
Cosine = 1 / (sqrt(2) x sqrt(2))
= 1 / 2
= 0.5.
Step-by-step solution
- Dot product:
1x1 + 0x1 + 1x0 = 1.
- Length of each vector:
sqrt(1 + 0 + 1) = sqrt(2).
- Cosine = 1 / (sqrt(2) x sqrt(2))
= 1/2
= 0.5.
Why the other options are wrong
- A. 1 would mean the vectors point the same way, which they do not.
- B. 0 would need a zero dot product, but it is 1.
- C. 0.71 is 1/sqrt(2): it divides by only one vector length.
Tip: cos = (a.b) / (|a| |b|); cosine 0.5 means a 60-degree angle.
Question 6Medium
What is the purpose of a re-ranker in a retrieval pipeline?
- Re-training the embedding model on each incoming query
- Deleting duplicate documents from storage to keep the vector index small and fast
- Re-scoring top retrieved candidates with a more accurate model
- Changing the order of words in the generated answer
Answer: C. Re-scoring top retrieved candidates with a more accurate model
Explanation
A first-stage retriever fetches many candidates cheaply; a cross-encoder re-ranker then orders the best few for the prompt.
Step-by-step solution
- A fast first-stage retriever returns many candidates (say 50).
- A re-ranker, often a cross-encoder, reads the query and each candidate together.
- It re-scores them so the best few go into the prompt.
Why the other options are wrong
- A. Re-rankers score results; they do not retrain the embedding model.
- B. Removing duplicates is index maintenance, not re-ranking.
- D. Re-ranking orders retrieved documents, not words in the answer.
Tip: Retrieve wide and cheap, then re-rank narrow and precise.
Question 7Hard
What does hybrid search in a RAG pipeline usually combine?
- Images and text together in the same prompt
- Keyword-based search (e.g. BM25) with dense vector (semantic) search
- Two different LLMs answering the same question and voting
- Fine-tuning and prompting
Answer: B. Keyword-based search (e.g. BM25) with dense vector (semantic) search
Explanation
Keyword search catches exact terms like product codes, while vector search catches paraphrases; results are merged or re-ranked.
Step-by-step solution
- Keyword search (e.g. BM25) matches exact terms such as product codes.
- Dense vector search matches meaning and paraphrases.
- Hybrid search runs both and merges the results.
Why the other options are wrong
- A. Mixing images and text is multimodal input, not hybrid search.
- C. Model voting is an ensemble, not a retrieval method.
- D. Fine-tuning and prompting are ways to adapt a model, not to search.
Tip: Codes and names: keywords. Paraphrases: vectors. Both: hybrid.
Question 8Hard
A 2,000-token document is split into chunks of 500 tokens with an overlap of 100 tokens between consecutive chunks. How many chunks are produced?
- 20
- 5
- 4
- 6
Answer: B. 5
Explanation
Each new chunk starts 500 - 100 = 400 tokens after the previous one: starts at 0, 400, 800, 1200, 1600. The chunk starting at 1600 reaches 2000, so there are 5 chunks.
Step-by-step solution
- Stride = chunk size - overlap
= 500 - 100
= 400 tokens.
- Chunks start at 0, 400, 800, 1200, 1600.
- The chunk starting at 1600 reaches token 2000, the end.
- So 5 chunks.
Why the other options are wrong
- A. 20 would come from dividing by 100, the overlap.
- C. 4 ignores overlap: 2000 / 500.
- D. 6 adds an extra chunk past the end of the document.
Tip: Chunks = ceil((L - C) / (C - O)) + 1.
Practise all 8 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →