Questions
40 of 46
1What is RAG and why is it preferred over fine-tuning for domain-specific knowledge in production applications?
2What are the core components of a RAG pipeline in LangChain — Document Loaders, Text Splitters, Embeddings, Vector Stores, Retrievers, and Chains?
3What is the difference between semantic search and keyword search and why does RAG rely on semantic similarity?
4What is an Embedding in the context of RAG — what does it represent and why is cosine similarity used to compare them?
5What is a Vector Store and how does it differ from a traditional relational or document database?
6What is the difference between a Retriever and a Vector Store in LangChain — why is the abstraction separation important?
7What is a Document object in LangChain — what are pageContent and metadata fields and why does metadata matter in RAG?
8What are Document Loaders in LangChain and how do you choose the right loader for PDFs, web pages, Notion, Google Drive, or SQL databases?
9What is the difference between RecursiveCharacterTextSplitter and CharacterTextSplitter — when would you use one over the other?
10What is chunk size and chunk overlap in text splitting — how do you decide the right values for your use case?
11How do you handle structured documents like tables, code blocks, or markdown files during the splitting phase to avoid breaking semantic meaning?
12How do you load and split documents lazily (streaming) to handle very large files without running out of memory?
13What is a SemanticChunker and how does it differ from fixed-size character-based splitting?
14How do you preserve and propagate source metadata (filename, page number, URL, timestamp) through the loading and splitting pipeline?
15How do you choose the right embedding model — what tradeoffs exist between OpenAI embeddings, Cohere, HuggingFace, and local models like nomic-embed?
16What is the difference between dense embeddings and sparse embeddings (BM25) — when would you combine both in a hybrid search?
17How do you handle embedding model upgrades in production — what happens to your existing vectors when you switch models?
18How do you efficiently batch embed a large corpus of documents without hitting rate limits or memory constraints?
19What are the tradeoffs between vector stores like Pinecone, Weaviate, Chroma, pgvector, and FAISS — how do you choose for production?
20How do you implement namespace or tenant isolation in a vector store for a multi-tenant RAG application?
21How do you handle incremental updates to a vector store — adding, updating, and deleting documents without full re-indexing?
22What is HNSW indexing and why does it make approximate nearest neighbor search fast at scale?
23What is a similarity score threshold in retrieval and how do you use it to filter out low-confidence results?
24What is MMR (Maximal Marginal Relevance) retrieval and how does it balance relevance with diversity of results?
25What is a MultiQueryRetriever and how does it improve recall by generating multiple phrasings of the same question?
26What is Contextual Compression in LangChain retrieval and how does it reduce noise in retrieved chunks?
27What is a ParentDocumentRetriever — how does it index small chunks but return larger parent chunks to the LLM?
28What is HyDE (Hypothetical Document Embedding) and how does it improve retrieval for vague or abstract queries?
29What is Self-Query Retrieval and how does it allow the LLM to generate structured metadata filters alongside the semantic query?
30How do you implement hybrid search combining dense vector search with BM25 keyword search using EnsembleRetriever?
31What is a Re-ranker (cross-encoder) and where does it fit in the RAG pipeline after initial retrieval?
32What is the difference between Stuff, MapReduce, Refine, and MapRerank document chain strategies — when do you use each?
33How do you build a Conversational RAG chain that maintains chat history and reformulates follow-up questions into standalone queries?
34What is query decomposition and how do you break a complex multi-part question into sub-queries for better retrieval?
35How do you implement Step-Back Prompting in a RAG pipeline to improve retrieval for highly specific questions?
36What is CRAG (Corrective RAG) and how does it add a grading step to decide whether retrieved docs are relevant before answering?
37What is Self-RAG and how does the LLM decide when to retrieve, whether retrieved docs are relevant, and whether the answer is grounded?
38How do you implement a fallback strategy when retrieval returns no relevant documents — how do you avoid hallucination in this case?
39How do you implement RAG evaluation — what metrics like faithfulness, answer relevancy, and context recall do you measure using RAGAS?
40How do you detect and mitigate hallucination in RAG outputs — what role does citation and source grounding play?
41How do you build a citation system that maps each sentence in the LLM's answer back to the exact source chunk it came from?
42How do you handle multilingual RAG — embedding and retrieving documents in multiple languages for a global user base?
43How do you optimize retrieval latency in production — what caching, pre-fetching, or index optimization strategies do you apply?
44How do you implement access control at the retrieval layer — ensuring users only retrieve documents they are authorized to see?
45How do you handle long context RAG — when retrieved chunks exceed the LLM's context window, what strategies do you apply?
46How do you design a RAG pipeline with LangGraph — turning retrieval, grading, and generation into discrete stateful graph nodes?
40 / 46

