Questions
3 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?
03 / 46

What is the difference between semantic search and keyword search and why does RAG rely on semantic similarity?

Difficulty: 5/10
semantic vs keyword search, RAG pipelines, LangChain

Keyword search relies on exact word matching, while semantic search uses vector embeddings to understand meaning and context. RAG relies on semantic similarity because it allows the system to retrieve conceptually relevant information even when the query and document don't share exact keywords, leading to more accurate and contextually appropriate answers.

Keyword search (also known as lexical search) is a traditional technique that looks for exact word matches between the user's query and indexed documents[reference:7]. It is precise for specific terms but fails when users express intent in natural, varied language. Semantic search, on the other hand, converts both documents and user queries into vector embeddings and finds relevant chunks based on similarity in embedding space[reference:8]. This allows it to understand context and meaning, surfacing conceptually related information even if the exact keywords are missing[reference:9]. For example, a query for 'lightweight running shoes' might surface 'breathable trail runners'[reference:10]. RAG relies on semantic search because it enables the retrieval system to find the most contextually appropriate information to ground the LLM's response, which is essential for answering complex, open-ended questions[reference:11].

Scenario Questions

0-2 years experience

  1. 1Suppose you need to add a search feature to a small LangChain chatbot that looks up FAQ entries. How would you decide whether to use keyword matching or a semantic embedding model?
  2. 2If a user types 'How do I reset my password?' and your keyword index only contains the phrase 'password reset', what would happen and how could you fix it with semantic search?
  3. 3When you retrieve documents with LangChain's similarity search, what key parameter controls the trade‑off between exact term matches and semantic relevance?

2-5 years experience

  1. 1You integrated a vector store for semantic search in a RAG pipeline, but you notice that many retrieved chunks are only loosely related. What debugging steps would you take to improve relevance?
  2. 2During a feature rollout, the system switched from keyword to semantic search and response latency increased. How would you evaluate the trade‑offs and mitigate the slowdown?
  3. 3If your embedding model was trained on general web text, but your domain is medical records, why might the RAG answers be inaccurate and how would you address it?

5-8 years experience

  1. 1Design a hybrid search architecture that combines keyword and semantic search for a large knowledge base. How would you route queries and merge results to balance precision and recall?
  2. 2At scale, your vector index grows to billions of embeddings. What strategies would you employ to keep semantic similarity search performant while ensuring RAG quality?
  3. 3Explain how you would monitor and alert on drift between the embedding space and the underlying documents in a production RAG system.

8+ years experience

  1. 1Your company plans to migrate legacy keyword‑based search to a semantic RAG platform across multiple products. What architectural considerations and migration steps would you propose to minimize disruption?
  2. 2Discuss the long‑term maintenance challenges of relying on third‑party embedding models for RAG, including licensing, model updates, and bias, and how you would set up a governance process.
  3. 3If different teams need different similarity thresholds for their RAG use‑cases, how would you design a shared service that supports configurable semantic similarity while preserving security and performance?

Follow-up Questions

  • How would you handle a query that contains both domain‑specific jargon and common language?
  • What metrics would you use to compare keyword and semantic search performance in a RAG system?
  • Can you think of a scenario where keyword search might still be preferable over semantic search?
Share

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