AI Foundations · 18% of the exam

RAG & Vector Search: free practice questions

5 sample questions from our 119-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real DataCertPrep exam.

1. In a RAG pipeline, after the top-20 candidate documents are retrieved via semantic search, a cross-encoder reranker is applied before passing context to the LLM. What is the PRIMARY purpose of this reranking step?

  • A. To generate new embeddings for the retrieved documents using a more powerful model
  • B. To reduce the cost of the LLM call by compressing retrieved documents into a single summary
  • C. To jointly score each query-document pair for relevance, improving precision before the context is stuffed into the prompt✓ Correct
  • D. To filter out documents that were created before a specified date cutoff
Explanation

Correct: A cross-encoder reranker (such as Cohere Rerank) takes each (query, document) pair and scores them jointly, considering full interaction between query and document tokens. This is far more accurate than the initial bi-encoder similarity score and improves precision — ensuring the top-k chunks passed to the LLM are truly the most relevant. | Wrong A: Rerankers score existing embeddings or raw text; they do not regenerate embeddings. Re-embedding is a separate process. | Wrong B: Rerankers do not compress or summarize documents; they reorder the existing retrieved set. Summarization is a different technique (map-reduce chains, etc.). | Wrong D: Date filtering is a metadata pre-filter applied before or during retrieval, not a function of a cross-encoder reranker.

2. A team evaluates their RAG system with RAGAS and records a very low 'context recall' score despite users reporting that answers feel accurate. What does a low context recall score MOST likely indicate?

  • A. The LLM is generating answers that contradict the retrieved context
  • B. The retrieval step is failing to surface all the relevant document chunks needed to fully answer the question, even though the chunks that are retrieved are high quality✓ Correct
  • C. The reranker is assigning high scores to irrelevant passages
  • D. The embedding model is producing vectors with too many dimensions, causing slow search
Explanation

Context recall in RAGAS measures whether the retrieved context contains all the information needed to answer the question (i.e., coverage). A low score means relevant chunks exist in the corpus but are not being retrieved — the system has incomplete recall. The answers may still feel acceptable if the retrieved chunks happen to cover the most common question patterns, but coverage of edge cases is poor. (A) describes low faithfulness, not low context recall. (C) describes a precision problem — the reranker promoting bad results — which would lower faithfulness or answer relevance, not context recall. (D) is a red herring; dimensionality affects latency, not recall scores directly.

3. An engineer deploys a RAG system for a legal research firm. After evaluation, they find that semantic search returns the top-20 candidates with high recall but mediocre precision — many retrieved chunks are tangentially related. They add a Cohere Rerank step that scores all 20 candidates and returns only the top-3. Which statement BEST describes why a cross-encoder reranker improves precision over the initial bi-encoder retrieval?

  • A. The cross-encoder processes the query and each candidate chunk jointly in a single forward pass, allowing it to model fine-grained interactions between query tokens and document tokens — something bi-encoders cannot do because they encode query and document independently.✓ Correct
  • B. The cross-encoder is faster than the bi-encoder, so it can search a larger portion of the index and find better matches.
  • C. Cohere Rerank uses BM25 internally to re-score the candidates, replacing the semantic scores with keyword-based scores.
  • D. Cross-encoders are larger models with more parameters, and larger models are always more accurate.
Explanation

Correct: Bi-encoders (used in the initial retrieval) embed query and document independently and compare them via dot product — efficient but unable to model token-level interactions. Cross-encoders take the concatenation of query + document as input, enabling rich attention-based interactions between every query token and every document token. This yields much better relevance scoring at the cost of higher latency, making it ideal as a reranking step over a small candidate set. | Wrong B: Cross-encoders are significantly slower than bi-encoders because they require a forward pass for every query-document pair; they are never used for full-index search. | Wrong C: Cohere Rerank uses a neural cross-encoder model, not BM25; it is a learned relevance model, not a keyword scorer. | Wrong D: Model size correlates loosely with capability but is not the defining reason cross-encoders outperform bi-encoders here; the architectural difference (joint vs. independent encoding) is the key factor.

4. An engineer is building a RAG pipeline for a customer-facing chatbot and needs to select a vector database. The requirements are: (1) must support filtering retrieved results by metadata fields such as 'product_category' and 'document_date', (2) must support hybrid search (dense + sparse), and (3) must be deployable on-premises due to data residency regulations. Which of the following vector databases would BEST satisfy ALL three requirements?

  • A. Pinecone, because it is the most widely used managed vector database and supports all enterprise features.
  • B. Qdrant, because it is open-source, supports on-premises deployment, provides metadata filtering with payload filters, and supports hybrid search with sparse vectors.✓ Correct
  • C. A standard relational database like MySQL with a LIKE query, because metadata filtering is natively supported.
  • D. OpenAI's embedding API, because it provides a retrieval endpoint that handles filtering and ranking automatically.
Explanation

Correct: Qdrant is an open-source, self-hostable vector database written in Rust. It natively supports payload (metadata) filtering, hybrid search via sparse+dense vector combinations, and can be deployed on-premises or in private cloud environments — satisfying all three stated requirements. | Wrong A: Pinecone is a fully managed cloud service (SaaS) and cannot be deployed on-premises, which violates requirement 3. | Wrong C: MySQL with LIKE queries performs lexical pattern matching, not vector similarity search; it has no concept of dense vector retrieval or hybrid search and would be completely unsuitable. | Wrong D: OpenAI's embedding API is a model inference API that returns embedding vectors; it is not a vector database, has no persistent storage, no filtering, and no retrieval endpoint.

5. An AI engineer is explaining to a new team member why a production LLM chatbot sometimes confidently states facts that are completely fabricated. Which of the following BEST explains the root cause of this behavior?

  • A. The LLM's temperature setting is too low, causing it to default to invented answers
  • B. LLMs generate tokens based on statistical patterns learned during training, without an internal mechanism to verify factual accuracy✓ Correct
  • C. The embedding model used during inference is mapping queries to incorrect vector clusters
  • D. The tokenizer is splitting proper nouns incorrectly, leading to nonsensical outputs
Explanation

LLMs are next-token predictors trained on large text corpora; they generate plausible-sounding text based on learned patterns but have no internal fact-checking mechanism, which is the root cause of hallucination. Low temperature (A) actually makes outputs more deterministic and conservative, not more hallucinatory—high temperature is more likely to cause wild outputs, but neither is the root cause. The embedding model (C) is used for retrieval in RAG pipelines, not during standard generative inference, so it is unrelated. Tokenizer behavior (D) can affect output quality in edge cases but does not cause systematic factual hallucination.

114 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free