Home › Interview questions › AI + DevOps
AI + DevOps Interview Questions & Answers
65 AI + DevOps interview questions in 4 levels — junior to senior, plus 12 production scenarios. Read 3 free answers with real-world analogies.
Free sample answers
What is an LLM inference server, and why can't you just run a model with a simple Python script in production?
One-liner
An inference server (like vLLM or TGI) efficiently serves a model to many concurrent users with batching, queuing, and memory management that a simple script doesn't handle.
Real-world analogy
A simple script is one person cooking one meal at a time in their home kitchen; an inference server is a restaurant kitchen built to serve hundreds of orders simultaneously without falling apart.
Detailed explanation
- A basic script loads a model and processes one request at a time — it has no concept of queuing multiple simultaneous users efficiently.
- Inference servers implement continuous batching, grouping multiple requests together to use GPU compute far more efficiently than processing them one by one.
- They also handle memory management (like KV cache) automatically, which is critical since LLM memory usage grows with both model size and conversation length.
Scenario
A team deploys their model using a basic Flask app wrapping a Python inference call, and it falls over the moment more than 2 users hit it simultaneously. What's missing?
Best practices
- Use a dedicated inference server (vLLM, TGI, Ollama) instead of a hand-rolled script for anything beyond a personal prototype.
- Understand that inference servers solve concurrency and memory problems a simple script was never designed to handle.
- Benchmark actual concurrent throughput before assuming a simple setup will scale.
How do you handle prompt injection attacks at the infrastructure level, beyond just relying on the model's own training to resist them?
One-liner
Layer input sanitization, output validation, and privilege separation (the LLM shouldn't have more system access than the user's own permissions) together, since no single defense reliably stops all prompt injection attempts.
Real-world analogy
It's like securing a building against social engineering — you don't just trust the front desk staff to always recognize a con artist; you also limit what any visitor can actually access once inside, regardless of how convincing their story was.
Detailed explanation
- Input sanitization can catch some known injection patterns, but sophisticated attacks can still bypass pattern-based filters, so this alone is insufficient.
- Output validation checks whether the model's response stays within expected bounds (like not leaking system prompts or performing unauthorized actions) before it's acted upon or returned to the user.
- Privilege separation — ensuring the LLM's own access to tools, APIs, or data is scoped to exactly what's needed, regardless of what a malicious prompt tries to convince it to do — is the most robust defense, since it limits damage even if injection succeeds.
Scenario
A company's LLM-powered internal tool has API access to sensitive systems, and a user discovers they can craft a prompt that tricks the model into calling APIs it shouldn't. What architectural principle would limit the damage regardless of the specific injection technique used?
Best practices
- Never grant an LLM broader system access than the actual end user should have, regardless of prompt content.
- Layer input sanitization and output validation as additional defenses, not the sole defense.
- Assume prompt injection will occasionally succeed and design blast-radius limits accordingly.
Your production LLM API integration suddenly starts returning garbled, nonsensical responses for a subset of requests. How do you investigate?
One-liner
Check for a token limit or context window issue first — garbled or truncated-looking output often means the request exceeded a limit and got cut off mid-generation, rather than a genuine model quality problem.
Real-world analogy
It's like a phone call cutting off mid-sentence because the call time limit was reached — the person didn't suddenly start talking nonsense, the connection was just cut at an awkward point.
Detailed explanation
- Check whether the affected requests have unusually long inputs (like long conversation histories or large RAG-retrieved context) that might be pushing against or exceeding the model's context window.
- Check for a recent change in max output token settings that might be cutting off responses before they naturally complete, producing responses that look garbled or incomplete rather than a full coherent answer.
- Check whether the affected requests correlate with a specific model version or provider endpoint, which could indicate an upstream provider-side issue rather than something in your own configuration.
Scenario
This is itself the scenario — walk through your exact steps to isolate whether this is a context/token limit issue, a configuration change, or an upstream provider problem.
Best practices
- Check context window and max token settings first when output looks truncated or garbled.
- Correlate affected requests with input length or specific configuration to narrow down the pattern.
- Check provider status pages/incident history to rule out an upstream issue before assuming it's your own bug.
A preview of the 65 questions in the AI + DevOps guide
Junior (20)
- What is an LLM inference server, and why can't you just run a model with a simple Python script in production?
- What is the difference between running an LLM on a GPU versus a CPU, and why does it matter so much for production?
- What is model quantization, and what trade-off does it involve?
- What is a vector database, and why do RAG (Retrieval-Augmented Generation) applications need one?
+ 16 more Junior questions, with full answers, in the guide.
Mid-level (20)
- How does continuous batching in inference servers like vLLM actually improve throughput compared to naive batching?
- How would you design an autoscaling strategy for GPU-based LLM inference on Kubernetes, given that GPU nodes are expensive and slow to provision?
- How do you design a cost-effective model routing strategy across multiple LLMs of different sizes and prices?
- How would you implement semantic caching for an LLM application, and what problem does it solve beyond simple exact-match caching?
+ 16 more Mid-level questions, with full answers, in the guide.
Senior (13)
- How would you architect a multi-region LLM serving strategy for a global application, given GPU availability constraints and data residency requirements?
- How would you design cost governance for an organization where dozens of teams are independently building LLM-powered features with wildly inconsistent cost efficiency?
- How do you approach security and compliance auditing for an LLM system that has tool-calling/function-calling capability to interact with internal systems?
- How would you design a disaster recovery strategy for a self-hosted LLM serving infrastructure, given the unique challenges of GPU capacity versus typical stateless application DR?
+ 9 more Senior questions, with full answers, in the guide.
Scenario (12)
- Your GPU infrastructure costs spiked 5x overnight with no corresponding increase in user traffic. Walk through your investigation steps.
- Your production LLM API integration suddenly starts returning garbled, nonsensical responses for a subset of requests. How do you investigate?
- Your RAG-based support chatbot keeps giving customers outdated information, even though the underlying documentation was updated weeks ago. How do you debug this?
- Your application experiences a full outage because your sole LLM provider (like OpenAI or Anthropic) is having a service incident. Walk through your immediate response.
+ 8 more Scenario questions, with full answers, in the guide.
Get the full DevOps / SRE Interview Guide