AI Engineering

Revise

Flashcards and the question bank

Cards come from the atlas, the canvas blocks and the guided paths, scheduled with Leitner boxes so what you know comes back less often. Progress stays in this browser.

Shuffling cards…

Question bank · 273 follow-ups

The questions interviewers ask after your first answer. Try answering before you open one.

LLM fundamentals

Why does the same paragraph cost more in Hindi than in English?

BPE vocabularies are learned mostly from English-heavy data, so other scripts get split into more, smaller pieces. Same meaning, more tokens — more cost, more latency, less room in the window.

Tokens & tokenization →
Why do models struggle to count the letters in a word?

The word arrives as one or two tokens, not letters. The model has to have memorised the spelling of each token; it can’t look inside it.

Tokens & tokenization →
How would you budget a prompt precisely?

Tokenize each section with the target model’s tokenizer, assign a budget per section, and enforce it in the context assembler — never by truncating the final string blindly.

Tokens & tokenization →
If the window is 1M tokens, why use RAG at all?

Cost and latency scale with input size on every call, recall degrades in long inputs, and RAG lets you enforce permissions and cite sources. Long context is great for one-off whole-document tasks.

Context windows →
What is “lost in the middle”?

Models recall information near the beginning and end of a long input better than in the middle, so placement matters as much as inclusion.

Context windows →
What does temperature 0 actually do?

It approaches greedy decoding: always pick the highest-probability token. Output becomes repetitive but more stable — still not guaranteed identical across runs in production serving.

Sampling: temperature, top-k, top-p →
Top-k vs top-p?

Top-k keeps a fixed number of candidates regardless of confidence; top-p adapts — few candidates when the model is sure, many when it isn’t.

Sampling: temperature, top-k, top-p →
Why cosine and not Euclidean distance?

Cosine ignores vector length and compares direction. With normalised vectors the two rank identically, and dot product becomes the cheapest equivalent.

Embeddings →
How do you cut embedding storage?

Use fewer dimensions (Matryoshka-style truncation where supported), quantise to int8 or binary, and only embed chunks you actually retrieve from.

Embeddings →
Compute the KV cache for an 8B model with 32 layers, 8 KV heads, head dim 128, FP16, at 8k tokens.

2 × 32 × 8 × 128 × 2 bytes = 128 KB per token; × 8,192 ≈ 1 GB per sequence.

KV cache →
Why does grouped-query attention matter for serving?

Several query heads share one KV head, so the cache shrinks by that factor (e.g. 32 → 8 heads = 4× smaller), which means more concurrent sequences per GPU.

KV cache →
A user says the bot is slow. What do you measure first?

Split TTFT from decode time. High TTFT points at prompt size, queueing or retrieval before the call; slow decode points at output length or model choice.

Latency: TTFT and tokens/s →
How do you hit an 800 ms budget?

Small model, short prompt with a cached prefix, streaming, parallel retrieval, and no extra sequential LLM calls on the hot path.

Latency: TTFT and tokens/s →
How can constrained decoding guarantee valid JSON?

At each step the server knows which tokens keep the output a valid prefix of the schema’s grammar and sets every other token’s probability to zero before sampling.

Structured outputs →
When would you still validate?

Always — schemas can’t express “end date after start date” or “ID must exist”. Validation catches semantic errors and gives you a retry signal.

Structured outputs →
Who is responsible when a tool call deletes the wrong record?

Your code. The model only proposes; authorisation, validation and confirmation of destructive actions happen in the tool layer.

Tool / function calling →
How do you make tool errors recoverable?

Return a short, specific error as the tool result (“order 123 not found; recent orders: 481, 492”) so the next model turn can correct course.

Tool / function calling →
How do you stream structured output to a UI?

Parse the partial JSON incrementally and render fields as they complete; only commit side effects once the final object validates.

Streaming →
SSE or WebSockets for a chat UI?

SSE: one-way, plain HTTP, auto-reconnect, works through most proxies. WebSockets when the client must send data mid-stream (voice, collaborative editing).

Streaming →
Why does order matter so much?

The cache matches a prefix token-for-token. The first differing token ends the match, and everything after it is processed — and billed — normally.

Prompt caching →
Prompt caching vs semantic caching?

Prompt caching reuses computation for an identical prefix and still generates a fresh answer. Semantic caching skips the model call entirely and returns a stored answer for a similar question.

Prompt caching →
When is a reasoning model the wrong choice?

Latency-sensitive, simple tasks: classification, extraction, chit-chat, voice turns. Use a fast model and save reasoning for the hard tail.

Reasoning models →
How do reasoning tokens affect cost?

They’re billed as output tokens even though you may never see them, so a short visible answer can cost as much as a long essay.

Reasoning models →
Why is decoding memory-bandwidth bound?

Each new token needs a pass over all the weights (and the KV cache) but does little arithmetic per byte read, so the GPU waits on memory. Batching many sequences shares each weight read.

Transformer basics at interview depth →
What does mixture-of-experts buy you?

Each token activates only a few experts, so compute per token is like a much smaller model while total capacity is large. The catch: all experts must sit in memory.

Transformer basics at interview depth →
How do you measure hallucination?

Split the answer into claims and check each against the retrieved context (faithfulness), with an LLM judge calibrated on human labels. Report the rate on a fixed eval set and on sampled production traffic.

Hallucination →
Does RAG remove hallucination?

No. It removes the “didn’t know” cause when retrieval works; the model can still misread, over-generalise or ignore the context.

Hallucination →
How would you build a cascade with logprobs?

Run the small model, take the probability of its chosen label; above a calibrated threshold accept it, below it escalate. Tune the threshold for the target accuracy vs cost.

Logprobs & confidence →
How do you test code that calls an LLM?

Mock or replay recorded responses for unit tests, assert on properties not exact text, and keep a separate eval suite that runs the real model and tracks scores over time.

Determinism and reproducibility →
OCR + LLM or a vision model on the page?

OCR when text is clean and you need exact strings cheaply; a vision model when layout, tables, stamps or handwriting carry meaning. Many pipelines do both and cross-check.

Multimodal inputs →
How do you justify a cheaper model to a customer?

Show the eval: same pass rate on their task, lower p95 latency, a fraction of the cost per conversation — and a routing rule that escalates the hard cases.

Choosing a model →

Prompting & context engineering

Can a system prompt keep secrets?

No. Treat it as public. Secrets, permissions and business rules that matter must be enforced in code.

