๐ Top 20 Scenario-Based Generative AI Interview Questions
1. Your chatbot is giving incorrect answers. How would you troubleshoot it?
Answer:
Check: Prompt quality, Retrieved documents if using RAG, Embedding quality, Chunking strategy, Context window limitations, Model configuration
Approach:
1. Reproduce issue
2. Analyze prompt
3. Verify retrieved context
4. Check model output
5. Improve retrieval or prompt
2. Users report hallucinations in your AI application. What would you do?
Answer:
Implement RAG, Improve retrieval quality, Add source citations, Restrict model to retrieved context, Add confidence scoring, Use human review for critical cases
3. Your RAG system retrieves irrelevant documents. How would you fix it?
Answer:
Possible issues: Poor chunking, Weak embeddings, Bad metadata, Incorrect similarity search
Solutions:
Optimize chunk size, Improve embeddings, Add reranking, Use metadata filters, Tune top-k retrieval
4. A client wants an AI chatbot trained on internal company documents. What architecture would you recommend?
Answer:
Recommended: Document Storage, Embedding Model, Vector Database, RAG Pipeline, LLM, Monitoring Layer
Reason: RAG keeps knowledge current without expensive retraining.
5. When would you choose Fine-Tuning instead of RAG?
Answer:
Choose Fine-Tuning when: Need specific writing style, Need domain behavior adaptation, Need task specialization, Want consistent responses
Choose RAG when: Knowledge changes frequently, Large document repositories exist, Real-time information is required
6. Your AI application is becoming expensive. How would you reduce costs?
Answer:
Prompt optimization, Response caching, Smaller models, Context reduction, Efficient retrieval, Model routing, Batch processing
7. How would you build a document question-answering system?
Answer:
Architecture:
1. Upload documents
2. Extract text
3. Chunk documents
4. Generate embeddings
5. Store in vector database
6. Retrieve relevant chunks
7. Generate response using LLM
8. A user asks questions outside your company's knowledge base. What should happen?
Answer:
System should: Detect insufficient context, Respond honestly, Avoid guessing, Ask follow-up questions
Example: "I couldn't find relevant information in the available documents."
9. How would you evaluate a RAG system?
Answer:
Metrics: Context relevance, Retrieval precision, Retrieval recall, Answer correctness, Hallucination rate, User satisfaction
10. How would you prevent prompt injection attacks?
Answer:
Input validation, Prompt isolation, Guardrails, Content filtering, Role separation, Output verification
Never trust user instructions blindly.
11. Your AI assistant needs access to external APIs. How would you design it?
Answer:
Use: Function Calling, Tool Use, API Gateway, Authentication Layer, Logging System
Workflow: User โ LLM โ Function Call โ API โ Response
Post #2274
626
- โค 2