Native AI Engineer · interview questions
Native AI Engineer interview questions
From the role's core and recommended topics, most asked first. Filter by the kind of answer the question wants.
RAG Core 41
- Most asked RAG leaf: How do you measure retrieval quality independently of generation?
- Most asked RAG leaf: Explain query rewriting and multi-query retrieval.
- Most asked RAG leaf: How do you prevent prompt injection via retrieved documents?
- Most asked RAG leaf: How do you evaluate faithfulness of answers?
- Most asked How do you choose a chunking strategy for RAG?
- Most asked Why use hybrid search in RAG, and how do you combine the results?
- Most asked How do you enforce permissions and tenant isolation in RAG?
- Most asked How do you make RAG answers grounded and verifiable?
- Most asked How do you evaluate a RAG system?
- Most asked Your RAG assistant gives confident but wrong answers about company policy. How do you find and fix the cause?
- Most asked Write a minimal retrieval-augmented generation pipeline: chunk, embed, retrieve and answer with citations.
- Most asked RAG leaf: How do you choose top-k and context budget?
- RAG leaf: How do citations should be mapped back to sources?
- RAG leaf: What metadata filters are essential in enterprise RAG?
- RAG leaf: When is parent-document retrieval preferable to flat chunks?
- RAG leaf: How do you handle stale documents in a knowledge base?
- RAG leaf: What is late chunking / contextual retrieval?
- RAG leaf: Compare dense retrieval vs sparse (BM25) for code search.
- RAG leaf: How would you RAG over tables and structured data?
- RAG leaf: What caching layers help RAG latency?
- RAG leaf: Explain corrective RAG / self-reflective retrieval loops.
- RAG leaf: How do you ingest PDFs with complex layouts?
- RAG leaf: How do you A/B test a new embedding model?
- RAG leaf: Describe a failure mode when context is contradictory.
- RAG leaf: How does multimodal RAG differ from text-only?
- RAG leaf: What SLOs would you set for a customer-facing RAG assistant?
- What is reranking, and when does it help?
- How do you handle follow-up questions in conversational RAG?
- How do you keep a RAG index fresh?
- How can documents in a RAG index attack your system, and how do you defend?
- When is RAG the wrong tool?
- RAG leaf: When should you use graph RAG?
- How do you assemble retrieved chunks into a good prompt?
- What is contextual retrieval?
- Where does the time and money go in a RAG pipeline, and how do you reduce it?
- How would you choose a vector store for a new RAG project?
- Why must you re-embed everything when changing embedding models?
- Explain how a typical RAG pipeline works end to end.
- How do you choose chunk size and chunking strategy for RAG?
- What causes hallucinations in RAG systems, and how do you reduce them?
- How do you handle access control and multi-tenancy in a RAG knowledge base?
Agents Core 41
- Most asked Agents leaf: What is the ReAct pattern?
- Most asked Agents leaf: When should you avoid agents?
- Most asked Agents leaf: How do you prevent infinite tool loops?
- Most asked Agents leaf: What is structured function calling?
- Most asked How do you stop an agent from looping forever or running up a huge bill?
- Most asked How do you keep humans in control of an agent's risky actions?
- Most asked How do you evaluate an agent?
- Most asked Design an AI agent that resolves customer support tickets using internal tools. How do you keep it safe?
- Most asked Agents leaf: What is tool hallucination?
- Most asked What is the difference between a workflow and an agent?
- Agents leaf: How should tool schemas be designed?
- Agents leaf: How do you evaluate agent task success?
- Agents leaf: How do you sandbox tool execution?
- Agents leaf: Compare planner-executor vs ReAct.
- Agents leaf: What is human-in-the-loop for agents?
- Agents leaf: How do multi-agent systems fail?
- Agents leaf: Design short-term vs long-term agent memory.
- Agents leaf: Deterministic code vs LLM for a step?
- Agents leaf: How do you recover from a failed tool call?
- Agents leaf: What telemetry is required for agents in production?
- Agents leaf: How do you handle long-running workflows?
- Agents leaf: How do you cost-control agentic features?
- How should an agent handle tool failures?
- Why does the cost of a long agent run grow faster than linearly, and what do you do about it?
- When does a multi-agent system beat a single agent?
- What should you trace for an agent in production?
- How would you reduce an agent's latency and cost?
- How do you design tool definitions so the model doesn't misuse them?
- How do you protect an agent from prompt injection through tool results?
- Your LLM agent sometimes loops calling the same tool and runs up costs. How do you fix it?
- Agents leaf: Explain observation formatting best practices.
- Agents leaf: How do swarm/crew patterns differ from a single agent?
- Agents leaf: Compare assistants API threads vs custom orchestration.
- How do you choose between building your own agent loop and using a framework?
- How do you give an agent memory across sessions?
- How would you sandbox an agent that can run code?
- A support agent refunded the wrong order. How do you investigate?
- What are parallel tool calls, and when should you use them?
- Compare ReAct-style agents, plan-and-execute agents, and multi-agent systems. When would you use each?
- How does tool/function calling work with LLMs, and what design mistakes cause unreliable agents?
- How would you design memory for a long-running AI agent?
Prompt Engineering Core 22
- Most asked Prompt leaf: What makes a good system prompt?
- Most asked Prompt leaf: How do few-shot examples help?
- Most asked Prompt leaf: Structured outputs vs free text?
- Most asked Prompt leaf: How do you mitigate prompt injection?
- Most asked Prompt leaf: How do you reduce hallucinations via prompting?
- Prompt leaf: How do you version and test prompts?
- Prompt leaf: When is chain-of-thought useful?
- Prompt leaf: Role of delimiters and XML-ish tags?
- Prompt leaf: What is constitutional / policy prompting?
- Prompt leaf: Tool-choice prompting strategies?
- Prompt leaf: How do you design refusal behavior?
- Prompt leaf: What is prompt chaining?
- Prompt leaf: How do temperature and top_p affect answers?
- Prompt leaf: Evaluating prompt changes without users?
- Prompt leaf: How do you keep prompts free of secrets?
- Prompt leaf: Dynamic prompts with retrieved context-ordering tips?
- Prompt leaf: How do you handle multilingual prompts?
- Prompt leaf: Why put critical constraints near the end of long prompts?
- Prompt leaf: What is self-consistency decoding?
- Prompt leaf: How do style guides enter prompts?
- What prompt engineering techniques improve reliability of production LLM features?
- How do you defend against prompt injection in an application that uses retrieved documents or user content?
Evaluation Core 40
- Most asked Evaluation leaf: What is a golden dataset?
- Most asked Evaluation leaf: Pros/cons of LLM-as-judge?
- Most asked Evaluation leaf: What is faithfulness/groundedness?
- Most asked How do you build an evaluation set for an LLM feature?
- Most asked When do you use code graders, model graders or human graders?
- Most asked How do you decide whether a prompt change is an improvement?
- Most asked What guardrails would you put around an LLM feature?
- Most asked How would you build an evaluation pipeline for an LLM feature before and after each prompt or model change?
- Most asked Evaluation leaf: Offline vs online evaluation tradeoffs?
- Evaluation leaf: Why separate retrieval metrics from generation metrics?
- Evaluation leaf: Online metrics that matter?
- Evaluation leaf: Red teaming for LLM apps?
- Evaluation leaf: How do you detect regressions after a prompt change?
- Evaluation leaf: How do you evaluate agents?
- Evaluation leaf: How do you sample production traffic for review?
- Evaluation leaf: What is answer relevance?
- Evaluation leaf: How do you evaluate citation quality?
- Evaluation leaf: How do toxicity/safety classifiers fit?
- Evaluation leaf: What is calibration of confidence?
- Evaluation leaf: CI gate example for RAG PRs?
- What biases do LLM judges have, and how do you mitigate them?
- How do you monitor LLM quality in production?
- How do you roll out a prompt or model change safely?
- Why is model output untrusted input, and what does that mean in practice?
- How do you handle personal data in LLM features?
- How would you red-team an LLM feature?
- Evaluation leaf: Inter-annotator agreement-why care?
- Evaluation leaf: Statistical significance in A/B for LLM features?
- Evaluation leaf: Synthetic eval data-when OK?
- Evaluation leaf: Tracking eval debt?
- Evaluation leaf: Multimodal eval challenges?
- How do you balance safety filtering against over-refusal?
- How do you handle non-determinism in LLM evaluations?
- What is faithfulness, and how is it different from correctness?
- How do you write a good rubric for a model grader?
- A safety eval passes at 99%. Is the feature safe to launch?
- What metrics would you track for an LLM support assistant?
- How do you evaluate an LLM feature before you have real traffic?
- How would you evaluate a production RAG or agent system beyond 'it looks good'?
- What guardrails would you put around an LLM-powered customer-facing feature?
LLM Ops Core 24
- Most asked LLM Ops leaf: How do you manage prompt versions?
- Most asked LLM Ops leaf: Strategies to cut LLM cost without tanking quality?
- Most asked LLM Ops leaf: What is semantic caching?
- Most asked LLM Ops leaf: What is model routing?
- LLM Ops leaf: What belongs in an LLM observability trace?
- LLM Ops leaf: Explain online vs offline evaluation loops.
- LLM Ops leaf: What kill switches should exist?
- LLM Ops leaf: How do you redact PII in LLM logs?
- LLM Ops leaf: How do you set latency SLOs for streaming chat?
- LLM Ops leaf: How do you handle provider outages?
- LLM Ops leaf: How do you prevent training/serving skew for RAG indexes?
- LLM Ops leaf: Describe shadow deployment for a new model.
- LLM Ops leaf: What metrics indicate quality regression after a prompt change?
- LLM Ops leaf: How do you secure API keys for model providers?
- LLM Ops leaf: Explain canary analysis for embeddings reindex.
- LLM Ops leaf: What is a prompt injection incident runbook?
- LLM Ops leaf: How do you budget tokens for RAG prompts?
- LLM Ops leaf: Why track cost per successful task not per call?
- LLM costs doubled last month and latency is rising. How do you investigate and reduce both?
- LLM Ops leaf: How do you capacity-plan token usage?
- LLM Ops leaf: How do rate limits interact with UX?
- How do you manage latency and cost for production LLM applications?
- What does a solid observability stack look like for LLM systems?
- How would you design a multimodal AI feature that answers questions about images and documents?
Vector Databases Core 22
- Most asked Vector DB leaf: What is an embedding?
- Most asked Vector DB leaf: HNSW vs IVF indexes?
- Most asked Vector DB leaf: When is hybrid search necessary?
- Most asked Vector DB leaf: Cosine vs dot product-when does it matter?
- Vector DB leaf: How do you filter by metadata efficiently?
- Vector DB leaf: Re-ranking after ANN retrieval?
- Vector DB leaf: What causes embedding drift?
- Vector DB leaf: Dimensionality vs quality/cost?
- Vector DB leaf: How do you delete/update vectors safely?
- Vector DB leaf: Multi-tenancy strategies?
- Vector DB leaf: How do you benchmark a vector DB?
- Vector DB leaf: Sparse + dense vector fusion?
- Vector DB leaf: What SLIs matter for vector search?
- Vector DB leaf: Explain product quantization briefly.
- Vector DB leaf: What is a collection/namespace?
- Vector DB leaf: How do you store vectors for multimodal data?
- Vector DB leaf: Cold start for a new corpus?
- Vector DB leaf: Why normalize embeddings?
- Vector DB leaf: Handling near-duplicate documents?
- Vector DB leaf: When to choose managed vs self-hosted vector DB?
- What are embeddings, and how does vector similarity search find relevant documents?
- When would you use hybrid search (BM25 + vectors) instead of pure vector search?
MCP Core 15
- Most asked What is the Model Context Protocol (MCP), and what problem does it solve?
- Most asked How would you design an MCP server so agents use it well?
- Most asked What is tool poisoning, and how do you defend against it?
- Most asked What are tools, resources and prompts in MCP?
- Explain hosts, clients and servers in MCP.
- Compare the stdio and Streamable HTTP transports in MCP.
- How does authorization work for remote MCP servers?
- MCP or plain in-app tool definitions: how do you decide?
- Walk through the lifecycle of an MCP connection.
- Why is token passthrough forbidden in MCP?
- Your remote MCP server fails with 'session not found' after scaling to two instances. Why, and how do you fix it?
- What do MCP tool annotations such as readOnlyHint and destructiveHint do?
- How would you test and monitor an MCP server in production?
- How do you version and evolve MCP tools without breaking agents?
- What is MCP sampling, and why is it useful?
Fine-tuning Recommended 22
- Most asked Fine-tuning leaf: Fine-tune vs RAG vs prompts-decision framework?
- Most asked Fine-tuning leaf: What is LoRA?
- Most asked Fine-tuning leaf: When does fine-tuning fail to add knowledge?
- Most asked Fine-tuning leaf: SFT vs DPO/RLHF briefly?
- Fine-tuning leaf: How do you build a fine-tune dataset?
- Fine-tuning leaf: How do you evaluate a fine-tuned model?
- Fine-tuning leaf: How do you prevent training data leakage of secrets?
- Fine-tuning leaf: What is QLoRA?
- Fine-tuning leaf: Catastrophic forgetting-how to mitigate?
- Fine-tuning leaf: Serving multiple LoRA adapters?
- Fine-tuning leaf: Full fine-tune vs PEFT cost tradeoffs?
- Fine-tuning leaf: Domain adaptation for code assistants?
- Fine-tuning leaf: What is overfitting in instruction tuning?
- Fine-tuning leaf: License/compliance checks before FT?
- Fine-tuning leaf: How do you roll back a bad adapter?
- Fine-tuning leaf: Distillation use case?
- Fine-tuning leaf: Hyperparameters that matter most?
- Fine-tuning leaf: Continual fine-tuning strategy?
- Fine-tuning leaf: Hardware considerations?
- Fine-tuning leaf: Synthetic data-pros/cons?
- When should you fine-tune a model versus using RAG or prompt engineering?
- What is LoRA/PEFT and why is it popular for adapting LLMs?
AI-Assisted Development Recommended 12
- Most asked How do you use AI coding assistants effectively without lowering code quality?
- Most asked How do you review a pull request that was largely written by AI?
- What context should you give an AI coding assistant, and how?
- What is package hallucination (slopsquatting), and how do you protect against it?
- How would you use an AI assistant for test-driven development?
- What are the risks of agentic coding tools, and how do you control them?
- What should never be pasted into an AI assistant, and what do you do if it happens?
- How should a team measure the impact of AI coding tools?
- How do you refactor legacy code safely with an AI assistant?
- How do you debug effectively with an AI assistant?
- Will relying on AI assistants erode a developer's skills? How do you prevent it?
- How do licensing concerns apply to AI-generated code?
Python Developer Recommended 104
- Most asked Explain mutable vs immutable in Python.
- Most asked Explain is vs == in Python.
- Most asked Explain generators in Python.
- Most asked Explain decorators in Python.
- Most asked Explain context managers in Python.
- Most asked Explain GIL in Python.
- Most asked Explain threading vs multiprocessing vs asyncio in Python.
- Most asked Backend Python interview: explain N+1 queries.
- Most asked Backend Python interview: explain authN vs authZ.
- Most asked Backend Python interview: explain SQL injection prevention.
- Most asked What is the late-binding closure gotcha in Python?
- Most asked Explain LEGB scoping in Python.
- Most asked Explain *args and **kwargs in Python.
- Most asked Explain list/dict/set comprehensions in Python.
- Most asked Explain dataclasses in Python.
- Most asked Explain dunder methods in Python.
- Most asked Explain deepcopy vs copy in Python.
- Most asked Explain structural pattern matching (`match`/`case`).
- Most asked What do EAFP and LBYL mean, and which is more Pythonic?
- Most asked Walk through the request/response lifecycle in Django, and explain why middleware order matters.
- Most asked Explain MRO / C3 in Python.
- Explain __name__ == '__main__' in Python.
- When do you use the `asyncio` module/package?
- When do you use the `logging` module/package?
- When do you use the `unittest / pytest` module/package?
- When do you use the `venv` module/package?
- Python packaging: virtualenv why?
- Backend Python interview: explain REST API design.
- Backend Python interview: explain migrations.
- How does asyncio work internally: event loop, coroutines, tasks and futures?
- Which pytest features do you use most?
- Explain typing / type hints in Python.
- Explain exceptions hierarchy in Python.
- When do you use the `pathlib` module/package?
- When do you use the `collections` module/package?
- When do you use the `itertools` module/package?
- When do you use the `functools` module/package?
- When do you use the `json` module/package?
- When do you use the `concurrent.futures` module/package?
- When do you use the `secrets` module/package?
- Python packaging: requirements.txt vs pyproject.toml?
- Python packaging: dependency pinning?
- Backend Python interview: explain FastAPI / Starlette.
- Backend Python interview: explain Django ORM vs SQLAlchemy.
- Backend Python interview: explain connection pooling.
- Backend Python interview: explain caching strategies.
- Backend Python interview: explain JWT pitfalls.
- Backend Python interview: explain idempotent APIs.
- Backend Python interview: explain background jobs.
- Backend Python interview: explain observability.
- Backend Python interview: explain 12-factor config.
- What is free-threaded Python (PEP 703) and how does it change the GIL story?
- How do cancellation and timeouts work in asyncio?
- What are exception groups and `except*` (Python 3.11)?
- What does the Python 3.12 generic syntax (PEP 695) look like, and how do `TypeVar`, `ParamSpec` and `Self` fit in?
- When do you use `TypedDict`, `Literal`, `Protocol` and `@overload`?
- Compare dataclasses, attrs and Pydantic models.
- Explain the iterator protocol and the difference between iterables and iterators.
- What are metaclasses, and when is `__init_subclass__` a simpler alternative?
- What's the difference between `__new__` and `__init__`?
- How does CPython manage memory?
- How do you profile and optimize Python code?
- What does a modern Python toolchain look like?
- What's the difference between `str` and `bytes`, and how do you handle encodings?
- Why is `pickle` dangerous, and what should you use instead?
- What is the walrus operator (`:=`) and when is it useful?
- What is the difference between WSGI and ASGI, and how does it affect how a Python web app handles concurrent requests?
- Explain slots in Python.
- Explain ABC / Protocol in Python.
- Explain property / descriptor in Python.
- When do you use the `argparse` module/package?
- When do you use the `dataclasses.asdict` module/package?
- When do you use the `enum` module/package?
- When do you use the `hashlib` module/package?
- Python packaging: semantic versioning?
- Python packaging: wheels vs sdist?
- Python packaging: editable installs?
- Python packaging: entry points / scripts?
- Backend Python interview: explain rate limiting.
- How do you mock correctly in Python tests?
- How do you handle dates and time zones correctly in Python?
- Why can floating-point math surprise you, and when should you use `Decimal` or `Fraction`?
- How do `functools.cache`, `lru_cache` and `cached_property` work, and what are the pitfalls?
- How do you run external commands safely with `subprocess`?
- What notable improvements came in Python 3.11 through 3.14?
- What are template strings (t-strings) in Python 3.14?
- How did annotation evaluation change in Python 3.14?
- How do sorting, `heapq` and `bisect` help with common algorithmic tasks?
- What are weak references in Python and when do you use them?
- Which `contextlib` utilities are worth knowing?
- How do classic design patterns look in idiomatic Python?
- What are the pitfalls of `multiprocessing`?
- How do descriptors power properties, methods and ORMs?
- How do you implement structured logging in Python services?
- What are common security pitfalls in Python applications?
- What do `send()`, `throw()`, `close()` and `yield from` do with generators?
- Compare f-strings, `str.format` and `%` formatting.
- Which built-ins make Python loops cleaner?
- What goes into a modern `pyproject.toml`?
- How do Django, Flask and FastAPI compare for a new backend project?
- What are subinterpreters in Python 3.14?
- Python packaging: namespace packages?
- What is the difference between a list and a tuple in Python?
- How does Python's garbage collection work?
API Design Recommended 33
- Most asked What makes an API RESTful, and what are good REST design practices?
- Most asked Which HTTP methods are safe and idempotent, and why does it matter?
- Most asked Which HTTP status codes should an API use, and when?
- Most asked Compare offset pagination and cursor (keyset) pagination.
- Most asked How should you version an API?
- Most asked How do idempotency keys work for POST requests?
- Most asked Write an Express or FastAPI endpoint that creates an order idempotently.
- Most asked Write a SQL query that returns each customer's three most recent orders.
- Most asked When would you choose GraphQL over REST, or gRPC over both?
- An API endpoint that was fast is now taking seconds under load. Walk through your investigation.
- How should APIs format error responses?
- How do you design reliable webhooks?
- How should APIs support filtering, sorting and field selection?
- Why use OpenAPI (and contract-first design)?
- What counts as a breaking change in an API?
- How should an API communicate rate limits to clients?
- How do you design APIs for long-running operations?
- How do APIs prevent lost updates from concurrent edits?
- What is HATEOAS and is it used in practice?
- How do you design bulk or batch endpoints?
- What naming conventions make APIs easier to use?
- What security practices apply to API design?
- What does an API gateway do, and when do you need one?
- How should APIs represent dates, times and money?
- What makes a great developer experience for a public API?
- PUT vs PATCH: how do you implement updates?
- How do you design event-driven APIs (events between services)?
- How should APIs handle large file uploads and downloads?
- What should a health or status endpoint return?
- How can APIs leverage HTTP caching?
- How do you deprecate an API endpoint responsibly?
- What consistency guarantees should an API document?
- How do APIs handle localization?
Behavioral & STAR Recommended 41
- Most asked Tell me about a time you worked with a difficult teammate.
- Most asked Describe a disagreement you had with a coworker and how you resolved it.
- Most asked Tell me about a time you disagreed with your manager's decision.
- Most asked Tell me about a time you failed at something important.
- Most asked Describe a mistake that had a significant impact and how you handled it.
- Most asked Tell me about a time you had to work with unclear or changing requirements.
- Most asked Tell me about a time you missed a deadline.
- Most asked Tell me about a time you received critical feedback and how you responded.
- Most asked Describe a project you owned from start to finish.
- Most asked Tell me about a time you had to juggle multiple competing deadlines.
- Tell me about a time you led a project without formal authority.
- Tell me about a time you took responsibility for a team failure.
- Describe a time you had to collaborate with someone whose working style was very different from yours.
- Tell me about a successful project you completed as part of a team.
- Tell me about a time you helped a struggling teammate.
- Describe a time you had to push back on a stakeholder's request.
- Describe a time you had to deliver unwelcome feedback to a peer.
- Describe a time you had to motivate a team through a difficult period.
- Tell me about a decision you made that was unpopular with your team.
- Tell me about a time you had to make a decision with incomplete information as a leader.
- Tell me about a project that didn't go as planned.
- Tell me about a time you went above and beyond your job description.
- Describe a time you identified a problem no one had asked you to solve.
- Describe a situation where you had to make a decision without all the information you wanted.
- Tell me about a time priorities shifted midway through a project.
- Describe how you decide what to work on when everything feels urgent.
- Tell me about a time you helped a colleague grow their skills.
- Tell me about a time you received feedback that was hard to hear.
- Describe a time you had to rely on a team member you didn't fully trust yet.
- Tell me about a conflict between two people on your team and how you handled it.
- Describe a time you delegated an important task.
- Tell me about a time you had to say no to your manager.
- Describe how you handle working on something without a clear owner.
- Tell me about a time you had to say no to a request to protect a deadline.
- Describe a time you had to deprioritize something important.
- Describe your approach to onboarding a new team member.
- Tell me about a time you gave someone feedback that changed their behavior.
- Describe a time you learned something valuable from someone more junior than you.
- Describe how you typically respond to criticism.
- Tell me about a time you gave feedback that was poorly received.
- Describe a time feedback from a peer changed how you approached your work.