System prompts →
How do you change a system prompt safely?

Version it, run the eval suite on the new version, roll it out behind a flag or to a slice of traffic, and compare online metrics before switching everyone.

System prompts →
When would you retrieve examples dynamically?

When the input space is wide (many categories, many document types): embed past solved cases and include the nearest few, so every request gets relevant demonstrations.

Few-shot examples →
What do you cut first when you’re over budget?

Old conversation turns (summarised), then low-relevance chunks, then old tool results. Never the instructions, the user’s latest message or the output reserve.

Assembling and budgeting the context →
How do you order sections?

Static first (tools, system prompt) for caching, evidence next with the strongest chunks at the edges, then history, then the question last.

Assembling and budgeting the context →
What must survive a compaction?

The user’s goal, constraints, decisions taken, identifiers in play, what’s done and what’s left — the things a colleague would need to pick up the task.

Compaction & summarisation →
A customer has 300 PDFs. Long context or RAG?

RAG for Q&A: too large to send every time, and different users likely see different files. Long context for a per-document task like “summarise this one contract”.

Long context vs RAG →
Why put retrieved documents in the user turn rather than the system prompt?

So they carry the lower authority of content, not the authority of instructions — and so the system prompt stays static and cacheable.

Instruction hierarchy →
Preload or fetch on demand?

Preload what nearly every step needs and is stable (cacheable); fetch what’s large, rarely needed or step-specific.

Just-in-time context & progressive disclosure →
What do you log with every LLM call?

Prompt version, model and version, parameters, input and output (redacted as needed), token counts, latency, cost and the trace ID.

Prompt versioning & templates →
Is the chain of thought a faithful explanation?

Not necessarily. It often helps accuracy but isn’t guaranteed to reflect the actual computation, so don’t use it as an audit trail.

Chain-of-thought →

RAG end to end

Retrieval misses answers that are in a table. Why?

Parsing flattened the table so the value and its header ended up far apart or in different chunks. Keep tables intact (or as row-wise text with headers repeated) and chunk around them.

Document parsing →
What metadata do you attach at parse time?

Source ID and URL, title, section path, page, last-modified date, version, language and the access-control list — everything you will filter, cite or freshness-check on later.

Document parsing →
How do you choose chunk size?

Empirically: build a labelled query set, try a few sizes and strategies, compare recall@k and end-answer quality. Smaller chunks are more precise but lose context; larger ones dilute the embedding.

Chunking →
Why prepend the section title to each chunk?

So the chunk carries its own context — embeddings and BM25 both match “Refund policy > Damaged items” even when the body never says “refund”.

Chunking →
Why does this help BM25 too?

The added words (product name, section) now appear in the chunk text, so keyword search can match them.

Contextual chunk headers →
When does small-to-big beat just using larger chunks?

When questions are specific (one fact) but answers need surrounding conditions: small chunks match the question precisely, the parent supplies the caveats.

Parent-child (small-to-big) retrieval →
How do you migrate to a new embedding model with no downtime?

Build a second index with the new model in the background, shadow-query both, compare metrics, then flip the read alias and retire the old index.

Choosing embedding models →
HNSW vs IVF in one sentence?

HNSW walks a graph and gives high recall at low latency for more memory; IVF searches a few clusters, is cheaper and easier to shard, and recall depends on how many clusters you probe.

Vector indexes: HNSW, IVF, flat →
How do you know your ANN index is good enough?

Compute exact top-k with flat search on a sample of queries and measure the ANN index’s recall against it while sweeping ef_search or nprobe.

Vector indexes: HNSW, IVF, flat →
How much RAM for 10M chunks at 1,024 dims in float32?

10M × 1,024 × 4 B ≈ 41 GB for vectors alone, plus graph links. int8 brings vectors to ~10 GB; binary to ~1.3 GB.

Vector quantisation & storage maths →
Write the BM25 term score.

idf(t) × tf × (k1 + 1) / (tf + k1 × (1 − b + b × |d| / avgdl)), with idf(t) = ln(1 + (N − n + 0.5)/(n + 0.5)); typical k1 ≈ 1.2–2, b ≈ 0.75.

BM25 (keyword search) →
Why keep BM25 when you have embeddings?

Exact identifiers, rare names and new jargon. Users search for error codes and SKUs, which dense retrieval handles poorly.

BM25 (keyword search) →
Why RRF and not score averaging?

BM25 scores are unbounded and corpus-dependent while cosine sits in [−1, 1]. RRF only uses ranks, so it’s robust without calibration.

Hybrid search (BM25 + dense) →
Bi-encoder vs cross-encoder?

Bi-encoder: embed query and documents separately, compare vectors — precomputable and fast. Cross-encoder: one forward pass per (query, document) pair — accurate, can’t be precomputed.

Reranking →
When is HyDE useful?

When questions and documents are phrased very differently: embedding a hypothetical answer lands nearer to real answers than the short question does.

Query rewriting →
Why is “the model won’t mention restricted docs” not enough?

Anything in the context can leak through paraphrase, summaries or injection. If the user isn’t allowed to read it, it must never be retrieved into their context.

Metadata filters & per-user permissions →
Pre-filter or post-filter?

Pre-filter for correctness (always k results, all allowed); post-filter only if you over-fetch heavily and accept the risk of short result lists.

Metadata filters & per-user permissions →
How do you check a citation automatically?

Verify the cited chunk was in the context, then check entailment: does the chunk support the sentence? Code for the first, a calibrated judge or NLI model for the second.

Citations & grounding →
A policy changed this morning and the bot still quotes the old one. Walk through the fix.

Check index lag for that source, whether the old version was tombstoned, and whether both versions are retrievable. Fix: incremental sync, delete or down-rank superseded versions by effective date, and add a freshness check to the eval set.

Keeping data fresh →
When would you reach for GraphRAG?

When eval failures cluster on multi-hop or corpus-wide questions that ordinary top-k retrieval can’t assemble — not as a default.

GraphRAG →
One-pass RAG or agentic RAG?

One-pass for the majority of direct questions (fast, cheap, predictable); agentic for multi-part research questions, routed by a classifier.

Agentic RAG →
Recall@5 is 0.95 but answers are wrong. What next?

Retrieval is fine; look at generation: the context assembly (order, truncation), the prompt, conflicting sources, or the model ignoring evidence. Check faithfulness per item.

Evaluating retrieval and answers →
Define MRR.

Mean over queries of 1 / rank of the first relevant result (0 if none). Rewards putting a correct hit first.

