I recently attended a Gen AI / Python technical interview at an MNC. Here are the technical questions discussed:
RAG / Retrieval
• What are dense and sparse retrieval algorithms?
• How do you extract text from scanned PDFs, images, and other document formats using multimodal models?
• How is the BM25 score calculated?
• BM25 returns n chunks and semantic search returns n chunks. How would you combine these results?
• What is Reciprocal Rank Fusion (RRF)?
• When would you use asynchronous programming, and when would you not use it?
FastAPI / Backend
• What are the benefits of FastAPI?
• How do you create a database connection string?
• How do you handle database connections for multiple users?
• What is SQLAlchemy’s connection pool?
LLM / RAG / Agents
• An LLM can generate different answers for the same prompt at different times. How would you make the output deterministic and consistent?
• What are the different types of memory management in RAG?
• What are the best practices for memory management in RAG?
• How do you handle a long conversation history?
• If you use an LLM to summarize long conversation history, wouldn’t the summarization itself increase the LLM cost?
• If an AI agent gives a wrong answer, how would you identify and correct it?
Coding Problem
Maximum Subarray Sum
Given an integer array `arr[]`, find the subarray (containing at least one element) which has the maximum possible sum, and return that sum.
Examples:
```text
Input: [2, 3, -8, 7, -1, 2, 3]
Output: 11
Input: [-2, -4]
Output: -2
Input: [5, 4, 1, 7, 8]
Output: 25
```
A good mix of RAG, LLMs, Agents, Backend, Database, and DSA questions.
I hope these interview questions will be helpful to others who are currently preparing for or seeking opportunities in Gen AI, AI Engineering, and Python roles. All the best to everyone on their job search and interview journey! 🚀
#GenAI #AIEngineer #Python #RAG #LLM #FastAPI #LangChain #MachineLearning #TechnicalInterview #InterviewExperience


0 Comments