MCP, RAG, Security and Evaluation Interviews

Learn the reasoning behind each answer, then say it in your own words with an example from work you have done.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

Good topic answers give a short definition, a trade-off, a failure case and a way to verify. This page covers MCP, multi-agent systems, RAG and context, security, and evaluation and observability, with links for deeper study and a runnable retrieval metrics exercise.

What you will learn: how to structure a topic answer, forty practice questions with answer outlines, follow-ups, retrieval metrics and a way to review yourself.
Prerequisites: the linked guides for any topic that is new to you.

Versions used

The example runs in November 2026 with Python 3.13 and only the standard library, using invented rankings. Protocol details change between revisions, so confirm them in current documentation. These are practice questions written for this site.

Beginner Method and MCP

A four-part answer

DefinePlain words
WeighTrade-off
BreakFailure case
VerifyHow to test
About a minute is often enough before inviting a follow-up.

Model Context Protocol

QuestionAnswer outline
What problem does MCP address?A common way for AI applications to connect to tools and data, reducing one-off integrations. It does not make a tool safe or correct.
Describe host, client and server.The host is the application; it runs a client for each server connection; servers expose capabilities.
Tools, resources and prompts?Actions the model may request, data the application can read and reusable templates a user can choose.
Local or remote transport?A local process suits single-user tools; remote HTTP suits shared services and needs authentication, tenancy and operations.
How should a server authorize?Verify the caller and token audience, apply least privilege and enforce rules in the service. Do not forward tokens blindly.
What is tool description poisoning?Misleading text in tool metadata that steers the model. Review and pin servers, show changes and limit permissions.
MCP or a direct API call?Direct calls are simpler for one fixed integration; a protocol helps when several clients reuse capabilities.
MCP or A2A?MCP mainly connects an application to tools and context; A2A addresses communication between agents. They can coexist.

Study: What Is MCP? Hosts, Clients, Servers and Capabilities, MCP Authentication and Security and MCP vs A2A vs REST.

Multi-agent architecture

QuestionAnswer outline
When use more than one agent?Separate permissions, expertise or parallel work that a single agent handles poorly, shown by evaluation.
Supervisor or peer design?A supervisor centralizes control and can bottleneck; peers are flexible and harder to bound and trace.
What should a handoff contain?Goal, facts with sources, completed actions, constraints, budget and the new owner.
How avoid conflicting writes?Single writer, versioned state or locks, and an explicit merge rule.
How stop endless exchanges?Turn, time and cost limits, progress checks and an accountable terminator.
Do agents voting remove errors?No. Shared models and context cause correlated mistakes; verify against evidence.
How is access handled?Each agent has its own limited identity; delegation must not expand rights.
How compare with one agent?Same cases, measuring success, cost, delay and failure types.

Study: Single-Agent vs Multi-Agent Systems, Handoffs, Routing, Shared State and Communication and Parallelism, Deadlocks and Conflict Resolution.

Intermediate Retrieval, context and security

RAG and context engineering

QuestionAnswer outline
RAG, long context or fine-tuning?Retrieval supplies changing or restricted facts; long context suits bounded material; tuning shapes behavior. Compare by test.
How choose chunk size?Follow document structure and measure retrieval on real questions; there is no universal size.
Why hybrid search?Keywords catch exact terms; embeddings catch meaning; fusion and reranking combine them.
Answer is wrong: where to look?Is the fact in the source, indexed, retrieved, included in context and used faithfully?
How enforce permissions?Filter by the user's rights before content reaches the model, and propagate revocation.
What is context engineering?Choosing, ordering, compressing and isolating what the model sees at each step.
Risks of summarizing history?Lost constraints and invented facts; keep key items structured and test long runs.
When is GraphRAG useful?Questions about connections or whole collections, if the graph construction cost is justified.

Study: RAG Explained and Agentic RAG, What Is Context Engineering? Stack and Token Budgets and GraphRAG and Hybrid Graph Retrieval.

Exercise: compare two retrievers

Recall at k is the share of relevant items found in the first k results. Reciprocal rank is one divided by the position of the first relevant item, averaged over queries as MRR.

"""Interview exercise: compare two retrievers with three metrics."""