How do you detect and mitigate hallucination in RAG outputs — what role does citation and source grounding play?

Difficulty: 7/10
hallucination detection, citation grounding, LangChain pipelines

Detect hallucination using RAGAS faithfulness scoring to measure groundedness; mitigate by enforcing citations that map every claim to its source chunk, creating a verifiable chain from source material to output.

Hallucination detection in RAG outputs is primarily achieved through faithfulness metrics that measure whether each statement in the answer is supported by the retrieved context. Citation-enforced prompting, where the LLM is instructed to cite source identifiers for every factual claim, creates a verifiable audit trail and reduces hallucination rates significantly. By requiring each sentence to be grounded in a specific chunk, the system can detect and reject unsupported claims at generation time. Production deployments should combine both metrics-based monitoring and citation systems, as hallucinations can be subtle—models may generate plausible but wrong information that sounds confident.

Citation-Enforced Prompting
Hallucination Types and Detection
  1. 1

    Factual hallucinations: Information contradicts established facts or real-world knowledge.

  2. 2

    Faithfulness hallucinations: Output deviates from provided source material despite having accurate context.

  3. 3

    Instruction-following hallucinations: Model generates citations without verifying source existence.

  4. 4

    Citation grounding: Each answer sentence maps to source chunks; if no chunk contains similar text, the claim is flagged as hallucinated.

Scenario Questions

0-2 years experience

  1. 1Suppose you have a LangChain RetrievalQA chain that returns an answer and a source citation. How would you check if the answer is hallucinating before showing it to the user?
  2. 2If the retrieved documents don't contain the phrase you just generated, what simple step could you add to the chain to prevent the hallucination?
  3. 3How would you modify the prompt to force the model to include a citation for every factual claim?

2-5 years experience

  1. 1You notice that in production 5% of answers from your RAG endpoint contain facts not present in any retrieved source. Walk me through how you'd debug this and what mitigation you’d apply in LangChain.
  2. 2When you add a custom post‑processor that filters out answers without citations, the latency doubles. How would you balance hallucination mitigation with latency constraints?
  3. 3Explain why using a similarity score threshold alone might not stop hallucinations, and how you’d combine it with citation verification.

5-8 years experience

  1. 1Design a scalable component in LangChain that automatically validates each generated answer against its cited sources and flags mismatches for review. What trade‑offs do you consider regarding throughput and false positives?
  2. 2Your team wants to replace the default citation format with a knowledge‑graph ID. How would you adapt the grounding mechanism while ensuring hallucination detection stays reliable?
  3. 3Discuss how you’d monitor hallucination rates across multiple LLM providers and adjust prompting or retrieval strategies dynamically.

8+ years experience

  1. 1At the organization level you need to enforce source grounding across all RAG services. How would you architect a shared citation verification service, and what governance processes would you put in place to evolve it over time?
  2. 2If a legacy system uses a custom vector store that cannot return document IDs, how would you migrate it to a LangChain pipeline that supports citation without breaking existing contracts?
  3. 3Consider cross‑team impact: how would you define SLAs for hallucination detection accuracy and integrate them into product roadmaps and compliance requirements?

Follow-up Questions

  • What metrics would you track to know your mitigation is effective?
  • How would you handle a case where the source itself is outdated or contradictory?
  • Can you give an example of a prompt tweak that improves citation compliance?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.