Quick answer: these are 30 AI Engineer interview questions that test how you build real LLM products in 2026: the role itself, building LLM features, RAG and data, evaluation, deployment and cost, plus coding and system-design rounds. Every question has a 30-second answer, a deeper answer, what the interviewer is really testing and the likely follow-up.
Part of our free AI Interview Prep Hub. Tick questions as you master them, and your progress shows up on the hub.
Last updated: November 2026
The AI Engineer role
What does an AI Engineer do, and how is it different from an ML Engineer?
Show answer
⏱ 30-second answer: An AI Engineer builds products on top of foundation models: prompts, RAG, agents, evaluation and deployment. An ML Engineer usually trains and serves custom models from data.
📖 Deeper answer: AI Engineers spend most of their time on application design, integrating model APIs or open models, retrieval, tool use, guardrails, evaluation and cost. ML Engineers focus more on data pipelines, feature engineering, training, and model serving and monitoring. The roles overlap, and strong AI Engineers still understand ML basics such as overfitting, metrics and data quality.
🎯 What they’re testing: Whether you understand the job you are applying for.
↪ Likely follow-up: Which skills from classic ML still matter for an AI Engineer?
Walk me through how you would build your first LLM feature at a company.
Show answer
⏱ 30-second answer: Clarify the user problem and success metric, prototype with a strong model and simple prompt, build a small evaluation set, then improve, add guardrails, and ship behind monitoring.
📖 Deeper answer: Start from the task (for example, summarising support tickets), define what good looks like, and collect 30-50 real examples. Prototype quickly, measure against those examples, and iterate on prompt, context and model choice. Then handle edge cases, add logging and cost tracking, run a limited rollout, and keep adding failures to the test set.
🎯 What they’re testing: A structured, metric-driven way of working.
↪ Likely follow-up: How do you get stakeholders to agree on what “good” means?
How do you choose between a hosted model API and an open-weight model?
Show answer
⏱ 30-second answer: Hosted APIs give top quality and fast start; open-weight models give control, data residency and lower cost at high volume, but need infrastructure and expertise.
📖 Deeper answer: Compare on quality for your task (measured, not assumed), latency, cost at expected volume, data privacy and compliance needs (for example keeping data in India), customisation (fine-tuning), and team skills. Many teams start with an API, then move high-volume or sensitive workloads to open models once the use case is proven.
🎯 What they’re testing: Practical trade-off thinking with real constraints.
↪ Likely follow-up: At what monthly volume would self-hosting start to make sense, and how would you calculate it?
What is the context window, and how does it affect application design?
Show answer
⏱ 30-second answer: The context window is the maximum number of tokens the model can read and write in one call. It limits how much history, documents and instructions you can include, and bigger contexts cost more and can be slower.
📖 Deeper answer: Even with large windows, quality can drop when key facts are buried in long inputs, and cost scales with tokens. So engineers still retrieve only relevant chunks, summarise history, put critical instructions clearly near the top, and use prompt caching for long, fixed content.
🎯 What they’re testing: Understanding of real constraints, not just “bigger is better”.
↪ Likely follow-up: When would you choose RAG over just pasting the whole document into a large context?
How do temperature and other sampling settings affect outputs?
Show answer
⏱ 30-second answer: Temperature controls randomness: low values give focused, repeatable answers; higher values give more varied, creative ones. Top-p and max tokens also shape output.
📖 Deeper answer: Use low temperature for extraction, classification and code, and moderate values for brainstorming or marketing copy. Max tokens caps length and cost. Note that some reasoning models restrict or ignore these settings, so check the provider’s documentation. Determinism is never guaranteed, so evaluation must allow for variation.
🎯 What they’re testing: Basic control of model behaviour.
↪ Likely follow-up: Your extraction pipeline gives different answers for the same input. What do you check?
Want all 30 answers as a printable cheat sheet?
The 30 GenAI questions as a cheat sheet, a system-design framework, a 30-day plan, the STAR method and mock-interview prompts. Printable, and works on mobile.
No spam. Unsubscribe anytime.
Building LLM features
What makes a good system prompt?
Show answer
⏱ 30-second answer: Clear role, task, rules, output format and examples, written plainly and kept consistent. It tells the model what to do and what not to do.
📖 Deeper answer: Good prompts state the goal, the audience, constraints (for example “answer only from the provided context”), the exact output format, how to handle missing information, and one or two examples. Version prompts like code, test changes against an evaluation set, and avoid contradictory instructions.
🎯 What they’re testing: Whether you treat prompts as engineered artefacts.
↪ Likely follow-up: How do you manage and version prompts across environments?
How do you get reliable structured data out of an LLM?
Show answer
⏱ 30-second answer: Use the provider’s structured output or JSON schema feature, validate the result against your schema, and retry with the validation error if it fails.
📖 Deeper answer: Keep schemas simple with clear field descriptions and enums. Validate with a library such as Pydantic. For values, add business-rule checks (dates in range, totals add up). Log failures and add them to tests. For extraction from documents, give the model the relevant section rather than the whole file.
🎯 What they’re testing: Engineering for reliability.
↪ Likely follow-up: How would you extract line items from scanned GST invoices?
How do you handle hallucinations in a product?
Show answer
⏱ 30-second answer: Ground answers in retrieved sources, ask the model to say “I don’t know” when the context lacks the answer, show citations, and check factual claims for high-stakes cases.
📖 Deeper answer: Mitigations at each layer: better retrieval, clear instructions, lower temperature, answer-with-citations formats, verification steps (a second check against the sources), and UX that shows sources and confidence. Measure hallucination rate on an evaluation set and track it over time.
🎯 What they’re testing: A layered, measurable approach.
↪ Likely follow-up: How would you measure the hallucination rate of a support bot?
What is prompt caching, and when does it help?
Show answer
⏱ 30-second answer: Prompt caching reuses the processed prefix of a prompt (long system prompts, documents or examples) across calls, which cuts cost and latency for repeated content.
📖 Deeper answer: It works when many requests share the same long beginning, such as a big policy document or tool definitions. Put stable content first and variable content last so the prefix matches. Check your provider’s rules for minimum length, cache lifetime and pricing.
🎯 What they’re testing: Cost-optimisation knowledge used in real systems.
↪ Likely follow-up: How would you restructure a prompt to get more cache hits?
How do you stream responses, and what changes in your backend?
Show answer
⏱ 30-second answer: Use the API’s streaming mode to send tokens to the user as they are generated, usually over server-sent events or WebSockets, which makes the app feel much faster.
📖 Deeper answer: The backend must forward chunks without buffering, handle client disconnects and cancellation, accumulate the full text for logging, and deal with streamed tool calls or structured output carefully (you may need the full object before acting). Measure time to first token separately from total time.
🎯 What they’re testing: Hands-on product engineering.
↪ Likely follow-up: How do you apply output safety filters when the response is streamed?
RAG & data
Explain RAG in one minute.
Show answer
⏱ 30-second answer: Retrieval-augmented generation finds relevant information from your data at question time and gives it to the model as context, so answers are grounded and current without retraining.
📖 Deeper answer: Pipeline: load and clean documents, split into chunks, create embeddings, store them in a vector or hybrid index. At query time, embed the question, retrieve the top chunks, optionally re-rank, and pass them to the model with instructions to answer from them and cite sources.
🎯 What they’re testing: Clear, structured explanation of the core pattern.
↪ Likely follow-up: Where does a RAG system usually fail first?
How do you choose a chunking strategy?
Show answer
⏱ 30-second answer: Split by the document’s natural structure (headings, sections, paragraphs), keep chunks big enough to carry meaning but small enough to be precise, and add some overlap and metadata.
📖 Deeper answer: There is no single best size; test a few (for example 300-800 tokens) against your evaluation questions. Keep tables and code blocks intact, attach titles and section headings to each chunk, and store metadata such as source, date and access level for filtering.
🎯 What they’re testing: Practical, test-driven approach.
↪ Likely follow-up: How would you chunk a 200-page RBI circular PDF with tables?
What is hybrid search, and why use it?
Show answer
⏱ 30-second answer: Hybrid search combines keyword search (like BM25) with vector search. Keywords catch exact terms such as product codes and names; vectors catch meaning.
📖 Deeper answer: Pure vector search can miss exact matches like “Form 16A” or an order ID, and keyword search misses paraphrases. Running both and merging results (for example with reciprocal rank fusion), then re-ranking, usually improves retrieval quality noticeably.
🎯 What they’re testing: Depth beyond “just use a vector DB”.
↪ Likely follow-up: How do you tune the balance between keyword and vector results?
How do you evaluate and improve retrieval quality?
Show answer
⏱ 30-second answer: Build a set of questions with known relevant passages and measure recall@k and ranking quality, then improve chunking, embeddings, hybrid search, query rewriting and re-ranking.
📖 Deeper answer: Separate retrieval metrics from answer metrics, so you know which part failed. Inspect misses: was the info missing, badly chunked, or ranked low? Fixes include better parsing, metadata filters, query expansion, a cross-encoder re-ranker and domain-tuned embeddings. Re-run the suite after each change.
🎯 What they’re testing: Systematic debugging of the most common failure point.
↪ Likely follow-up: Your answers are wrong but retrieval recall is 95%. Where do you look next?
How do you handle access control and freshness in RAG?
Show answer
⏱ 30-second answer: Filter retrieval by the user’s permissions using metadata, and keep the index in sync with source systems through incremental updates and deletions.
📖 Deeper answer: Never rely on the model to hide restricted content; enforce permissions at retrieval time. Store document ACLs or tenant IDs as metadata and filter on them. For freshness, run change-detection jobs, re-embed updated documents, delete removed ones, and show the source date in answers.
🎯 What they’re testing: Enterprise readiness and security awareness.
↪ Likely follow-up: An employee leaves the HR team. How does your RAG system stop showing them HR documents?
Evaluation & quality
Why do LLM applications need evaluation sets?
Show answer
⏱ 30-second answer: Because outputs vary and changes to prompts, models or data can silently break things. An evaluation set lets you measure quality and catch regressions before users do.
📖 Deeper answer: Start with 30-100 real examples covering common cases and edge cases, with expected answers or grading criteria. Run them on every change, track scores over time, and add every production failure to the set. This turns “it looks good” into evidence.
🎯 What they’re testing: Engineering discipline.
↪ Likely follow-up: How do you build an evaluation set when you have no labelled data?
What is LLM-as-a-judge, and what are its pitfalls?
Show answer
⏱ 30-second answer: Using a model to grade another model’s output against criteria. It scales evaluation, but judges can be biased, inconsistent or fooled, so you must check them against human labels.
📖 Deeper answer: Write clear rubrics, ask for a score with a short reason, prefer pairwise comparisons for subjective quality, and avoid using the same model to grade itself when possible. Measure agreement with human ratings on a sample, watch for bias towards longer answers, and use code checks wherever a rule can decide.
🎯 What they’re testing: Mature evaluation practice.
↪ Likely follow-up: How would you validate that your LLM judge is trustworthy?
Which metrics would you track for a customer-support assistant?
Show answer
⏱ 30-second answer: Resolution rate, answer correctness, groundedness, escalation rate, customer satisfaction, latency, and cost per conversation.
📖 Deeper answer: Mix offline metrics (correctness and faithfulness on the evaluation set) with online metrics (deflection, thumbs-up rate, re-contact within 24 hours, human hand-off rate). Track safety incidents and cost per resolved ticket. Segment by language and topic to find weak spots.
🎯 What they’re testing: Connecting model quality to business outcomes.
↪ Likely follow-up: Deflection went up but satisfaction went down. What happened?
How do you run an A/B test on a prompt or model change?
Show answer
⏱ 30-second answer: Split live traffic between the old and new version, measure agreed metrics over enough conversations, and roll out only if the new version wins without hurting safety or cost.
📖 Deeper answer: First pass the offline evaluation set. Then send a small share of traffic to the new version, log everything, and compare business metrics with enough sample size. Watch guardrail metrics (complaints, escalations) and stop early if they degrade. Keep the ability to roll back instantly.
🎯 What they’re testing: Product experimentation skills.
↪ Likely follow-up: How long would you run the test, and why?
How do you test for safety and prompt-injection risks before launch?
Show answer
⏱ 30-second answer: Red-team the system with harmful requests, jailbreaks and injected instructions in documents and tool results, measure failure rates, and fix with layered guardrails.
📖 Deeper answer: Create an adversarial test set: policy-violating requests, attempts to reveal the system prompt, injected text in retrieved pages, and attempts to trigger unauthorised tool calls. Automate it in CI, review failures, and add input and output filters, permission checks and confirmations. Repeat after every major change.
🎯 What they’re testing: Security-first engineering.
↪ Likely follow-up: Give an example of an indirect prompt injection in a RAG app.
Deployment, cost & LLMOps
How do you estimate and reduce the cost of an LLM feature?
Show answer
⏱ 30-second answer: Estimate tokens per request multiplied by requests and price per token, then reduce with smaller models, shorter prompts, caching, batching and fewer calls per task.
📖 Deeper answer: Measure real token usage from logs. Route simple requests to cheaper models, cache common answers and long prompt prefixes, trim retrieved context, cap output length, and use batch APIs for offline jobs. Always report cost per successful task, the number that matters to the business.
🎯 What they’re testing: Business awareness and practical optimisation.
↪ Likely follow-up: Your monthly bill doubled overnight. How do you investigate?
How do you handle rate limits, timeouts and provider outages?
Show answer
⏱ 30-second answer: Retry with exponential backoff and jitter, set timeouts, queue non-urgent work, and keep a fallback model or provider for critical paths.
📖 Deeper answer: Respect rate-limit headers, spread load, and use idempotency to avoid duplicate side effects on retries. Add circuit breakers so you fail fast during outages, show a friendly message, and degrade gracefully (for example, return search results without a generated summary).
🎯 What they’re testing: Production reliability.
↪ Likely follow-up: How would you switch providers without changing application code everywhere?
What should you log and monitor for an LLM application?
Show answer
⏱ 30-second answer: Inputs, outputs, prompt and model versions, retrieved documents, tool calls, latency, token usage, cost, errors and user feedback, with personal data masked.
📖 Deeper answer: Logs let you debug individual failures and spot trends. Dashboards should show latency percentiles, error rate, cost per day, feedback scores and guardrail triggers. Add alerts for spikes and sample conversations for regular human review. Follow data-protection rules, including India’s DPDP Act, for retention and masking.
🎯 What they’re testing: Operational maturity.
↪ Likely follow-up: How do you debug a single bad answer reported by a user last week?
How would you serve an open-weight model in production?
Show answer
⏱ 30-second answer: Use an optimised inference server with batching (such as vLLM or TGI), pick the right GPU and quantisation, autoscale on demand, and monitor latency and throughput.
📖 Deeper answer: Choose model size against quality and cost, consider quantised weights to fit cheaper GPUs, enable continuous batching and paged KV cache for throughput, set max context to what you need, and put an API gateway with auth and rate limits in front. Load-test before launch and track tokens per second, time to first token and GPU utilisation.
🎯 What they’re testing: Depth in model serving.
↪ Likely follow-up: How does quantisation trade quality for cost?
When should you fine-tune instead of prompting or RAG?
Show answer
⏱ 30-second answer: Fine-tune to change behaviour, style or format consistently, or to make a smaller model do a narrow task well. Use RAG for knowledge that changes. Try prompting first.
📖 Deeper answer: Fine-tuning needs good labelled examples, evaluation and ongoing maintenance. It shines for consistent output formats, domain tone, classification and cost reduction by distilling a big model into a small one. It is a poor way to add fresh facts, which go stale. Parameter-efficient methods like LoRA cut training cost.
🎯 What they’re testing: Choosing the right tool for the problem.
↪ Likely follow-up: How many examples would you need, and how would you collect them?
Coding & system design
Write the steps to call an LLM API safely from a Python backend.
Show answer
⏱ 30-second answer: Keep the API key in a secret store or environment variable, validate input, set timeouts and retries, call the API, validate the output, log usage, and return a safe error on failure.
📖 Deeper answer: In code: load the key from the environment (never commit it), build the prompt from validated input, call the SDK with a timeout and max tokens, wrap it in retry with backoff for rate limits, parse and validate the response (schema check), record tokens, latency and cost, and return a fallback message on errors. Add unit tests with mocked responses.
🎯 What they’re testing: Clean, production-minded coding habits.
↪ Likely follow-up: How would you unit-test code that calls an LLM?
How would you build a semantic search API over 1 million documents?
Show answer
⏱ 30-second answer: Batch-embed the documents, store vectors in a scalable index with metadata, expose a search endpoint that embeds the query, runs hybrid retrieval with filters and re-ranks results.
📖 Deeper answer: Plan the ingestion pipeline (parsing, chunking, embedding in batches, retries), choose an index that supports filtering and approximate nearest-neighbour search, and add a keyword index for hybrid retrieval. Cache popular queries, paginate results, and measure recall and latency (for example p95 under 300 ms).
🎯 What they’re testing: Scalable design with measurable targets.
↪ Likely follow-up: How would you re-index when you switch embedding models?
Design a document Q&A assistant for a company’s HR and policy documents.
Show answer
⏱ 30-second answer: A permission-aware RAG system: ingest and chunk documents with access metadata, hybrid retrieval with re-ranking, an LLM that answers only from sources with citations, plus evaluation, feedback and monitoring.
📖 Deeper answer: Components: connectors to the document stores, parsing (PDFs and tables), chunking with headings, embeddings and a hybrid index, retrieval filtered by the user’s role, re-ranking, a grounded answer prompt with citations and an “I don’t know” path, guardrails for personal data, an evaluation set of real employee questions, feedback buttons and dashboards. Support English and Hindi questions and show the policy’s last-updated date.
🎯 What they’re testing: End-to-end design covering quality, security and operations.
↪ Likely follow-up: How do you handle two policy documents that contradict each other?
Design an LLM system that classifies and routes 50,000 support emails a day.
Show answer
⏱ 30-second answer: Use a fast, cheap model or a fine-tuned small model for classification with a confidence score, route low-confidence emails to humans, and batch the work to control cost.
📖 Deeper answer: Pipeline: ingest emails, strip signatures and personal data where possible, classify intent, urgency and language with structured output, apply rules for VIP or legal keywords, and route to the right queue. Use batch processing for non-urgent mail, cache repeated templates, and monitor accuracy with weekly human audits. Retrain or adjust prompts based on misroutes.
🎯 What they’re testing: Cost-aware design at scale.
↪ Likely follow-up: How would you measure and improve routing accuracy over time?
Tell me about an AI project you built, and what you would do differently.
Show answer
⏱ 30-second answer: Use a clear structure: the problem, your approach, the measurable result, the hardest challenge, and one honest lesson.
📖 Deeper answer: For example: “I built a RAG assistant over 2,000 internal docs. Answer accuracy on our 80-question test set rose from 62% to 84% after adding hybrid search and re-ranking. The hardest part was messy PDFs with tables. Next time I would build the evaluation set on day one.” Interviewers want ownership, numbers, trade-offs and reflection.
🎯 What they’re testing: Communication, ownership and real experience.
↪ Likely follow-up: What would you build next to improve that project further?
Go deeper with the AI Interview Pro Kit
150 questions with model answers and follow-ups, plus 8 full GenAI system-design walkthroughs. Plus 5 portfolio project playbooks, a resume & LinkedIn kit, company-style rounds and a 30-day plan. PDF + web.
🤖 Practice with AI: free mock interview
Copy this prompt into Claude or ChatGPT and get interviewed. Answer by typing or voice.
Act as a senior interviewer for an AI Engineer role at an Indian product company. Ask me one question at a time from these topics: the AI Engineer role, building LLM features, RAG and data, evaluation, deployment and cost, and system design. Start easy and increase difficulty based on my answers. After each answer: score it out of 10, tell me what was missing, and show a model answer in under 120 words. After 8 questions, give me my strongest and weakest areas and a 7-day study plan.
How to prepare in 7 days
- Day 1: The AI Engineer role (Q1-Q5). Prepare your 60-second introduction and one project story.
- Day 2: Building LLM features (Q6-Q10). Build a small app with structured output.
- Day 3: RAG and data (Q11-Q15). Add hybrid search to a tiny RAG project.
- Day 4: Evaluation and quality (Q16-Q20). Write a 30-question evaluation set for your project.
- Day 5: Deployment, cost and LLMOps (Q21-Q25).
- Day 6-7: Coding and system design (Q26-Q30), plus two AI mock interviews with the prompt above.
Tips that make you stand out
- Tell project stories: one real project with numbers beats any textbook definition.
- Talk trade-offs: cost, latency, quality and safety. Senior interviewers listen for this.
- Say “it depends”, then explain on what: it shows judgement, not indecision.
- Show you build safely: mention evaluation, guardrails and monitoring without being asked.
Keep going
Next, follow our GenAI developer learning path, build a project with our free LLM API guide, and practise the 30 Generative AI interview questions and Agentic AI and MCP questions.