Evaluating retrieval and answers →
“How many refunds did we issue last month?” — RAG?

No: it’s an aggregate over structured data. Text-to-SQL or an analytics API with a read-only role.

When not to use RAG →
How do you make text-to-SQL safe?

Read-only role scoped to allowed views, statement allow-list (SELECT only), row limits and timeouts, row-level security for tenants, and showing the query to the user.

Text-to-SQL →
Where do cross-tenant leaks usually come from?

Not the vector DB but the glue: a filter missing on one code path, a shared cache keyed only by question, logs and traces visible across tenants.

Multi-tenant indexes →

Agents

Write the agent loop in ten lines.

messages = [system, user]; for step in range(MAX): r = model(messages, tools); messages.append(r); if not r.tool_calls: return r.text; for c in r.tool_calls: messages.append(tool_result(c.id, run(c))); raise BudgetExceeded.

The agent loop (ReAct) →
When should something not be an agent?

When you can draw the path in advance. A fixed workflow is cheaper, faster, testable and predictable; use an agent only where the steps genuinely depend on what is found.

The agent loop (ReAct) →
A tool keeps being called with the wrong argument. What do you change?

The description and schema before the prompt: name the parameter for what it is, give an example value, use an enum where possible, and make the error message say what valid input looks like.

Tool design →
Why can plan-then-execute improve security?

If the plan is fixed before any untrusted content is read, injected text in tool results can’t add new actions — it can only influence data within the planned steps.

Planning →
Why do coding agents self-correct well?

They get an external, objective signal — compiler errors and test results — instead of judging themselves.

Reflection & self-correction →
How does memory poisoning work and how do you stop it?

Untrusted content (an email, a web page) convinces the agent to save an instruction to long-term memory; it then affects future sessions. Stop it with write rules: only store from user-confirmed facts, record provenance, never store instructions.

Agent memory types →
Single agent or multi-agent?

Start single. Go multi-agent when the task splits into independent parallel parts or when one context can’t hold everything — and expect several times the token cost.

Multi-agent patterns →
What goes into a handoff payload?

Why it’s being handed off, a summary of what happened, the identifiers in play and what the user wants next — not the whole raw transcript if it can be avoided.

Handoffs →
MCP vs plain function calling?

Function calling is how a model asks to run a tool inside one app. MCP is how tools are packaged and discovered across apps — the tool still ends up as a function call to the model.

Model Context Protocol (MCP) →
What are MCP’s main security risks?

Tool poisoning (instructions in descriptions), rug pulls (definitions changing after approval), confused-deputy token use, and over-privileged servers. Mitigate with allow-lists, pinned definitions, scoped OAuth and review.

Model Context Protocol (MCP) →
When MCP and when A2A?

MCP to give your agent tools and data; A2A when the other side is itself an agent that plans and acts, often owned by someone else.

A2A and AGENTS.md →
Why is a browsing agent with your logged-in email dangerous?

Every page is untrusted input, the inbox is private data, and the browser can send requests — the lethal trifecta in one tool.

Browser & computer-use agents →
How do you evaluate a coding agent?

On real tasks with hidden tests: does the patch apply, do the target tests pass, do existing tests still pass, and how much did it cost per resolved task.

Coding agents →
What does “unexpected code execution” (OWASP Agentic ASI05) look like?

The agent writes or is tricked into running code with more privilege than intended — in your app server, with your credentials. Isolation and least privilege contain it.

Sandboxing →
What should happen when an agent hits its budget?

Stop, return what it has with a clear statement of what is unfinished, log why it stopped, and hand off to a human or a retry with different strategy if the task matters.

Stopping conditions & budgets →
How do you avoid approval fatigue?

Only gate actions that are irreversible or above a risk threshold, show the concrete action and its impact, and auto-approve low-risk categories you’ve measured.

Human-in-the-loop →
“This agent loops forever on some inputs.” How do you debug it?

Pull traces of looping runs, find the repeated call and the observation that triggers it (often an unhelpful error), fix the tool’s error message or arguments, add loop detection and a budget, and add those inputs to the eval set.

Typical agent failure modes →
Why can “code mode” be cheaper?

Intermediate results stay in the sandbox; only the final, filtered result returns to the model, instead of every tool output passing through the context.

Large toolsets →
Why not one service account for the agent?

Then every user effectively gets its permissions, and an injected instruction can act far beyond what the requesting user could do — a confused deputy.

Agent identity & delegated access →

Agentic workflows

How do you decide?

Can you write the steps down before seeing the input? Then it’s a workflow. Does the next step depend on what the previous one found, in ways you can’t enumerate? Then an agent.

Workflows vs agents →
Latency of a 4-step chain at 1.2 s per step?

About 4.8 s — chains are sequential. Parallelise independent steps or stream the last one.

Prompt chaining →
How do you evaluate a router?

Labelled inputs → confusion matrix per route, plus the downstream effect: quality and cost per route, and what misroutes cost.

Routing →
When is voting worth it?

For high-stakes classifications where disagreement is a useful signal: run 3–5 times, take the majority, and escalate when votes split.

Parallelisation (sectioning & voting) →
How is it different from parallelisation?

Parallelisation has fixed branches decided by the developer; orchestrator-workers decides the branches per input.

Orchestrator-workers →
When doesn’t evaluator-optimizer help?

When the evaluator can’t reliably tell better from worse — then you pay for loops that don’t move quality.

Evaluator-optimizer →
Why do LLM agents need durable execution?

Runs are long, call flaky external services and wait for humans. Without durability a crash means starting over — paying for tokens again and repeating side effects.

Durable execution →
What’s in a checkpoint?

The state after a step: messages or a summary, intermediate results, which step comes next and the IDs of side effects already performed.

State machines, graphs & checkpoints →
Why add jitter?

Without it, all clients that failed at the same moment retry at the same moments, hammering the recovering service in waves.

Retries & idempotency →
How does an idempotency key work?

The client sends a unique key per logical operation; the server stores key → result and returns the stored result on repeats instead of acting again.

Retries & idempotency →
How do you detect a dead worker?

Heartbeats: the worker updates a timestamp every N seconds; a sweeper marks jobs with stale heartbeats as failed or re-queues them (visibility timeouts do this for queues).

Long-running jobs →
How would you order steps in a saga?

Reversible and cheap steps first, irreversible ones (send confirmation, charge) last, once everything else has succeeded.

Sagas & compensating actions →
Framework or plain code for an interview take-home?