RELEVANT = {"q1": {"a"}, "q2": {"b", "c"}, "q3": {"d"}, "q4": {"e", "f"}}
SYSTEMS = {
    "A": {"q1": list("axyz"), "q2": list("bxyz"), "q3": list("dxyz"),
          "q4": list("exyz")},
    "B": {"q1": list("xayz"), "q2": list("xbcy"), "q3": list("xydz"),
          "q4": list("xefy")},
}


def recall_at(ranked, relevant, k):
    return len(set(ranked[:k]) & relevant) / len(relevant)


def reciprocal_rank(ranked, relevant):
    return next((1 / i for i, d in enumerate(ranked, 1) if d in relevant), 0.0)


def mean(values):
    values = list(values)
    return sum(values) / len(values)


print("system  recall@1  recall@4   MRR")
for name, results in SYSTEMS.items():
    r1 = mean(recall_at(results[q], rel, 1) for q, rel in RELEVANT.items())
    r4 = mean(recall_at(results[q], rel, 4) for q, rel in RELEVANT.items())
    mrr = mean(reciprocal_rank(results[q], rel) for q, rel in RELEVANT.items())
    print(f"{name:<8}{r1:8.2f}{r4:10.2f}{mrr:6.2f}")

Output:

system  recall@1  recall@4   MRR
A           0.75      0.75  1.00
B           0.00      1.00  0.46

Which is better depends on use. If only the first passage fits the context, system A wins. If the agent reads four passages, system B finds every relevant item while A misses some. A single metric would hide this. Four invented queries are far too few for a real decision, and relevance labels need review. See RAG Evaluation, Grounding and Debugging.

Agent security

QuestionAnswer outline
What is prompt injection?Untrusted content treated as instructions. Direct from a user or indirect through documents and tool results.
Can prompts alone prevent it?No reliable prompt defense is known; limit authority, separate trust levels, check actions and require approval.
What combination is dangerous?Access to private data, exposure to untrusted content and a way to send data out. Remove at least one.
How should agents hold secrets?Not in prompts; short-lived scoped credentials issued to the tool layer.
Where enforce policy?In code and services that execute actions, with logs.
How secure code execution?Isolated sandbox, resource limits, restricted network and no inherited secrets.
Supply chain concerns?Models, packages, tool servers, prompts and data; pin, review and monitor.
First steps in an incident?Stop the capability, revoke access, preserve evidence, assess impact and follow notification duties.

Study: Prompt Injection Attacks and Defenses, Agent Identity, Authorization and Secrets and Red Teaming and Incident Response. Only test systems you are authorized to test.

Expert Evaluation, observability and review

Evaluation and observability

QuestionAnswer outline
Outcome or trajectory evaluation?Outcome checks the result; trajectory checks steps and safety. Both can be needed.
How build a test set?Real and edge cases, severity labels, permitted data, a held-out part and additions from failures.
Can a model grade a model?With a clear rubric and calibration against human labels; watch bias toward style, order or length.
Results vary between runs?Repeat trials, report counts and intervals and separate infrastructure failures.
What does a trace contain?Spans for model and tool calls, versions, timing, tokens, outcomes and links, with sensitive data protected.
Which alerts first?Verified failures, unsafe action blocks, loops, latency and cost beyond limits.
How gate a release?Thresholds fixed in advance, zero tolerance for named harms, staged rollout and rollback.
Limits of benchmarks?Different tasks, possible contamination and setup sensitivity; test your own work.

Study: Agent Evaluation Framework, LLM Judges, Human Review and Ratings and Agent Tracing and OpenTelemetry.

Harder follow-ups

  • Your judge agrees with humans 90 percent of the time. On which cases does it disagree, and does that matter?
  • Retrieval recall rose but answers worsened. What could explain it?
  • A tool server changed its description overnight. What should your client do?
  • Two agents have valid but conflicting updates. Who decides, and what is recorded?
  • Traces contain personal data. How do you debug and still meet retention rules?

For each, say what you would measure or inspect first. Several have more than one reasonable answer.

A debugging scenario

An interviewer says that an agent started giving outdated policy answers yesterday. A good response asks what changed, then walks the path: source document updated, ingestion job succeeded, old version removed from the index, cache cleared, retrieval returns the new passage, context includes it and the answer cites it. It names the trace fields that show each stage, proposes a temporary safe response if the cause is unclear and adds a regression case afterward. Guessing "the model got worse" without evidence is a weak start.

Reviewing your answers

