AI Foundations · 18% practice allocation

AI Foundations: RAG & Vector Search Practice Questions

5 free sample questions from the RAG & Vector Search domain, with answers and explanations. The full AI Foundations bank has 735 questions across 5 domains. Questions follow the AI Foundations course content.

1.

A software team is selecting a vector database for their new RAG application. Their key requirements are: (1) support for metadata filtering alongside vector search, (2) a managed cloud-hosted option, and (3) a well-established ecosystem with broad community adoption. Which TWO of the following vector databases meet all three requirements?

  • A. Pinecone✓ Correct
  • B. Weaviate✓ Correct
  • C. SQLite
  • D. Redis (standard, without modules)
  • E. Flat file JSON store
Explanation

Pinecone (A) is a fully managed, cloud-native vector database with built-in metadata filtering and a large community following in the AI/ML space. Weaviate (B) offers a managed cloud tier (Weaviate Cloud Services), supports metadata filtering via its 'where' filter, and has a strong open-source community. SQLite (C) is a relational database with no native vector indexing or similarity search capability. Standard Redis (D) without the RediSearch or RedisAI modules does not support vector similarity search or metadata filtering. A flat file JSON store (E) has no query engine, indexing, or similarity search capability.

2.

Which TWO of the following statements correctly describe the behavior of BM25 in a hybrid RAG retrieval system? (Select TWO)

  • A. BM25 represents documents as dense high-dimensional vectors, similar to sentence-transformer embeddings.
  • B. BM25 scores documents based on term frequency and inverse document frequency, rewarding rare terms that appear in the query.✓ Correct
  • C. BM25 can match exact keywords and product codes that dense retrievers may miss.✓ Correct
  • D. BM25 requires a GPU-accelerated index to perform efficiently at scale.
  • E. BM25 understands semantic paraphrases, so 'automobile' and 'car' receive the same score for a query about vehicles.
Explanation

Options B and C are correct. B: BM25 is a sparse retrieval algorithm that scores based on TF-IDF-like statistics, giving higher weight to rare but relevant query terms. C: Because BM25 operates on exact term matches, it reliably retrieves documents containing specific product codes or rare terms that dense embeddings may not capture. Option A is incorrect; BM25 uses sparse inverted-index representations, not dense vectors. Option D is incorrect; BM25 runs efficiently on CPU using inverted indexes and does not require GPU acceleration. Option E is incorrect; BM25 has no semantic understanding — 'automobile' and 'car' would be treated as completely different tokens.

3.

A developer configures a RAG pipeline to retrieve the top-5 chunks and insert them directly into the LLM prompt as a block of text before the user's question. This pattern of injecting retrieved documents into the prompt context is commonly called what?

  • A. Reranking
  • B. Prompt stuffing or context stuffing✓ Correct
  • C. Hybrid retrieval
  • D. HyDE (Hypothetical Document Embeddings)
Explanation

Option B is correct: 'stuffing' (or context stuffing) refers to inserting retrieved document chunks directly into the prompt context before generation. Option A (reranking) is a post-retrieval step that reorders candidates by relevance — it does not describe how context is placed in a prompt. Option D (HyDE) is a technique where a hypothetical answer is generated to improve retrieval query quality. Option C (hybrid retrieval) describes combining dense and sparse retrieval methods, not prompt construction.

4.

A senior engineer is designing a production RAG pipeline for a financial analyst assistant. Documents include SEC filings, earnings call transcripts, and research reports. The team observes that multi-query retrieval significantly improves recall but increases latency and cost. They must balance answer quality against a strict p95 latency SLA of under 3 seconds. Which TWO of the following design choices MOST effectively reduce latency while preserving the recall benefits of multi-query retrieval? (Select TWO)

  • A. Execute the multiple sub-queries generated by multi-query retrieval in parallel rather than sequentially, reducing total retrieval latency to roughly the time of a single query.✓ Correct
  • B. Increase the number of sub-queries from 3 to 10 to maximize diversity of retrieved documents, which reduces the need for reranking.
  • C. Apply a lightweight bi-encoder reranker across all retrieved chunks before deduplication to reduce the candidate set passed to the cross-encoder.
  • D. Cache vector search results for frequently asked or structurally similar queries, so repeated sub-queries retrieve from cache rather than the vector store.✓ Correct
  • E. Replace the LLM used to generate sub-queries with the same GPT-4o model used for final generation to improve sub-query quality and reduce total API calls.
Explanation

Options A and D are correct. A: Parallelizing the multiple vector store queries means total retrieval time is bounded by the slowest single query rather than the sum of all queries — a direct and significant latency reduction. D: Caching results for common or structurally similar sub-queries (e.g., time-period or company-name variants) avoids redundant vector store round-trips, cutting latency for repeated patterns common in financial analytics. Option B is incorrect; increasing to 10 sub-queries multiplies cost and latency substantially and does not reduce the need for reranking — it increases it. Option C is incorrect; a bi-encoder reranker is effectively another retrieval/scoring pass and adds latency rather than reducing it; deduplication alone would be cheaper. Option E is incorrect; using GPT-4o for sub-query generation is already likely the setup, and it does not reduce the number of API calls — it keeps them the same while increasing per-call cost compared to a smaller model.

5.

A developer is implementing a RAG pipeline using LangChain. After embedding and retrieving relevant chunks, they concatenate those chunks into a single string and insert it into the system prompt before asking the LLM to answer. What is the name of this prompt construction technique?

  • A. Prompt chaining
  • B. Fine-tuning injection
  • C. Retrieval fusion
  • D. Context stuffing✓ Correct
Explanation

Context stuffing (also called prompt stuffing) is the technique of inserting all retrieved passages directly into the prompt context so the LLM can reference them when generating a response. (A) is wrong — prompt chaining refers to sequencing multiple LLM calls where the output of one feeds into the next. (B) is wrong — fine-tuning injection is not a real RAG term; fine-tuning involves updating model weights. (C) is wrong — retrieval fusion is a technique for combining results from multiple retrieval strategies (e.g., BM25 + semantic), not for constructing the final prompt.

Test yourself across every AI Foundations domain

The free AI Foundations practice test mixes about 20 questions weighted like the exam. The full 735-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

RAG & Vector Search study guide (AI Foundations) →

Other AI Foundations domains

← All AI Foundations study resources