Plain code plus an SDK unless the task needs durability or graphs — it shows you understand the loop, and it’s easier to explain.

The framework landscape →

Guardrails & security

Can you prevent prompt injection?

Not completely. You reduce its likelihood (classifiers, instruction hierarchy) and, more importantly, its impact (least privilege, validation, human approval, no secrets in context).

Direct prompt injection →
Is system-prompt leakage a big deal?

Only if the prompt contains secrets or is your only control. Design so a leaked prompt is embarrassing at most.

Direct prompt injection →
Why is indirect injection worse than direct?

The victim is your user, not the attacker; it scales (plant once, hit everyone); and it arrives through trusted-looking channels your filters may not inspect.

Indirect prompt injection →
Jailbreak vs prompt injection?

Jailbreak: make the model break its safety policy. Injection: make the model follow the attacker’s instructions instead of the developer’s. Injection can be entirely “safe” content that still causes harm (e.g. sending data).

Jailbreaks →
A customer asks to delete their data. What must you touch?

Source records, chunks and embeddings in every index, cached responses, long-term agent memory, traces and logs within retention, fine-tuning datasets — and confirm with the provider’s retention terms.

PII handling →
How do you moderate a streamed response?

Moderate in chunks as text accumulates (buffer a sentence or two), stop the stream and replace the message if it trips, and accept a small latency cost on high-risk surfaces.

Moderation →
Where do you put the permission check?

In the tool execution layer, using the authenticated user’s identity from the session — never information the model provides about who the user is.

Tool permissions & least privilege →
Why strip Markdown images from model output?

An image URL like https://attacker/x?q=<secret> is fetched automatically by the browser, leaking data without a click. Only allow images from trusted domains.

Output validation →
List the exfiltration channels in a typical chat app.

Rendered images and links, any tool that makes network requests, tools that send messages or create shared documents, and logs or tickets that third parties can read.

Data exfiltration →
What is LLM08, vector and embedding weaknesses?

Risks in RAG stores: cross-tenant leakage through shared indexes, poisoned documents, embedding inversion, and missing access control on retrieval.

OWASP Top 10 for LLM applications (2025) →
What is “human-agent trust exploitation”?

An agent (compromised or mistaken) persuading a human to approve something harmful — e.g. a convincing summary that hides what the approval really does.

OWASP Top 10 for Agentic Applications →
An agent browses the web and reads the user’s CRM. How do you make it safe?

It already has untrusted content and private data, so remove autonomous outbound channels: no send/email tools, no fetching arbitrary URLs with data in them, and human approval for anything that leaves the system.

The lethal trifecta & the Rule of Two →
Explain the dual-LLM pattern.

The planner model has tools but only sees trusted input and symbolic references to untrusted data ($email_1). The quarantined model reads the untrusted data with no tools and returns structured values the planner can use without reading the raw text.

Injection-resistant design patterns →
What’s a rug pull in MCP?

A server you approved later changes its tool definitions (or behaviour) to something malicious. Pin and hash definitions and re-approve on change.

MCP & tool supply-chain security →
What does a red-team finding turn into?

A reproducible test case in the eval suite, a control or design change, and a metric (attack success rate) that must not regress.

Red teaming →
How do you rate-limit an LLM API fairly?

Token-based limits (not just requests) per user and tenant, a shared limiter (Redis token bucket), priority tiers, and queuing rather than failing for batch work.

Unbounded consumption (denial of wallet) →
Traces vs audit logs?

Traces are for debugging and performance — sampled, verbose, short-lived. Audit logs are for accountability — complete for actions, minimal, retained and protected.

Audit logs for AI actions →
What’s the first thing a bank’s security team asks?

Where does our data go, is it used for training, how long is it kept, who at the vendor can access it, and can it stay in our cloud account or region.

Data retention & residency →

Evals & observability

“The bot feels dumb.” What do you do first?

Pull 50 recent conversations, annotate each failure, group them, and find the top two causes — maybe retrieval misses on product names and over-long answers. Then fix and build evals for exactly those.

Error analysis →
How big should the eval set be?

Big enough that differences you care about are statistically visible: tens of items show only large effects; a few hundred let you see 5-point changes. Start small and grow from real failures.

Golden datasets →
What can’t a code check evaluate?

Open-ended quality — whether an explanation is correct, helpful or faithful. That needs a reference-based comparison, a calibrated judge or a human.

Code-based checks →
How do you remove position bias?

Run each pairwise comparison twice with the order swapped and only count consistent verdicts (or average them).

LLM-as-judge and its biases →
Why binary pass/fail?

Graders agree far better on “does it contain an unsupported claim: yes/no” than on “how good is it, 1–10”, and binary verdicts are easier to calibrate against humans.

LLM-as-judge and its biases →
Why look at TPR and TNR separately?

If 95% of outputs pass, a judge that always says pass is 95% accurate and useless. You need it to catch the failures (TNR on bad outputs) without flagging good ones.

Calibrating a judge against humans →
How do you avoid flaky eval gates?

Run items several times or at fixed settings, gate on statistically meaningful drops (confidence intervals), and look at item flips rather than the average alone.

Regression tests & CI gates →
Roughly how many items to detect a 5-point difference?

For independent samples around 80% pass, roughly a thousand per arm at 80% power; paired designs on the same items need fewer. With 100 items you can only see large effects (~15+ points).

Statistics for evals →
Why generate along dimensions?

Free-form generation collapses to typical, similar inputs; dimensions force coverage of the combinations you actually need to test.

Synthetic test data →
pass@k vs pass^k?

pass@k: probability at least one of k attempts succeeds — good for “can it ever?”. pass^k: probability all k succeed — the reliability a customer feels. If p = 0.8 per run, pass^3 ≈ 0.51.

Evaluating agents →
Which online metric for a support bot?

Resolution without human escalation (and without reopening within 7 days), with CSAT and cost per resolved conversation as guardrails.

Online metrics & A/B tests →
What goes on an LLM span?

Model and version, prompt version, parameters, input and output (redacted), token counts including cached and reasoning tokens, latency (TTFT, total), cost and any error.

Tracing model and tool calls →
How do you attribute LLM cost to tenants?

Tag every call with tenant and feature at the gateway, log usage and computed cost, and aggregate daily; on Bedrock, per-application inference profiles with cost allocation tags.

Tracking cost and latency →
Explicit or implicit feedback?