CheckQuestion
AccuracyCould I support this with documentation?
ConcretenessDid I give an example?
Trade-offDid I name a cost?
LimitsDid I say when it fails?
OwnershipDid I separate what I did from what a team did?

Explain a topic to someone outside the field, then to an expert. Gaps show up quickly in both directions.

Two answers written out

"How do you protect an agent from prompt injection?" A possible answer: "I assume some untrusted text will influence the model, so I limit what influence can achieve. The agent gets only the permissions the task needs, tools check authorization themselves, untrusted content is marked and kept away from high-privilege steps, outbound channels are restricted and consequential actions need approval showing exact arguments. I test with harmful documents in a safe environment and monitor blocked actions. Residual risk remains, so some actions I would not give it at all."

"Your RAG system gives wrong answers. What do you do?" A possible answer: "I take failing questions and check each stage: whether the source holds the fact, whether it was ingested, whether retrieval returned it, whether it survived context assembly and whether the answer followed it. I count where failures cluster, fix the largest group, and rerun a fixed question set so I can see whether the change helped or hurt other cases."

Both answers state an approach, name a limit or measurement and leave room for follow-up. Adapt them to systems you know; an interviewer will soon probe borrowed detail.

Statements to question

ClaimBetter position
"Long context makes retrieval obsolete"Cost, permissions, freshness and attention to detail still matter; test both
"More agents give better results"They add coordination cost; show the gain on the same cases
"A standard protocol makes tools secure"Protocols define interaction; authorization and review remain your job
"A high benchmark score means it is ready"Readiness depends on your tasks, risks and operations
"Guardrails block all attacks"Filters miss cases; combine them with limits on authority

A practice drill

  1. Pick one question at random from each table.
  2. Answer aloud in about ninety seconds.
  3. Write the weakest point in one sentence.
  4. Read the linked guide for that point.
  5. Build or run a tiny example that demonstrates it.
  6. Answer again two days later without notes.

Spaced repetition with a working example usually exposes misunderstanding faster than rereading.

Strong candidates connect areas. A retrieval choice affects security, because permissions must be applied before content reaches the model. A tool protocol affects observability, because calls need identifiers across boundaries. A multi-agent design affects evaluation, because failures can start in one agent and appear in another. Practice following one request through all five topics and say where each control sits and what evidence it leaves. If you cannot say where something is enforced, treat it as an open question and describe how you would find out.

Questions to ask the interviewer

  • How do you know an agent change is an improvement?
  • Which actions can your agents take without approval?
  • What did the last incident teach the team?
  • Who is on call, and what support do they have?

The answers help you judge the maturity of the work and whether the role suits you.

Cross-topic scenario

An agent reads support emails, searches account documents through a tool server and drafts replies, with a second agent checking them. Outline an answer: the email is untrusted content; the tool server verifies the caller and returns only that customer's records; retrieval filters before the model sees text; the checking agent compares claims with sources but is not a security boundary; sending requires approval or tight templates; traces link each draft to passages and versions; evaluation includes wrong-customer, outdated-policy and planted-instruction cases. Then ask whether the second agent improves results enough to justify its cost.

Keep the answer ordered by the path of the data. That order helps you avoid missing a boundary, and it lets the interviewer stop you at any point to explore one control in more depth.

Their answers need not be perfect. Look for honesty about open problems.

Common mistakes

MistakeConsequenceInstead
Reciting definitionsShallow impressionAdd trade-off and failure
Claiming a total defenseLost credibilityDescribe layers and residual risk
Universal numbersWrong in contextSay how to measure
Outdated protocol detailIncorrect answerCheck the current revision
BluffingExposed by follow-upAdmit and reason

Checklist

  • I can answer one question per topic without notes.
  • Each answer includes a failure and a test.
  • I can compute recall at k and MRR.
  • I can explain why authority limits matter for injection.
  • I have checked protocol details recently.
  • I have examples from my own projects.

Frequently asked questions

Should I memorize these answers?

No. Use the outlines to find gaps, then explain the ideas in your own words and connect them to something you built.

Which topic comes up most?

It depends on the role. Read the posting and weight your preparation toward its duties.

Are there official answers?

Protocols and products have official documentation. Design questions often allow several good answers if the reasoning is sound.

How deep should security answers go?

Show threats, enforcement points, testing and response. Stay defensive and do not offer attack instructions.

References

Where to go next