Both: explicit is clear but sparse and biased toward extremes; implicit (edits, retries, escalations) is plentiful but noisy. Use implicit to find candidates and humans to label them.

Feedback loops →
Why care about the standard in an interview?

It shows you’d build observability that survives a vendor change and joins LLM spans with the rest of your distributed traces.

OpenTelemetry GenAI conventions →
Retrieval “no results” rate doubled overnight. Likely causes?

An ingestion job failed or deleted content, a permissions sync changed filters, an embedding model or tokenizer changed, or a new product launched that the index doesn’t cover.

Drift & production monitoring →

Backend engineering for AI

Design the API for “summarise this 200-page PDF”.

POST /documents (upload via presigned URL), POST /summaries {document_id} with Idempotency-Key → 202 {job_id}; GET /summaries/{job_id} for status and result; optional webhook; SSE for progress if the UI needs it.

API design for AI features →
Why return usage in the response?

Callers (and your own frontend) can show cost, enforce budgets and debug — and it makes billing disputes easy.

API design for AI features →
Why might SSE stop working behind your company proxy?

Buffering or compression middleware holds the response until it completes, or idle timeouts kill quiet connections. Disable buffering, send heartbeats, avoid gzip on the stream.

Streaming over SSE vs WebSockets →
Your FastAPI service handles 2 requests/s and CPU is idle. Why?

Likely a blocking call (sync SDK, time.sleep, sync DB driver) inside async def, so the event loop is stuck. Use the async client or run sync code in a thread pool.

Async & concurrency →
def or async def for an endpoint that calls a sync library?

Plain def — FastAPI runs it in a thread pool so the event loop stays free. Or async def with asyncio.to_thread around the sync call.

Python async specifics →
Why must consumers be idempotent?

Queues deliver at least once: a crash after doing the work but before acknowledging means the message comes back. Without idempotency you index twice, email twice, charge twice.

Queues & workers →
When is a semantic cache a bad idea?

When answers depend on who asks (permissions, account data), on time, or on small wording differences. Use it for public, stable FAQ-style content.

Caching, including semantic caching →
Token bucket in one sentence?

A bucket refills at a fixed rate up to a capacity; each request takes tokens (for LLMs: estimated tokens), so short bursts are allowed but the long-run rate is capped.

Rate limits & backoff →
How do you cancel an LLM stream when the user disconnects?

Detect the disconnect (request.is_disconnected() in Starlette, an aborted signal in Node) and close the upstream stream/abort the request so generation — and billing — stops.

Timeouts & cancellation →
What breaks when you fail over to another provider?

Prompt behaviour, tool-call formats, structured-output support, context limits and safety behaviour. Abstract the interface, keep per-model prompt variants, and include fallbacks in evals.

Fallbacks across providers →
pgvector or a dedicated vector DB?

pgvector when you want vectors next to relational data, transactions and RLS at modest scale. A dedicated store when you need very large scale, heavy filtered ANN, or features like built-in hybrid and multi-tenancy at scale.

Postgres + pgvector →
Why doesn’t Postgres use my index?

The query doesn’t match the leading columns, wraps the column in a function, the table is small or the condition matches most rows (seq scan is cheaper), or statistics are stale.

Database indexing →
Write skew example?

Two doctors on call; each transaction checks “at least one other on call” and removes itself. Both checks pass on the same snapshot, both commit, nobody is on call. Serializable or a lock on the shared rows prevents it.

Transactions & isolation levels →
Silo vs pool?

Silo: separate resources per tenant — strong isolation, higher cost and ops. Pool: shared resources with tenant keys — efficient, isolation depends on code. Many SaaS products pool small tenants and silo large or regulated ones.

Multi-tenancy →
Why never put the provider key in the browser?

Anyone can read it and spend your money or exhaust your limits. Route calls through your backend (or issue short-lived scoped tokens where the provider supports them).

Auth & secrets →
Agent called issue_refund, timed out, and retried. What prevents a double refund?

The tool call carries an idempotency key derived from the run and step (or the order ID); the refunds service sees the key already succeeded and returns the original result.

Idempotency keys →
How do you verify a webhook?

Recompute HMAC(secret, timestamp + body) and compare in constant time, reject old timestamps, then dedupe on the event ID.

Webhooks →
What does decoupling generation from the request buy you?

Resumption after network drops, multiple tabs watching the same answer, deploys that don’t kill in-flight answers, and a clean place to enforce cancellation.

Resumable streams →
What would you property-test in a RAG system?

The chunker: concatenating chunks (minus overlap) reproduces the text, no chunk exceeds the size limit, every chunk has its source metadata. The packer: never exceeds the budget.

Testing LLM applications →
Lambda or Fargate for a chat backend?

Fargate (or another container platform) when streams are long, connections persistent or work is unpredictable; Lambda for short, spiky, stateless endpoints and event-driven pipelines.

Deployment →

Model choice & adaptation

A customer wants the model to “know our 10,000 internal docs”. Fine-tune?

No — RAG. Facts change, need citations and permissions; fine-tuning bakes in a snapshot, hallucinates details and can’t be filtered per user.

Prompting vs RAG vs fine-tuning →
How do you know the fine-tune helped?

Same eval set, same prompts: compare base+prompt vs fine-tuned on quality, latency and cost, and check general-capability regressions on a broader set.

Supervised fine-tuning (SFT) →
LoRA parameters for one 4096×4096 matrix at r=16?

A: 16×4096 + B: 4096×16 = 131,072, vs 16.8M for the full matrix — about 0.8%.

LoRA →
Why does QLoRA fit on one GPU?

The base model’s weights take ~0.5 byte per parameter instead of 2, and optimiser state exists only for the tiny adapters.

QLoRA →
DPO vs RLHF in one sentence?

Both learn from preference pairs; RLHF trains a reward model and does RL against it, DPO optimises the model directly on the pairs — fewer moving parts.

Preference tuning: RLHF and DPO →
When would RFT beat SFT?

When you can grade outcomes but can’t easily write ideal demonstrations — e.g. hard extraction or reasoning tasks with checkable answers.

Reinforcement fine-tuning with graders →
What’s the business case for distillation?

A high-volume, narrow task where a big model works but is too slow or expensive: distil once, cut per-request cost by an order of magnitude, keep the big model as fallback.

Distillation →
Cost of a cascade where 70% stays on a model costing 1/10th?

0.7 × 0.1 + 0.3 × (0.1 + 1) = 0.07 + 0.33 = 0.40 of the big-model cost — escalated requests pay for both calls.

Model routing & cascades →
Fine-tune the embedder or add a reranker first?

Usually the reranker: no re-embedding, quick to test, often a bigger lift. Fine-tune embeddings when recall (not ranking) is the bottleneck.

Fine-tuning embedding models →
Customer says data can’t leave their network. Options?

Open-weight model in their VPC or on-prem; or a cloud provider’s models in their own cloud account and region with no data retention, if their policy allows that.

Open-weight vs closed models →
How do you upgrade to a new model version?

Run the eval suite on the new version, fix prompt regressions, compare cost and latency, shadow or canary on real traffic, then switch with a rollback plan.

Model versions & deprecations →

Serving, cost & performance

When does self-hosting pay off?

When volume is high and steady enough to keep GPUs busy, the model is small enough to serve efficiently, and you need control (data, latency, fine-tunes). Show the break-even numbers.

Hosted APIs vs self-hosting →
Why is vLLM faster than naive Hugging Face generate()?

Continuous batching keeps the GPU full as requests come and go, and PagedAttention stores the KV cache without fragmentation so many more sequences fit.

Serving engines (vLLM and friends) →
Why does batching barely slow each token down at first?

At small batch sizes the step time is dominated by reading the weights from memory, which happens once per step regardless of how many sequences share it — until compute becomes the bottleneck.

Batching: static vs continuous →
What problem does PagedAttention solve?

Fragmentation and over-reservation of KV-cache memory, which capped how many sequences fit on a GPU.

PagedAttention →
A 70B model in FP16 vs INT4: weight memory?

FP16: 70B × 2 B ≈ 140 GB. INT4: ≈ 35 GB (plus some overhead) — two 80 GB GPUs vs one.

Quantisation →
Can an 8B FP16 model serve 32 concurrent 8k-token sequences on one 80 GB GPU?

Weights ≈ 16 GB. KV at 128 KB/token (32 layers, 8 KV heads, dim 128, FP16) × 8,192 × 32 ≈ 34 GB. ~50 GB plus overhead — yes, with room to spare.

GPU memory maths →
Estimate decode speed for a 16 GB model on a 3.35 TB/s GPU at batch 1.

Each token reads ~16 GB: 3,350 / 16 ≈ 200 steps/s upper bound, so maybe 100–150 tokens/s in practice.

Prefill vs decode →
Your interactive app and a nightly batch job share GPUs. Problem?

Batch jobs push batch sizes up and interactive latency degrades. Separate deployments, priorities, or schedule the batch for off-peak.

Throughput vs latency →
Does speculative decoding change outputs?

No — with proper rejection sampling the output distribution matches the target model exactly; only speed changes.

Speculative decoding →
Why route by prefix?

The cache lives on one replica’s GPU; sending similar requests to the same replica raises hit rates.

Prefix caching (self-hosted) →
Replicas or tensor parallelism for more throughput?

If the model fits on one GPU, replicas scale throughput linearly with less overhead; tensor parallelism is for models that don’t fit or to cut per-token latency.

Tensor & pipeline parallelism →
What would you send to a batch API?

Anything with no user waiting: re-embedding a corpus, offline evals, bulk classification, generating synthetic data, nightly summaries.

Batch APIs & provisioned throughput →
Why put a gateway in front of models?

One place to enforce keys, budgets, fallbacks, caching and logging, so every service doesn’t reimplement them — and switching providers is a config change.

LLM gateways →
What metric would you autoscale an LLM server on?

Queue depth / waiting requests or KV-cache utilisation, with targets set from load tests — not CPU.

GPU autoscaling & cold starts →
Estimate: 50k conversations/day, 6 turns, 3k input and 300 output tokens per turn, $3/M in and $15/M out.

Per turn: 3,000 × 3/1M + 300 × 15/1M = $0.009 + $0.0045 = $0.0135. × 6 turns = $0.081 per conversation. × 50k = ~$4,050/day, ~$120k/month — before caching or routing.

Cost per request & back-of-envelope maths →

The FDE role

How is an FDE different from a solutions engineer or consultant?

An FDE writes production code and owns delivery at the customer, not just demos or advice — and is expected to generalise what they learn back into the product.

What a forward deployed engineer does →
First three questions for “we want AI for our claims process”?

Walk me through how a claim is handled today and where time goes; what does a mistake cost and how is quality checked now; what data and systems are involved and who owns them.

Discovery with a customer →
How do you choose the first use case among five?

Score each on value, feasibility with today’s data, risk, and how measurable it is. Start with high value + high feasibility + measurable, even if it’s not the most exciting.

Turning a vague ask into a scoped POC →
The model is 92% accurate. Is that good?

Compared to what? Against the current human process’s accuracy and speed, the cost of the 8% errors, and whether those errors get caught downstream.

Success metrics for AI deployments →
Customer data is in SharePoint with complex permissions. What’s your plan?

Use a connector that syncs content and ACLs incrementally, enforce those ACLs at retrieval time from the user’s SSO identity, and test with users of different groups.

Integrating with customer systems →
The customer requires everything in their AWS account. What changes?

Package the stack as IaC deployed into their account, use Bedrock or self-hosted models there, send no data to your cloud, and agree on how you get logs and ship updates.

Deployment models: SaaS, VPC, on-prem →
How do you answer “how do you prevent prompt injection?” in a review?

Honestly: it can’t be fully prevented, so we limit impact — least-privilege tools, no autonomous outbound channels with private data, approvals on side effects, output validation, monitoring — and here is our test suite.

Security reviews →
What does GDPR’s right to erasure mean for a RAG system?

You must be able to find and delete a person’s data everywhere it was copied: source, chunks, embeddings, caches, memories, logs and any fine-tuning data.

Compliance vocabulary →
How do you show failures in a demo without losing the deal?

Present them as known, measured and handled: “in 6% of cases it escalates to a person — here’s one, and here’s how the reviewer sees it.” Credibility goes up.

Demos & handoff →
10k tickets/month, 6 min each, 40% deflected, $30/h loaded cost — monthly value?

10,000 × 0.4 × 0.1 h × $30 = $12,000/month of agent time, before error and satisfaction effects; subtract model, infra and review costs.

The ROI / value case →
Usage dropped after week two. What do you do?

Talk to the users who stopped, check the traces for their last sessions, find the friction (slow, wrong, extra steps), and fix the top issue before adding features.

Adoption & change management →
How do you respond in the meeting?

Agree the goal is no costly errors, ask how often people get it wrong today, and propose a design where the model handles confident cases and routes the rest to a reviewer — with the numbers measured on their data.

“It must be 100% accurate” →
“A customer says their dashboard is wrong but can’t tell you which number.” Start?

Ask what decision they use the dashboard for and what looked wrong; trace one metric from source to chart; compare with a source they trust; find where the numbers diverge.

The decomposition round →
First five minutes in an unfamiliar repo?

README and how to run it, the entry point, the tests for the area in question, and a quick run to see real output.

The learning round →
This agent loops forever on some inputs. Method?

Reproduce with a failing input, inspect the trace for the repeated call and its observation, hypothesise (unhelpful error, missing stop condition), fix, add a budget and a regression test.

The re-engineering (debugging) round →

Interview formats

What separates a strong answer?

Grounding every choice in a requirement or a number, an explicit eval and rollout plan, and naming the top three ways it fails with the mitigation for each.

The AI system design round →
How do you handle “use any LLM API”?

Abstract the call behind a small function, mock it in tests, and focus on the loop, validation and error handling — that’s what is being assessed.

Coding rounds for AI roles →
What do reviewers read first?

The README: what you built, how you measured, the numbers, what failed and why, and what you’d do with more time.

The take-home →
Common root causes when an agent loops?

A tool returning an unhelpful error the model keeps retrying, a missing stop condition, a result that never satisfies the model’s plan, or context truncation that drops the evidence it already found.

Live debugging rounds →
What do you ask first?

Can you show me three conversations where it felt dumb? Then: what did you expect it to do in each, and how often does this happen?

Customer-conversation simulation →
How would you evaluate a support assistant?

Offline: real tickets with expected resolutions, checks for policy compliance and grounding, calibrated judges for tone and correctness. Online: resolution without escalation, reopen rate, CSAT, cost per resolution — rolled out as an A/B test.

Eval design questions →
Where is latency spent in that pipeline?

Query embedding (tens of ms), retrieval (tens of ms), reranking (tens to hundreds of ms), then the model: TTFT from prefill of a few thousand tokens plus decode of the answer — usually the largest part.

The tech-screen classic →
What makes a deep dive strong?

Clear problem and baseline, decisions tied to constraints, measured results, a real failure and how you found and fixed it, and what you learned.

Project deep dives →
How do you talk about a project that failed?

Own it: what you expected, what happened, how you found out, what you changed, and what the experience changed in how you work.

Behavioural rounds for AI roles →
What are they really assessing?

Judgement: decomposing the problem, verifying output, spotting subtle bugs and owning the final design — the assistant is a tool, not the candidate.

AI-assisted coding rounds →

Voice & realtime agents

Where does latency come from in a voice turn?

End-of-speech detection, final transcript, model TTFT, time to the first speakable phrase, TTS first audio and network. Stream every stage and overlap them.

The voice agent pipeline →
Why not just wait two seconds of silence?

Two seconds plus processing makes every turn feel broken; people expect replies within roughly half a second to a second.

Voice activity detection & turn-taking →
Why truncate the assistant message on interruption?

So the model’s memory matches what the user heard; otherwise it refers to information the user never got.

Interruptions (barge-in) →
You’re at 1.6 s. What do you cut first?

Find the biggest stage: usually model TTFT (shorter prompt, smaller model, cached prefix) or sequential extra calls (merge or parallelise), then endpointing tuning.

The voice latency budget →
Why might a bank choose a cascade?

Transcripts for audit, control over the exact model and prompts, text-level guardrails and PII redaction before anything is spoken.

Speech-to-speech models vs cascades →
WebRTC or WebSockets for voice?

WebRTC: built for real-time media over lossy networks, with echo cancellation and jitter buffers. WebSockets are simpler but TCP head-of-line blocking hurts on bad connections.

Telephony & WebRTC →

Use-case blueprints

What are the top three risks?

Wrong answers about policy (grounding + evals), unauthorised actions (permissions + limits + approvals), and frustrating loops (escalation rules and handoff).

Blueprint: customer support agent →
How do you test permissions?

An eval set of (user, query) pairs where the right answer depends on access, asserting restricted documents never appear in retrieval results for unauthorised users.

Blueprint: enterprise search over permissioned docs →
How do you decide what goes to human review?

Per-field confidence and validation results: any failed rule or low-confidence critical field (amounts, IDs) goes to review; track how often reviewers change values to tune thresholds.

Blueprint: document processing pipeline →
How do you evaluate text-to-SQL?

Execute generated and reference queries and compare result sets (not SQL strings), on a set of real questions with known answers.

Blueprint: analytics / text-to-SQL agent →
When would you use a classic classifier instead of an LLM?

Stable labels, lots of training data, very high volume and tight latency — a fine-tuned small encoder or logistic regression on embeddings can be faster and cheaper with similar accuracy.

Blueprint: classification & routing at volume →
How do you evaluate a summary?

Check coverage of key facts (against a reference list), faithfulness of each claim to the source, and format compliance — plus user edits as an online signal.

Blueprint: summarisation & meeting notes →
How do you give a coding agent enough context in a huge repo?

Don’t preload the repo: give it search, read and symbol-lookup tools, repo instructions, and let it explore — just-in-time context.

Blueprint: coding assistant →
How do you control cost?

Cap subagents and searches per run, use smaller models for subagents and a stronger one for synthesis, compress findings before they return, and run asynchronously so batch pricing is possible.

Blueprint: deep research agent →

AI product sense

How would you show confidence without fake precision?

Categorical states (verified from source / partly supported / not found) tied to actual checks, rather than a made-up percentage.

Designing for uncertainty →
An agent takes 40 s. How do you make it acceptable?

Show the plan and live progress, stream the final answer, let users leave and come back (background job + notification), and cut the run time where you can.

Latency perception →
Which implicit signals are most useful?

Edits before sending (what was wrong), regenerate (didn’t like it), escalation to a human (couldn’t solve), and abandonment right after an answer.

Feedback capture →
Is a high escalation rate bad?

Not necessarily — escalating the right cases is success. Track escalations that should have been resolved and resolutions that should have been escalated.

Human handoff →
A feature costs $0.08 per use and power users use it 400 times a month on a $20 plan. Problem?

$32 of cost on a $20 plan. Route to cheaper models, cache, cap usage, or price the feature separately.

Unit economics of AI features →
Give an example where you’d say no to an LLM.

Calculating a refund amount from a policy table: use code. Let the LLM explain the result in plain language.

When not to use an LLM →

ML basics that still come up

For a prompt-injection filter, precision or recall?

Both matter, but the trade-off is explicit: low recall lets attacks through (so impact must be limited by design anyway), low precision blocks real users. Pick the threshold from measured costs.

Precision, recall & F1 →
Why does ROC mislead with imbalance?

FPR divides by the huge number of negatives, so many false positives still look like a small rate, while precision reveals they outnumber true positives.

ROC vs precision-recall curves →
Why does calibration matter for a cascade?

The escalation threshold assumes the confidence means something; if the small model is overconfident, it keeps hard cases it gets wrong.

Calibration →
How can a RAG eval leak?

If the eval questions were generated from the same chunks and the answers are verbatim, or if eval items are in the few-shot examples or fine-tuning data.

Leakage & data splits →
Your judge agrees with humans 94% of the time. Enough?

Check its true-negative rate on the failures — with 6% failures, a judge that always says pass agrees 94% of the time.

Class imbalance →
Why is BM25 a good RAG baseline?

It’s cheap, strong on exact terms, needs no embeddings, and tells you how much dense retrieval actually adds on your corpus.

Baselines →

Building blocks

Why not call the model directly from the browser?

The API key would be public, and you’d lose the one place to enforce auth, permissions, budgets, guardrails and logging.

User / client app
Where does a voice turn spend its time?

Endpointing, final transcript, model TTFT, first speakable phrase, TTS first audio and network — stream and overlap them.

Voice I/O (STT + TTS)
What does the backend own that the model must never own?

Identity, permissions, budgets, validation of tool calls and outputs, and the decision to perform side effects.

Backend API
Why idempotent?

Queues deliver at least once; a crash after work but before ack redelivers the job.

Worker
When does an AI feature need a queue?

Ingestion, document batches, long agent runs, anything over ~10 s or anything that must survive spikes and provider rate limits.

Job queue
What does replay buy you?

The engine re-runs workflow code but skips completed steps using recorded results, so it resumes exactly where it stopped.

Durable workflow
What goes in a checkpoint?

The state after a step: messages or a summary, intermediate results, the next step, and IDs of side effects already done.

State store / checkpointer
What must be in a semantic cache key?

Tenant and the user’s permission scope at minimum, plus model and prompt version, so a hit can never cross a boundary.

Response cache
How do you cut this call’s latency?

Shorter prompt (and a cached prefix), smaller model, capped output, streaming, and no extra sequential calls before it.

Model call
What breaks on failover?

Prompt behaviour, tool-call formats, structured-output support and context limits — so fallbacks belong in the eval suite.

Model gateway
How do you evaluate a router?

Confusion matrix on labelled requests, and the downstream quality and cost per route.

Router / classifier
When is a rewriter worth its latency?

When eval failures cluster on follow-up and multi-part questions. Measure retrieval with and without it.

Query rewriter
Inline or sampled?

Inline only when the answer must be blocked on failure (high stakes); otherwise sample traffic and judge offline.

Evaluator / judge
Why keep BM25?

Users search for exact codes and names that embeddings blur.

Keyword retriever (BM25)
How do you know the ANN index is good?

Compare against exact search on sample queries and measure recall while tuning ef_search / nprobe.

Vector retriever
Why RRF?

It uses ranks, not scores, so BM25 and cosine don’t need calibrating against each other.

Hybrid fusion
Bi-encoder vs cross-encoder?

Bi-encoders embed separately (fast, precomputable); cross-encoders read the pair together (accurate, per pair).

Reranker
What gets cut first?

Old history (summarised), then low-relevance chunks, then stale tool results — never instructions, the question or the output reserve.

Context assembler
How do deletions reach the index?

Tombstones from the sync job (or CDC) delete by stable chunk IDs.

Keyword index
pgvector or a dedicated store?

pgvector when vectors live next to relational data with RLS at modest scale; dedicated stores for very large or heavily filtered workloads.

Vector index
Are internal documents trusted?

Not entirely: tickets, emails and wiki pages can be written by anyone, including attackers. Treat retrieved text as data.

Document sources
What’s a freshness SLO?

A target such as “95% of edits searchable within 15 minutes”, measured from source change to index.

Data connector / sync
Where is RAG quality usually lost?

Parsing and chunking — retrieval can only find what parsing extracted cleanly.

Parser & chunker
How do you change embedding models safely?

Build a second index in the background, compare, then flip the alias.

Embedding model
How should an agent query the database?

Through task-specific tools or a read-only, row-level-secured role — never with the app’s admin credentials.

Database
When do you compact?

Past a threshold (say 70% of the window), keeping goals, decisions, IDs and open items.

Conversation memory
What may be written to memory?

User-confirmed facts and preferences, with source and date — not text lifted from emails or web pages.

Long-term memory
Why is a web-fetch tool an exfiltration channel?

The model can put private data in the URL it fetches (?q=secret), and the request leaves your network.

Web / untrusted content
What does “irreversible” change in the design?

It needs an idempotency key, explicit limits and usually a human approval before it runs.

External system / API
When should this be a workflow instead?

When you can write the steps down in advance.

Agent loop
When is it worth it?

Breadth-first work that splits into independent parts, like research across many sources.

Orchestrator agent
What should a worker return?

A compact, structured summary with sources — not its whole transcript.

Worker agent
How should a tool fail?

With a short, specific error the model can act on.

Tool
What makes a sandbox safe?

No secrets, no network (or an allow-list), resource and time limits, and disposal after the session.

Code sandbox
What makes approvals work?

Gate only risky actions, show the concrete action and its impact, and make the run durable so it can wait.

Human approval / review
Is an input classifier a security control?

A speed bump. The real control is limiting what a compromised model can do.

Input guardrail
Why strip images from model output?

Image URLs are fetched automatically — a zero-click exfiltration channel.

Output guardrail
Where does authorisation for tool calls happen?

Here, in code, using the session’s identity — never in the prompt.

Tool permission layer
Why does it help?

Injected instructions reach a model that can’t act, and only typed values reach the one that can.

Quarantined reader (dual LLM)
What’s on an LLM span?

Model and version, prompt version, tokens (incl. cached), latency, cost, inputs/outputs (redacted).

Tracing
Where does the golden set come from?

Real traffic and error analysis, labelled by domain experts, growing with every incident.

Eval suite
Which signals are most useful?

Edits before sending, regenerate, escalation and abandonment.

Feedback collector