15 Google DeepMind AI Engineer Interview Questions & Answers

google-deepmind icon

Questions with Detailed ExplanationsWith Detailed Explanations

(Last Updated: August 28, 2026)

1. You are shipping a Gemini-powered customer support summarizer that must not invent refunds or policy exceptions. Would you rely on prompt-only guardrails or add retrieval plus constrained decoding, and what metric would you track to catch silent regressions in hallucinations?Prompt EngineeringEasyGoogle Deepmind

Question Details

Compare the instruction-only and evidence-constrained contracts for refund and policy claims, including trusted context placement, allowed output behavior, fallback handling, and the claim-support metric used for regression gating.

Short Interview Answer (30-60 seconds)

I would not rely on prompt only guardrails. I would retrieve trusted refund and policy evidence, keep that evidence separate from the customer conversation, tell Gemini to use only that evidence for sensitive claims, and constrain the output to a defined JSON structure. I would then validate each refund or policy claim against the retrieved evidence. If support is missing or conflicting, I would return a safe unknown result or escalate. For regression gating, I would track claim support, which is supported factual claims divided by evaluated factual claims.

Detailed Explanation

A support summary can cause real problems if it tells a customer that a refund or special exception exists when the approved rules do not say that. Instructions alone are not enough because the model can still produce a confident sounding mistake. I would first look up the trusted company rules that apply to the conversation. Then I would make the summary use those rules as its source of truth. If the rules do not support an answer, the system should say that it does not know or send the case to a person.

Useful Questions to Ask the Interviewer
  1. Which policy sources are approved as trusted evidence for refund and exception claims?
  2. Should unsupported or conflicting cases always go to a human, or can the product return an explicit unknown result?
  3. Which prompt versions, model versions, and customer data slices should be included in the regression gate?
You are shipping a Gemini-powered customer support summarizer that must not invent refunds or policy exceptions. Would you rely on prompt-only guardrails or add retrieval plus constrained decoding, and what metric would you track to catch silent regressions in hallucinations? diagram
How to Explain It in an Interview

I would use an evidence constrained contract rather than prompt only instructions. The customer conversation is untrusted input. The refund policy, exception rules, service rules, and other approved documents are trusted context. Retrieval finds the most relevant trusted passages and keeps their source identifiers.

Gemini receives the trusted context separately from the customer text. The instructions say that refund and policy claims must come only from that trusted context and must cite supporting sources. If the evidence does not support a claim, the allowed result is an explicit unknown response instead of an invented answer.

I would also constrain the response to a defined JSON structure. This controls the format, but it does not prove that the facts are correct. After generation, the application performs a separate semantic claim support check. Each factual refund or policy claim is compared with the retrieved trusted evidence. Missing or conflicting evidence causes a safe fallback, such as an unknown response or human escalation. A retrieval miss can also trigger broader retrieval and another attempt.

For regression gating, I would track claim support as supported factual claims divided by evaluated factual claims. Higher is better. I would compare it across prompt versions, model versions, and important data slices. This catches silent regressions where the output still has valid structure but the model starts making unsupported claims.

Prompt Example
SYSTEM:
You summarize customer support conversations.

TRUSTED POLICY CONTEXT:
{{retrieved_policy_passages_with_source_ids}}

RULES:
Use only the trusted policy context for refund and policy claims.
Cite the source identifier that supports each factual claim.
If the trusted context does not support a refund or policy conclusion, return an unknown result.
Do not create a refund rule or policy exception that is not supported by the trusted context.
Return only JSON that matches the required schema.

CUSTOMER CONVERSATION:
{{customer_conversation}}

TASK:
Summarize the conversation and report only refund or policy claims that are supported by the trusted policy context.
JSON Schema Example
{
  "type": "object",
  "properties": {
    "summary": {
      "type": "string"
    },
    "refund_claim": {
      "type": "string",
      "enum": [
        "Yes",
        "No",
        "I don't know"
      ]
    },
    "policy_exceptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "citations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "summary",
    "refund_claim",
    "policy_exceptions",
    "citations"
  ],
  "additionalProperties": false
}
Why Interviewers Ask This

Interviewers want to see whether I understand the limit of instructions alone when a model handles sensitive refund and policy claims. They are testing whether I can separate trusted policy evidence from customer text, constrain the output structure, validate factual claims after generation, choose a safe fallback when evidence is missing, and measure silent hallucination regressions with a useful production metric.

Common interview mistakes

A common mistake is trusting a strong prompt as if it guarantees factual behavior. Another mistake is mixing customer text with trusted policy text without clearly separating their roles. Teams also sometimes treat valid JSON as proof that the content is correct, but schema validation checks structure, not factual support. Another mistake is accepting a citation simply because a citation field exists instead of checking whether the cited evidence really supports the claim. Finally, using an undefined confidence score as the main safety gate can hide failures. The stronger check is whether each sensitive factual claim is actually supported by trusted evidence.

Interview tip

Start with the decision. Say that prompt only guardrails are not enough for sensitive refund and policy claims. Then walk through trusted retrieval, evidence constrained instructions, structured output, semantic claim support validation, safe fallback, and the claim support regression metric. Make the difference between format validation and factual validation very clear.

Interviewer may ask next
What would you do if retrieval returns no useful policy evidence or returns conflicting evidence?

I would not let Gemini invent a conclusion. The exact behavior changes to a safe fallback. With missing evidence, the system returns an explicit unknown result or asks for missing information. With conflicting evidence, it escalates to a human or another approved resolution path. A retrieval miss may also trigger broader retrieval and another attempt. This matters because the evidence contract is only useful when the evidence itself is adequate.

Why is valid JSON not enough, and how would you detect a regression after a prompt or model change?

Valid JSON is not enough because schema validation checks the response shape, not whether a refund or policy claim is supported. I would separately test each factual claim against the retrieved trusted evidence. I would calculate claim support as supported factual claims divided by evaluated factual claims, then compare that metric across prompt versions, model versions, and important data slices. A regression gate can block a release when claim support falls beyond the predefined acceptable limit.

2. In a multi-step agent, the model selects a tool, executes it, and then writes the final answer; you observe that adding more retrieved context improves answer quality on easy queries but worsens it on hard ones. Propose a concrete change to the RAG and prompting stack that addresses this, and describe how you would validate it with an ablation that isolates whether the fix improved grounding versus just changed verbosity.Prompt EngineeringMediumGoogle Deepmind

Question Details

Define how context selection and prompt assembly should vary by query difficulty, then specify controlled ablations that hold generation length and model version constant while measuring evidence support separately from verbosity.

Short Interview Answer (30-60 seconds)

I would make retrieval and prompt assembly depend on query difficulty. For easy queries, I would retrieve more relevant documents and rerank them for relevance and diversity because broader coverage can help. For hard queries, I would retrieve fewer documents, rerank for high precision, and filter contradictions so the prompt contains tighter evidence. The model selects the tool, the tool executes and returns its result, and the model then writes the cited final answer. I would validate this with controlled ablations while keeping the model version, decoding settings, and final answer length constant, then measure evidence support separately from answer correctness.

Detailed Explanation

The main idea is to stop giving every question the same amount of information. Some simple questions benefit from seeing more useful material. Hard questions can become worse when too many weak or conflicting facts are added. I would first decide whether a question is easy or hard. Then I would change how much information is selected and how carefully it is filtered. I would also test the change in a fair way so that better answers cannot be explained only by the system writing more words.

Useful Questions to Ask the Interviewer
  1. How should query difficulty be estimated in the current system?
  2. Do we already have document citations or another way to measure whether claims are supported?
  3. Can the evaluation compare answers at the same final answer length?
In a multi-step agent, the model selects a tool, executes it, and then writes the final answer; you observe that adding more retrieved context improves answer quality on easy queries but worsens it on hard ones. Propose a concrete change to the RAG and prompting stack that addresses this, and describe how you would validate it with an ablation that isolates whether the fix improved grounding versus just changed verbosity. diagram
How to Explain It in an Interview

I would first classify the query as easy or hard. That decision controls both retrieval and prompt assembly.

For an easy query, I would retrieve more documents, using a larger top M set. I would rerank them for relevance and diversity. The goal is broader coverage because straightforward questions can benefit from several useful pieces of evidence.

For a hard query, I would retrieve fewer documents, using top K where K is smaller than M. I would rerank for high precision and apply contradiction filtering. The goal is a tighter context with less noise and fewer conflicting claims. Hard questions are more sensitive to weak evidence, so simply adding more context can make the answer worse.

The adaptive prompt would keep stable instructions. It would tell the model to use the supplied context, say when the context is insufficient, and cite document identifiers. The easy path would encourage use of all relevant information. The hard path would tell the model to prefer the most reliable sources and avoid uncertain or conflicting details.

The execution order is also important. The prompt goes to the model. The model selects the tool. The tool executes and returns its result. The model then writes the final answer with citations.

For validation, I would use four controlled runs. A0 is static RAG with fixed top M retrieval and no difficulty routing. A1 adds difficulty routing with different retrieval amounts for easy and hard queries. A2 adds precision reranking and contradiction filtering. A3 adds the full adaptive prompt. I would hold model version, decoding settings, and final answer length constant in every run.

Then I would measure evidence support, meaning the percentage of answer claims supported by cited context. I would also measure answer correctness against ground truth or expert judgment. If evidence support rises at the same answer length, the gain is better grounding rather than extra verbosity.

Prompt Example
SYSTEM
Use only the supplied context to answer the question. If the context is insufficient, say so. Cite supporting document identifiers in brackets.

CONTEXT
Doc 1: selected evidence
Doc 2: selected evidence

DIFFICULTY
Hard

DIFFICULTY SPECIFIC INSTRUCTION
Prefer the most reliable sources. Avoid uncertain or conflicting details.

USER QUESTION
{original question}
JSON Schema Example
{
  "type": "object",
  "properties": {
    "answer": {
      "type": "string"
    },
    "citations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "answer",
    "citations"
  ],
  "additionalProperties": false
}
Why Interviewers Ask This

Interviewers ask this to see whether I can treat retrieval and prompting as one system instead of assuming that more context is always better. They want to know whether I can change context selection based on query difficulty, keep the agent execution order correct, and design a controlled experiment that separates stronger evidence support from simply producing more words. It also tests my judgment about retrieval precision, prompt assembly, citations, evaluation, and practical production tradeoffs.

Common interview mistakes

A common mistake is assuming that more retrieved context always helps. Another mistake is reducing context for every query even though broader context helps the easy queries in this scenario. It is also wrong to change retrieval, prompt instructions, model version, decoding, and answer length at the same time because the experiment can no longer isolate the cause of improvement. Another mistake is measuring only answer correctness while ignoring evidence support. Finally, the execution flow must not show the final answer being written before the tool has executed and returned its result.

Interview tip

Lead with the practical decision to make retrieval depend on query difficulty. Explain the easy path and hard path next. Then state the agent execution order. Finish with the four ablations and say clearly that model version, decoding settings, and final answer length stay constant while evidence support is measured separately from correctness.

Interviewer may ask next
What happens if the difficulty classifier sends a hard query down the easy path?

The hard query can receive too much context, which may add noise or conflicting evidence and reduce grounding. The exact behavior being affected is difficulty based retrieval routing. I would measure routing quality alongside the answer evaluation so I can see whether failures come from retrieval selection or later generation. This matters because the adaptive design depends on choosing the right context policy. The tradeoff is that adding a routing decision creates another component that must be evaluated and monitored.

Why not retrieve fewer documents for every query?

I would not retrieve fewer documents for every query because the observed behavior shows that broader context helps easy queries. The exact change is adaptive context selection. Easy queries use more relevant documents for coverage, while hard queries use fewer, higher precision documents to reduce noise and contradictions. This keeps the benefit of broader retrieval where it helps. The tradeoff is greater system complexity because retrieval policy, reranking, prompt assembly, and evaluation now depend on query difficulty.

3. You shipped a Gemini-powered summarization feature in a Google Cloud console workflow and within 24 hours support tickets spike due to hallucinated configuration steps; what do you do in the first 2 hours, and what do you change in the next 2 weeks? Include the specific metrics you would watch and the rollback or gating mechanism you would use.Prompt EngineeringHardGoogle Deepmind

Question Details

Separate immediate prompt or feature containment from the two-week redesign of trusted context, output constraints, evaluation cases, versioned release gates, and the metrics that prove unsupported configuration instructions declined.

Short Interview Answer (30-60 seconds)

I would contain the problem first, then redesign the feature so unsupported configuration steps cannot reach users. In the first two hours, I would measure the incident, turn off or restrict the summarization feature with a feature flag, add a strict prompt that uses only supplied context, validate the structured output, route failed checks to a safe fallback, communicate the incident, and save bad examples for evaluation. Over the next two weeks, I would add trusted context, semantic checks, stronger evaluation cases, prompt versioning, staged releases, and automatic rollback gates. I would watch unsupported step rate, safe fallback rate, schema pass rate, semantic pass rate, support impact, user feedback, and latency.

Detailed Explanation

My first goal is to stop wrong setup instructions from reaching users while keeping the rest of the console workflow available. I would measure how often unsupported instructions appear and how much user impact they cause. Then I would turn off or restrict the summary feature, show a safe response when the system cannot support an answer, tell support teams what changed, and save the bad examples. During the following two weeks, I would rebuild the feature so important configuration instructions come from trusted material and each release must pass clear checks before more users receive it.

Useful Questions to Ask the Interviewer
  1. Can the summarization feature be disabled independently with a feature flag?
  2. Do we already have trusted product documentation that the application can provide as context?
  3. Do we have saved prompts, outputs, support tickets, and previous prompt versions for evaluation?
You shipped a Gemini-powered summarization feature in a Google Cloud console workflow and within 24 hours support tickets spike due to hallucinated configuration steps; what do you do in the first 2 hours, and what do you change in the next 2 weeks? Include the specific metrics you would watch and the rollback or gating mechanism you would use. diagram
How to Explain It in an Interview

In the first two hours, I would treat this as a production safety incident. I would confirm the unsupported configuration step rate and identify which console flows are affected. I would then use a feature flag to disable the risky path or place it in a restricted mode. The prompt would tell Gemini to use only supplied trusted context and to say that it lacks enough information when support is missing. I would require structured JSON output and run JSON Schema validation before the application uses the result. This checks structure, not truth. A separate semantic check would compare each proposed configuration step with trusted context, allowed actions, and required prerequisites. If validation fails, the user gets a safe fallback instead of an unsupported instruction. The diagram also shows a low confidence fallback. I would not use confidence alone as proof of correctness. Grounding and semantic validation remain the safety decision.

I would notify support teams and capture bad prompts, outputs, and relevant context with appropriate user consent so those examples become incident evaluation cases.

During the next two weeks, I would make trusted product documentation the grounding source. I would strengthen role boundaries and output constraints, reject unsupported steps, and build an evaluation suite with normal cases, hard negative cases, adversarial cases, and prompt injection cases. I would version the prompt and release changes through staged canary traffic. Each candidate version would be compared with the previous approved version.

The main quality metric is unsupported step rate, meaning the percentage of summaries containing unsupported or incorrect configuration steps. I would compare it with the production baseline and the approved release gate. Safe fallback rate measures how often grounding or validation cannot support a request and the application uses the safe fallback. Schema pass rate measures valid output structure only. Semantic pass rate measures whether configuration steps pass checks against trusted context, allowed actions, and prerequisites. I would also watch support tickets per one thousand users, helpful user feedback, and p95 latency, which is the response time that ninety five percent of requests finish within. If a release gate fails, I would stop the rollout or return automatically to the last approved prompt or feature version and route affected requests to the safe fallback.

Prompt Example
SYSTEM:
You summarize configuration information for a cloud console workflow.
Use only facts present in TRUSTED CONTEXT.
Never invent commands, settings, prerequisites, or configuration steps.
If the trusted context does not support a requested step, return an unsupported result instead of guessing.
Return only JSON that matches the required schema.

TRUSTED CONTEXT:
<context>
{{trustedProductDocumentation}}
</context>

USER REQUEST:
<request>
{{userRequest}}
</request>

OUTPUT CONTRACT:
For each configuration step, include the instruction and the source identifier that supports it. If no supported step exists, return an empty configurationSteps array and set supported to false.
JSON Schema Example
{
  "type": "object",
  "properties": {
    "summary": {
      "type": "string"
    },
    "supported": {
      "type": "boolean"
    },
    "configurationSteps": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instruction": {
            "type": "string"
          },
          "sourceId": {
            "type": "string"
          }
        },
        "required": [
          "instruction",
          "sourceId"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "summary",
    "supported",
    "configurationSteps"
  ],
  "additionalProperties": false
}
Why Interviewers Ask This

The interviewer wants to see whether I can separate an urgent production response from a durable prompt engineering redesign. They are testing whether I understand that model output is probabilistic and must not be trusted just because it sounds confident. They also want to see whether I can ground answers in trusted context, constrain output structure, validate meaning, build evaluation cases, version prompts, measure user harm, and use release gates that can stop or reverse a bad rollout.

Common interview mistakes

A common mistake is to change only the wording of the prompt and assume the problem is solved. Another is to treat valid JSON as proof that the instructions are correct. JSON Schema validates structure, while semantic validation checks whether the configuration steps are actually supported. It is also a mistake to treat model confidence as factual evidence, invent fixed release thresholds without baseline data, or increase traffic without a rollback path. Teams can also miss the learning opportunity by failing to save real incident examples for future evaluation.

Interview tip

Explain the answer in two clear time windows. First describe containment: measure, gate, validate, fall back, communicate, and capture examples. Then describe the two week redesign: trusted context, stronger constraints, semantic validation, evaluation, versioned release gates, metrics, and rollback. Make it clear that model output is untrusted until the application verifies it.

Interviewer may ask next
What would you do if the model returns valid JSON but the configuration step is still unsupported by the trusted documentation?

I would reject that output during semantic validation and send the request to the safe fallback. JSON Schema only proves that the response has the expected structure. It does not prove that a configuration instruction is correct. The semantic check must verify the proposed action, its prerequisites, and its supporting trusted context before the application displays it. This matters because a perfectly formatted answer can still hallucinate. The tradeoff is extra validation work and some added latency, but that is appropriate when users may act on the instructions.

How would you release the redesigned prompt without exposing every user to a regression?

I would use a versioned staged release with automatic gates. I would first evaluate the new prompt against incident cases, normal cases, hard negative cases, adversarial cases, and prompt injection cases. Then I would send only a small portion of eligible traffic to the new version and compare its unsupported step rate, semantic pass rate, support impact, user feedback, and latency with the approved baseline. If a release gate fails, I would stop the rollout or return to the last approved version and use the safe fallback for affected requests. The main tradeoff is slower rollout in exchange for lower production risk.

4. You shipped a RAG assistant for internal DeepMind docs and users report confident but wrong answers. What 3 offline evaluation metrics do you add to catch this, and how do you set decision thresholds before launch?Retrieval Augmented Generation RagEasyGoogle Deepmind

Question Details

Require separate retrieval-relevance, answer-support, and confidence or abstention measurements, plus a threshold-selection procedure over representative hard queries and the cost of accepting unsupported answers.

Short Interview Answer (30-60 seconds)

Add retrieval relevance, answer support, and confidence or abstention quality. Measure Recall@k or nDCG@k, supported-answer rate, and ECE with coverage and abstention behavior. Sweep candidate thresholds on hard labeled queries, then choose the operating point that minimizes costly unsupported answers while keeping useful coverage.

Detailed Explanation

This question asks how I would catch confident but wrong answers before release. I would test the assistant in three different ways. First, I would check whether it found the right source material. Second, I would check whether its answer is actually backed by that material. Third, I would check whether it knows when to avoid answering. I would test many difficult examples, compare different cutoffs, and choose rules that reduce harmful wrong answers without causing the assistant to refuse too many questions that it could answer safely.

Useful Questions to Ask the Interviewer
  1. What types of wrong answers are most costly for users?
  2. Do we have human labels for relevant documents and whether each answer is supported?
  3. Should the assistant abstain when evidence is weak, and how much abstention is acceptable?
  4. Does the evaluation set include rare, ambiguous, adversarial, stale, conflicting, and unanswerable questions?
You shipped a RAG assistant for internal DeepMind docs and users report confident but wrong answers. What 3 offline evaluation metrics do you add to catch this, and how do you set decision thresholds before launch? diagram
How to Explain It in an Interview

I would evaluate the RAG assistant at three separate failure points.

1. Retrieval relevance. This asks, "Did we fetch the right information?" I would have human judges label which documents are relevant for each test query. Then I would measure Recall@k or nDCG@k. Recall@k checks whether the relevant documents appear in the top k retrieved results. nDCG@k also rewards putting more relevant documents near the top. This catches failures where the needed evidence never reaches the generation step.

2. Answer support, or grounding. This asks, "Is the answer actually supported by the retrieved documents?" Human judges can label an answer as supported, partially supported, or not supported, based on whether its important claims follow from the provided context. I would report a supported-answer rate or percentage-supported score. This catches hallucinations even when retrieval looks good. The system can retrieve the correct document and still produce a claim that the document does not justify.

3. Confidence or abstention quality. This asks, "Does the system know when it should answer and when it should abstain?" I would compare the system's confidence signal with actual correctness and measure Expected Calibration Error, or ECE. ECE measures how closely confidence matches observed accuracy; lower is better. I would also track coverage, which is the fraction of queries that receive an answer, and the abstention rate on queries labeled unanswerable. This exposes a dangerous system that remains highly confident when its answer is wrong or unsupported.

For threshold selection, I would first define a grid of candidate confidence and minimum-support thresholds. I would then run the full RAG system on a representative offline set of hard queries. That set should include rare, ambiguous, adversarial, out-of-date, conflicting, and unanswerable cases. Human judges should label document relevance, answer support, correctness or "no good answer," and required citations when applicable.

For every candidate operating point, I would record retrieval relevance, answer-support rate, ECE, abstention rate, and answered-query coverage. Retrieval Recall@k or nDCG@k is mainly an offline launch-quality gate because online requests do not have relevance labels available at serving time. The serving decision can instead use signals that exist at inference time, such as a calibrated confidence score and a support check against the retrieved context.

I would choose the operating point using the cost of errors. A confident unsupported answer should usually carry a higher cost than an unnecessary abstention. Conceptually, I would minimize expected harm such as: cost of a wrong accepted answer multiplied by the probability of answering an unsupported query, plus the cost of an unnecessary abstention multiplied by the probability of refusing an answerable query.

The final serving rule can be simple: answer only when confidence is at or above its chosen threshold and answer support is at or above its chosen threshold. Otherwise, abstain or ask a follow-up question. Separately, I would ship only if the offline retrieval target is met, the supported-answer rate is acceptable, ECE is below its target, abstention behavior on unanswerable queries is acceptable, and the expected error cost is within the product's limit.

The main tradeoff is coverage versus safety. Stricter thresholds reduce risky answers but increase abstentions. Looser thresholds answer more questions but accept more unsupported responses. I would choose thresholds before launch from the labeled hard-query set, then monitor the same failure signals after launch and recalibrate when the documents, query mix, or system behavior changes.

Retrieval Path
  1. Build a representative offline set with rare, ambiguous, adversarial, stale, conflicting, and unanswerable queries.
  2. Have human judges label relevant documents, answer support, correctness or no-good-answer cases, and required citations when applicable.
  3. Run the complete RAG pipeline for every query.
  4. Measure retrieval relevance with Recall@k or nDCG@k.
  5. Measure answer support with the percentage of answers whose important claims are supported by the retrieved context.
  6. Measure confidence calibration with ECE, and track coverage plus abstention behavior on unanswerable queries.
  7. Define a grid of candidate confidence and support thresholds.
  8. Evaluate every candidate operating point on the same labeled set.
  9. Compare unsupported accepted answers, unnecessary abstentions, coverage, and expected error cost.
  10. Choose the operating point that meets the offline retrieval, support, calibration, and abstention targets while keeping expected cost within the accepted limit.
  11. At serving time, answer only when the available confidence and support checks pass; otherwise abstain or ask a follow-up question.
Time & Space Complexity

The main cost is evaluation work rather than a difficult algorithm. Every test query has to run through retrieval and generation, so evaluating N queries requires roughly N full RAG runs. Retrieval relevance needs document labels, and answer support needs careful judgments about whether claims are backed by the retrieved text. After those results are collected, trying many threshold combinations is comparatively cheap. The ongoing maintenance cost is keeping the hard-query set and its labels representative as documents, user questions, and system behavior change.

Where it is used

This approach is useful for internal knowledge assistants, enterprise search assistants, support copilots, research tools, and other RAG systems where a fluent but unsupported answer can mislead users. It is especially useful before launch and after changes to retrieval, reranking, prompts, documents, or generation behavior because the three measurements show different sources of failure.

Why Interviewers Ask This

This tests whether the candidate can separate three different RAG failure modes instead of treating answer quality as one number. Poor retrieval, unsupported generation, and overconfidence need different measurements. It also tests whether the candidate can turn offline results into a launch decision by using representative hard queries, explicit quality targets, and the cost of accepting unsupported answers.

Common interview mistakes

A common mistake is using only final answer accuracy. That hides whether the failure came from retrieval, unsupported generation, or overconfidence. Another mistake is measuring retrieval alone and assuming good documents guarantee a grounded answer. A third mistake is trusting a confidence score without checking calibration. Teams can also choose thresholds from mostly easy queries, ignore unanswerable cases, or optimize only for coverage. Another important mistake is treating Recall@k or nDCG@k as if it were automatically available as a per-request production decision signal. These metrics normally depend on offline relevance labels, so they are better used as launch-quality gates unless the serving system has a separate validated online relevance signal.

Interview tip

Structure the answer around the three failure points: did we retrieve the right evidence, did the answer stay supported by that evidence, and did the system know when to abstain? Then explain threshold selection as a cost-sensitive operating-point decision on representative hard queries, not as an arbitrary confidence number.

Interviewer may ask next
Why do you need both retrieval relevance and answer-support metrics if the final answer is already scored for correctness?

They locate different failures. Retrieval relevance tells us whether the needed evidence reached the model. Answer support tells us whether the generated claims are justified by that evidence. A wrong answer can happen because retrieval missed the right document, or because generation ignored or distorted a good document. Measuring both makes the failure easier to diagnose and fix.

How would you choose between a stricter threshold that causes more abstentions and a looser threshold that answers more questions?

I would compare the expected cost of the two error types on representative labeled queries. If a confident unsupported answer is much more harmful than an unnecessary abstention, I would choose a stricter operating point. I would still track coverage so the assistant remains useful. The selected thresholds should meet the support and calibration targets while keeping the expected cost of mistakes within the accepted limit.

5. How would you design an AI system to prioritize tasks in a multi-agent environment?Ai Agents And Agentic SystemsEasyGoogle Deepmind

Question Details

Define task attributes, agent capabilities, dependency and priority rules, shared state, conflict resolution, starvation prevention, and the stop or reassignment conditions for the prioritization workflow.

Short Interview Answer (30-60 seconds)

At a high level, the system should keep choosing the best ready task for the best available agent. The hard part is balancing urgency, value, dependencies, agent skills, cost, and fairness as the system changes. I would explain it in three flows: score and rank tasks, dispatch them to agents, then use shared state and feedback to re-rank work. The main trade-off is that frequent re-ranking gives better decisions, but adds more coordination and computation.

Detailed Explanation

The goal is to decide which task each agent should work on next. This sounds simple, but priorities can change while work is running. Some tasks depend on other tasks. Agents also have different skills, current loads, and health. The design solves this by collecting useful task facts, scoring each task against available agents, ranking the choices, and assigning work through a Dispatcher. A Shared State Store keeps the latest task, dependency, agent, metric, and audit information. That state feeds later scoring decisions.

Useful Questions to Ask the Interviewer
  1. Can a running task be paused or replaced by a higher-priority task?
  2. Are deadlines, business value, or fairness more important when they conflict?
  3. Can several agents work on related tasks at the same time?
  4. What should happen when an agent becomes unhealthy during a task?
How would you design an AI system to prioritize tasks in a multi-agent environment? diagram
How to Explain It in an Interview
1. Start with task intake and useful task facts

I would first turn each incoming request into a task with enough information to make a good decision. Tasks can come from a User, an API / Event, or a Scheduled Trigger through the Task Intake Service.

Task Attributes include the task ID, type, description, goal, success criteria, deadline, business value, complexity, required skills, dependencies, and retry, time, or cost limits. An idempotency key helps recognize the same request when it is sent again.

2. Score tasks using the current system state

Next, the Prioritization Engine scores a task for an agent. The Scoring Model uses value, urgency, dependency readiness, agent capability match, estimated cost or time, and a fairness factor.

The Shared State Store supplies current task, dependency, and agent state. Policy Rules add hard limits. These include SLA targets, meaning required service goals, maximum parallel work, budgets, compliance rules, and data locality. A task that breaks a hard rule should not win only because its score is high.

3. Rank and dispatch ready work

The Priority Queue places the highest-scoring ready tasks first. The Dispatcher pops the next task and assigns it to an appropriate agent.

Dependencies are checked before work can run. A blocked task becomes ready only after its required tasks finish. If two tasks need the same protected resource, only one writer should control it at a time, using a lock or lease. Ties use fixed rules: higher score, earlier deadline, then older task ID.

4. Keep shared state current while agents work

Agents send Results, status, metrics back to the Shared State Store. Task State records pending, running, completed, or failed work. The Dependency Graph records blocked and ready tasks. The Agent Registry records capabilities, load, and health.

Metrics track latency, success, and cost. The Audit Log records decisions, actions, and results. When shared state changes, the Prioritization Engine can calculate scores again.

5. Prevent starvation, stop safely, and learn from results

A low-priority task should not wait forever. Aging raises its score over time. A fairness bucket groups work for fair scheduling. Quotas or maximum consecutive tasks per agent also stop one agent or team from taking all the work. Periodic re-ranking applies these changes.

A task stops when it succeeds, reaches its retry limit, exceeds its time or cost budget, or has a critical dependency fail. If an agent becomes unhealthy, work can be reassigned. A higher-priority task may preempt current work when Policy Rules allow it.

The Feedback Loop learns from outcomes. It updates value and cost estimates, improves the Scoring Model and policies, and tracks quality, cost, and latency for future decisions.

Practical Complexity & Trade-offs

The benefit is that priorities can change when new information arrives. The system can react to deadlines, blocked work, agent health, and better task choices. The downside is that scoring and re-ranking take extra work when shared state changes often. Locks or leases stop two agents from changing the same protected resource, but they add coordination. Aging and fairness rules prevent old tasks from waiting forever, but they may sometimes move lower-value work ahead of newer tasks. We accept these costs because the system needs both good choices and predictable rules.

Why Interviewers Ask This

The interviewer wants to see how you turn a vague scheduling problem into clear rules and flows. They are checking whether you can combine task priority with dependencies, agent skills, shared state, fairness, and failures. They also want to see whether you can separate scoring from fixed execution rules that always apply the same way, and explain the trade-offs clearly.

Interviewer may ask next
What would you change if high-priority tasks must be able to preempt running lower-priority tasks?

I would keep the same design, but make preemption an explicit Policy Rule. When a much higher-priority task appears, the Prioritization Engine can re-score the current work and the new task. The Dispatcher would replace running work only when the policy allows it.

The important part is safe stopping. The running agent should not simply stop halfway through a protected action. Conflict Resolution already uses single-writer control, locks, or leases. Those rules must stay valid while work changes hands. Task State should record whether the old task was paused, failed, or returned for later work.

The Shared State Store then records the new status, agent assignment, results, and metrics. The Audit Log records why the preemption happened. The downside is more complexity. Frequent preemption can waste work and make agents less efficient, so I would use it only when the priority difference is important enough.

How would you prevent low-priority tasks from waiting forever when urgent tasks keep arriving?

I would use the Starvation Prevention rules already shown in the design. The main mechanism is aging. Aging means a waiting task slowly receives a higher score as time passes. This gives old tasks a better chance to move up the Priority Queue.

I would also use fairness buckets and quotas, or limits on how many consecutive tasks one agent can receive. Periodic re-ranking matters because the system must apply those changes as waiting time grows. The Shared State Store keeps the current task and agent state. The Prioritization Engine reads that state when it calculates new scores.

Hard dependencies still come first. Aging must not make a blocked task ready. Policy Rules can also keep important deadlines or hard limits above fairness adjustments. The downside is that fairness may sometimes delay a newer task with slightly higher immediate value, but it prevents the system from ignoring old work forever.

6. For a generative agent that calls tools (search, code exec, and calendar), you need a single offline score that predicts user success. Do you model this as next action prediction with cross-entropy, or as sequence-level expected return, and how do you estimate it from logged trajectories with missing counterfactuals?Ai Agents And Agentic SystemsMediumGoogle Deepmind

Question Details

Compare per-step action prediction with trajectory-level utility, define the logged state-action-outcome data, address missing counterfactual actions and policy mismatch, and state how the score is validated against user success.

Short Interview Answer (30-60 seconds)

At a high level, I would score the whole agent trajectory because user success depends on the full sequence of tool choices and results. The main challenge is that logs show only actions actually taken, not the missing alternatives. I would define the logged trajectory, estimate sequence-level expected return with off-policy methods, and validate that score against real user success. Cross-entropy is useful for training next actions, but it is not the final success score. The main trade-off is estimator variance when the target policy differs from the logging policy.

Detailed Explanation

The goal is to give a tool-using agent one offline score that predicts whether users will succeed. A user may need several steps before the task finishes. The agent can search, run code, or use the calendar. Per-step accuracy is therefore incomplete because one reasonable action can still lead to a poor final result. The logs also show only what the old agent actually did. They do not show what would have happened after actions it did not choose. The solution scores complete trajectories and estimates how a new policy would perform from logged data.

Useful Questions to Ask the Interviewer
  1. Is the final user outcome binary, such as success or failure, or can it be a graded utility score?
  2. Do the logs contain the behavior policy probability for each chosen action?
  3. How different can the target policy be from the behavior policy that produced the logs?
For a generative agent that calls tools (search, code exec, and calendar), you need a single offline score that predicts user success. Do you model this as next action prediction with cross-entropy, or as sequence-level expected return, and how do you estimate it from logged trajectories with missing counterfactuals? diagram
How to Explain It in an Interview
1. Start with the agent interaction

I would first describe one complete user task. The user gives a goal, such as scheduling a meeting. The agent chooses an action, calls a tool, receives an observation, and updates its state. This loop repeats until the task finishes or a stop condition is reached. The final result is user success, failure, or another utility value.

2. Define the logged trajectory

The logged dataset contains complete episodes. Each episode records states, chosen actions, tool observations, intermediate rewards if available, and the final outcome. The behavior policy is the policy that produced these logs. We only observe outcomes for actions it actually selected. We do not observe results for actions it could have taken instead. The diagram also allows data from consented production logs, offline evaluation runs, and simulated users or environments.

3. Use sequence-level expected return as the score

The offline score should estimate expected return under the target policy. Expected return means the average final utility expected when that policy runs from the start. This matches the real goal because user success depends on the whole trajectory. Cross-entropy measures how well the model predicts logged actions at each step. That is useful as a training signal, but it is not a direct measure of user success.

4. Estimate the score with off-policy evaluation

Because another policy produced the logs, I would use off-policy evaluation, or OPE. OPE estimates a target policy using data collected by the behavior policy. Importance sampling weights logged trajectories using target-to-behavior policy probability ratios. Weighted importance sampling normalizes those weights to reduce variance. Doubly robust estimation combines importance weights with a learned reward or value model. These methods estimate policy value. They do not reconstruct each missing counterfactual outcome.

5. Handle policy mismatch and validate the score

The estimate becomes less reliable when the target policy chooses actions that the behavior policy rarely chose. Large probability ratios increase variance. If the target chooses actions never represented in the logs, those outcomes cannot be identified reliably from the logs alone. Clipping or normalizing weights can reduce variance, but it introduces a bias-versus-variance trade-off. Finally, I would rank policies by offline score and compare that ranking with online user success. I would also check Spearman or Pearson correlation across policies or checkpoints. Sanity checks should give weak policies low scores and strong baselines higher scores.

Practical Complexity & Trade-offs

The benefit is that sequence-level expected return matches the real goal: did the user succeed after the whole agent workflow? The downside is that the estimate becomes noisy when the new policy differs a lot from the policy that created the logs. Importance sampling can then create very large weights. Clipping or normalizing those weights can make the estimate more stable, but this can add bias. Doubly robust methods can reduce the problem by combining policy weights with a learned value model. We also need enough overlap in logged actions. If important target actions never appear in the logs, offline data alone cannot tell us their outcomes reliably.

Why Interviewers Ask This

The interviewer wants to see whether the candidate can separate a training objective from a real product success metric. They also want to test judgment about logged data, missing alternatives, and policy mismatch. A strong answer shows that the candidate understands why whole trajectories matter, why off-policy estimates have limits, and why an offline score must be checked against real user success instead of trusted automatically.

Interviewer may ask next
What would you do if the target policy often chooses actions that are rare or completely missing in the logged trajectories?

I would not trust the offline score without checking support first. Support means the logged behavior policy must have tried the kinds of actions that the target policy wants to choose. If the target policy gives high probability to actions that were almost never logged, importance ratios become very large. That makes the estimate unstable. If an action was never logged in that state, the data cannot reliably tell us its counterfactual outcome.

I would first measure how much the two policies overlap. For rare actions, I could use weighted importance sampling, clipping, or a doubly robust estimator to control variance. Those methods can help, but they do not create information that is missing from the logs.

If the overlap is too weak, I would collect safer online data with controlled exploration before trusting the score. The main downside is that stronger variance control can add bias, while collecting new data costs time and may require careful product safeguards.

How would you prove that the single offline score really predicts user success?

I would validate it against real outcomes from policies that were later tested online. First, I would compute the offline expected-return score for several candidate policies using the logged dataset. Then I would compare those scores with observed user success rates from controlled online tests or trusted held-out evaluations.

The most important check is ranking. If policy A receives a higher offline score than policy B, I want that ordering to usually match the real user results. I would also measure Spearman or Pearson correlation across several policies or checkpoints, as shown in the diagram.

I would add simple sanity checks. A random or clearly weak policy should receive a low score. A strong baseline should score higher. The score should also remain reasonably stable across different data subsets or random seeds.

The main downside is that historical validation only covers policies similar enough to the logged data. A large future policy change can still move outside that reliable region.

7. You are shipping a Gemini powered code review assistant for internal Google repos that can propose patches, but it must never leak proprietary code in logs and must be resilient to prompt injection in diffs and comments. Design the agent orchestration, sandboxing, telemetry, and evaluation plan, and define success metrics tied to developer productivity and safety.Ai Agents And Agentic SystemsHardGoogle Deepmind

Question Details

Define the bounded patch-proposal workflow, untrusted diff and comment handling, tool and repository permissions, sandbox execution, approval and stop conditions, redacted traces, recovery, and productivity, injection, and leakage evaluations.

Short Interview Answer (30-60 seconds)

At a high level, this is a bounded code-review workflow that helps developers without giving the model open-ended power. The main challenge is handling useful repository context while treating every diff and comment as untrusted. I would explain three flows: bounded agent orchestration, isolated tool execution, and human approval with safety checks. The controller limits tools, memory, and budgets. The sandbox has no network or repository writes. The trade-off is less automation, but much stronger safety.

Detailed Explanation

The system must help a developer review internal code and suggest a useful patch. The hard part is that the same diff or comment that contains useful code may also contain a malicious instruction. We must let Gemini understand that code without letting repository text control tools or policy. The diagram organizes the solution into bounded orchestration, isolated execution, developer approval, redacted telemetry, and explicit evaluation. This separates model suggestions from the deterministic code that controls permissions and side effects.

Useful Questions to Ask the Interviewer
  1. Should every proposed patch require developer approval before any repository change?
  2. What kinds of repository analysis must work without network access?
  3. Which safety failures should immediately stop the request?
You are shipping a Gemini powered code review assistant for internal Google repos that can propose patches, but it must never leak proprietary code in logs and must be resilient to prompt injection in diffs and comments. Design the agent orchestration, sandboxing, telemetry, and evaluation plan, and define success metrics tied to developer productivity and safety. diagram
How to Explain It in an Interview
1. Start with untrusted input

I would treat the diff and comments as data, not as instructions. The Trigger / Input stage receives both from the internal repository. The controller then parses and bounds that input. It normalizes the format, detects secrets or personal data, and builds the task. Text inside the diff cannot give itself tool or policy authority.

2. Keep orchestration deterministic and bounded

The Agent Orchestration component is the deterministic controller. This means normal application code controls the rules even when Gemini makes a probabilistic suggestion. It selects approved tools and enforces their policies and permissions. Bounded Memory keeps only limited state, and its TTL makes that state expire after a controlled time. Gemini proposes the patch, while the controller enforces policy.

3. Run tools inside Sandbox Execution

Tool execution happens inside an isolated runtime. The sandbox has no network access and no repository write permission. It also has CPU, memory, and time limits. These limits contain untrusted code and prevent one run from using resources forever. The normal sandbox is read-only, so it does not directly change the repository.

4. Require review and obey stop conditions

The Output & Approval stage returns a proposed patch, an explanation, and risk flags. A developer chooses Approve, Edit, or Reject. Human approval is required before changes. The workflow stops for high injection risk, a policy violation, unclear intent, an exceeded budget, a sandbox failure or timeout, or detected data-leakage risk. Otherwise, it can return the safe patch proposal.

5. Evaluate safety, productivity, and recovery

Telemetry uses Redacted Traces. It records task metadata, safety signals, and agent decisions, but not proprietary code. The Evaluation Plan measures productivity, adversarial diffs and comments, tool-policy violations, unauthorized instruction following, secret or personal-data exposure, redaction coverage, and data-exfiltration attempts. Success metrics include review time, reviews completed per engineer, patch acceptance, reviewer satisfaction, prompt-injection success rate, proprietary-code leakage incidents in logs, policy-block rate, patch quality, review cycles, and rework rate.

For recovery, safe transient failures can retry with bounded backoff. Side-effecting tool actions are idempotent where supported, which means repeating a safe retry should not accidentally apply the same effect twice. The system can fall back to read-only behavior and return a clear error. The trade-off is less automation, but much stronger control over sensitive internal code.

Practical Complexity & Trade-offs

The benefit is strong control over what the agent can do. Untrusted text cannot directly grant tool permission, and sandboxed work has no network or repository writes. Human approval also protects the final change. The downside is less automation. A developer must still review the proposal, so some time is added. Strict CPU, memory, and time limits may also stop expensive analysis. Redacted telemetry protects proprietary code, but it gives operators less raw debugging detail. We accept these limits because this assistant works with sensitive internal code, where a safety mistake can be much more costly than a slower review.

Why Interviewers Ask This

The interviewer wants to see whether you can control an agent instead of simply calling a model. They are testing how you separate model suggestions from real permissions, treat repository content as untrusted, limit tools and memory, contain execution, require approval, and recover safely. They also want to see whether you can measure both developer value and security failures with clear metrics.

Interviewer may ask next
What would you change if sandbox timeouts became common on very large code reviews?

I would keep the same safety boundaries, but I would change how the controller handles large tasks. The Sandbox Execution limits would still protect CPU, memory, and run time. I would not remove those limits just to make more requests finish.

The Agent Orchestration controller would reduce the amount of work it asks the sandbox to perform. It could choose a smaller approved analysis step or return a partial proposal rather than continuing after the budget is exhausted. If the failure is safely retryable, the existing recovery path allows a bounded retry with backoff. Bounded means the system tries only a limited number of times instead of looping forever.

If the sandbox still times out, the Stop Conditions path ends the run and returns a clear error or read-only result. Redacted Traces record the timeout and task metadata without storing proprietary code.

The downside is that some large reviews may receive less complete suggestions. The benefit is that one expensive request cannot consume unlimited resources or weaken the safety boundary.

How would you test whether the assistant is really resilient to prompt injection in diffs and comments?

I would test it with deliberately malicious diffs and comments before launch and during regular evaluation. For example, a comment could tell Gemini to ignore policy, reveal nearby code, or use a tool that the task does not need. The important result is not whether the model notices clever wording. The important result is whether the whole system still prevents an unauthorized action.

The Evaluation Plan already gives the main checks. I would measure prompt-injection success rate, unauthorized instruction-following rate, tool-policy violations, and false-positive or false-negative detection. I would also include data-exfiltration attempts because some attacks try to move proprietary data outside the allowed path.

The deterministic controller remains the final permission gate. A model suggestion does not grant access. The sandbox still has no network and no repository write permission. Redacted Traces record safety signals and decisions without recording proprietary code.

The downside is that adversarial testing takes ongoing effort because attacks change. That cost is necessary for a system that reads untrusted repository content.

8. Design a system that can handle real-time data streaming for an AI application.Ai System DesignEasyGoogle Deepmind

Question Details

Define event producers, ingestion, ordering and deduplication, stream processing, online AI consumption, storage, backpressure, observability, and degraded behavior under traffic or dependency failures.

Short Interview Answer (30-60 seconds)

At a high level, I would build a durable streaming path from event producers to the AI service. Mobile apps, sensors, clickstreams, and application logs send events into a stateless ingestion service. Events are partitioned by key, stored in a replicated distributed stream, and deduplicated before stream processors create features and aggregates. The AI service consumes fresh features for predictions and decisions. Durable stores keep raw data, processed data, features, and checkpoints. Backpressure and degraded modes protect the system during failures. The trade-off is greater operational complexity.

Detailed Explanation

The goal is to move new information into an AI application quickly and safely. Imagine a sensor sends a new temperature reading. We want that reading to reach the AI system soon, without losing it or unnecessarily processing the same event again. The system must also keep working when traffic suddenly grows or one dependency becomes unhealthy. I would follow the diagram from event creation, through processing, into AI consumption, then explain storage, flow control, monitoring, and failure handling.

Useful Questions to Ask the Interviewer
  • How much traffic should the system handle during normal and peak periods?
  • How quickly must new events affect AI predictions or decisions?
  • Which event types are most important during overload?
  • How long must raw and processed data be kept?
Design a system that can handle real-time data streaming for an AI application. diagram
How to Explain It in an Interview
1. Start with event producers and ingestion

I would begin with the systems that create events. The diagram shows mobile apps, IoT sensors, web clickstreams, and application logs. These producers send events toward the ingestion layer.

A load balancer spreads incoming traffic across a stateless stream ingestion service. Stateless means an ingestion instance does not depend on private session state from an earlier request. The ingestion service validates the event schema, authenticates the sender, adds metadata, and chooses a partition key. This lets the ingestion layer scale horizontally when traffic grows.

2. Keep related events ordered and remove duplicates

The ingestion service writes events into a distributed log or stream. The stream is partitioned by key. Related events using the same key can therefore preserve their required order within that partition. The stream also replicates data for durability.

The deduplication service keeps a temporary state of seen event identifiers, keys, and timestamps. A TTL, or time-to-live, limits how long that state is retained. When a matching event appears again inside that window, the system can identify it as a duplicate. This helps reduce repeated processing caused by retries or repeated delivery.

3. Process the stream in real time

Next, a stream processing engine consumes the ordered stream. It performs windowing, aggregations, feature engineering, enrichment, and anomaly detection. Windowing means grouping events over a recent time range, such as one minute.

The processor can also run model inference when that fits the workload. It keeps operator state and checkpoints for fault tolerance. A checkpoint is a saved copy of processing state that helps work resume after a restart. The diagram stores this state separately instead of relying only on process memory.

4. Feed the online AI service

Processed information then flows into the AI service or model gateway. This layer produces real-time predictions, recommendations, alerts, or decisions. The important idea is that the AI service consumes prepared streaming data rather than reading every raw event directly.

The resulting output can flow to applications and dashboards, alerts and notifications, or APIs and webhooks. This keeps online AI consumption separate from ingestion and stream transformation responsibilities.

5. Store data for replay, analytics, features, and recovery

The design keeps several kinds of storage because they serve different needs. Immutable raw events go to object storage or a data lake. This supports replay and compliance. Clean processed data goes to a processed store for analytics and machine learning work.

A feature store keeps low-latency values for online inference and also supports offline use. Stream processor state and checkpoints are kept in a separate state store. These storage paths support the main stream without replacing its real-time data flow.

6. Apply backpressure and degrade safely

The system watches stream lag and queue depth. These signals show when consumers are falling behind. It can auto-scale consumers, throttle producers, or apply sampling. Bad events can move to a dead-letter queue instead of blocking healthy work.

During traffic spikes, the system can shed load and prioritize critical streams. During dependency failures, it can queue and retry work, open a circuit breaker, or use the fallback model shown in the diagram. During a partial outage, it can continue ingesting and buffering data, then replay buffered work after recovery.

7. Observe the system and explain the trade-off

I would monitor throughput, latency, lag, and error rate. I would also collect centralized logs, end-to-end traces, dashboards, alerts, and data-quality signals. Data-quality checks include missing values, schema drift, and anomalies.

The main trade-off is operational complexity. Partitioning, deduplication state, checkpoints, several storage systems, scaling rules, and recovery paths all need careful operation. We accept that cost because the design improves durability, data freshness, fault recovery, and control during overload.

Practical Complexity & Trade-offs

The benefit of this design is that each part has one clear job. Ingestion handles high traffic. Partitioning keeps related events together and supports ordering. Deduplication reduces repeated processing. Stream processors create useful features, while the AI service focuses on online predictions and decisions. Separate stores support replay, analytics, features, and processor recovery. The downside is more moving parts. We must operate the stream, temporary deduplication state, checkpoints, scaling rules, and monitoring together. Backpressure is important because faster producers can overwhelm slower consumers. Throttling or sampling protects the system, but it may delay or drop less important work. Fallback behavior can improve availability, but a fallback model may reduce result quality. We accept these trade-offs to keep the system responsive and recoverable.

Why Interviewers Ask This

Interviewers use this question to test whether you can connect streaming and AI serving into one clear design. They want to see whether you understand event ordering, duplicate handling, stateful processing, online features, storage, overload control, and recovery. They also look for engineering judgment. A strong answer explains which component owns each job, how data moves through the system, what happens during failures, and which trade-offs are accepted to improve reliability and latency.

Interviewer may ask next
What would you change if event traffic suddenly increased by ten times?

I would keep the same architecture and scale the parts that are under pressure. The first signals would come from observability, especially stream lag, queue depth, throughput, latency, and error rate. I would add more stateless ingestion instances behind the load balancer. I would also scale stream-processing consumers when the partitioning scheme provides enough parallel work.

If consumers still cannot keep up, the backpressure controls would protect the system. They can throttle producers or apply sampling to less important events. Critical streams should keep priority. Bad events should continue going to the dead-letter queue instead of blocking healthy work.

Correctness still depends on preserving the partition key for related events and maintaining the deduplication state. I would not randomly repartition related events in a way that breaks their required order. The main downside is cost and operational complexity. More consumers and partitions increase capacity, but they also increase state management, checkpoint work, and recovery coordination.

How would the system behave if the AI service or another dependency became temporarily unavailable?

I would avoid stopping the whole streaming pipeline because one dependency is unavailable. The affected flow can queue and retry work as shown in the degraded-behavior path. A circuit breaker can stop repeated calls to an unhealthy dependency. This prevents one failure from creating more pressure on that dependency.

During a partial outage, ingestion can continue accepting and buffering durable events. The distributed stream keeps those events available while downstream work is delayed. Stream processors can use stored state and checkpoints when they recover. If the online AI path can use the fallback model shown in the diagram, it can provide that fallback for suitable work. Otherwise, the system should avoid presenting unavailable results as fresh predictions.

After recovery, consumers can replay buffered events and catch up from stored progress. Observability should alert operators about growing lag, errors, and dependency health. The main downside is delayed results and potentially lower-quality output while a fallback model is being used.

9. Design a GCP pipeline to ingest DeepMind training telemetry events (step, loss, throughput, GPU memory) at 200k events/sec with 60-second freshness into BigQuery for dashboards and alerting. Specify Pub/Sub, Dataflow, BigQuery partitioning and clustering, and how you handle late events and duplicates.Ai System DesignMediumGoogle Deepmind

Question Details

Make the event schema, throughput and freshness budgets, partition and cluster keys, event-time processing, deduplication identity, late-data policy, alert path, and failure recovery explicit.

Short Interview Answer (30-60 seconds)

At a high level, I would build a streaming pipeline that moves DeepMind training telemetry into BigQuery within a P99 freshness target of 60 seconds. Training jobs send about 200,000 events per second to Pub/Sub. Streaming Dataflow validates events, uses event time, removes duplicates, handles late data, and writes through the BigQuery Storage Write API. BigQuery partitions by event_time and clusters by job_id, metric_type, and gpu_id. Dashboards query BigQuery, while Cloud Monitoring handles alerts. The main trade-off is keeping enough state for deduplication and late events without adding too much cost or delay.

Detailed Explanation

We need to collect measurements from many training jobs very quickly. Each job reports values such as its current step, loss, speed, and GPU memory. About 200,000 events arrive every second. The newest information should be ready for dashboards and alerts within about 60 seconds at P99. We also need to avoid storing the same event twice. Some events can arrive late, and some can be invalid. I would follow the data from the training jobs, through processing, into the final analytics store.

Useful Questions to Ask the Interviewer
  • Is the 60-second freshness target measured at P99, as shown in the design?
  • How long should very late telemetry remain available for analysis?
  • Is event_id always present, or must the fallback deduplication identity be supported?
Design a GCP pipeline to ingest DeepMind training telemetry events (step, loss, throughput, GPU memory) at 200k events/sec with 60-second freshness into BigQuery for dashboards and alerting. Specify Pub/Sub, Dataflow, BigQuery partitioning and clustering, and how you handle late events and duplicates. diagram
How to Explain It in an Interview
1. Start with the telemetry producers

The DeepMind training jobs produce the telemetry events. A typical event contains event_id, event_time, ingest_time, job_id, gpu_id, step, loss, throughput_samples_per_sec, gpu_memory_gb, host, and region. The jobs together generate about 200,000 events each second. They push these events toward Pub/Sub using the formats and transport shown in the diagram. The most important time field is event_time. It means when the measurement happened inside the training job. This lets Dataflow reason correctly about delayed events.

2. Put Pub/Sub in front of the processing layer

The jobs publish to the training-telemetry Pub/Sub topic. Pub/Sub separates the producers from Dataflow and absorbs traffic bursts. Delivery is at least once, so the same message can appear again. That is why duplicate handling is required later. Pub/Sub is global. A message storage policy can optionally restrict where message data is stored. The design keeps messages for seven days. This retention gives the system time to recover or replay data after a downstream failure.

3. Process the stream with Dataflow

Streaming Dataflow pulls events from Pub/Sub. It parses each event and validates the schema first. Invalid or poison events go to the training-telemetry-dlq dead-letter topic for manual handling or replay. Valid events continue through the normal path. Dataflow extracts event_time and processes events in ten-second event-time windows. The design allows ten minutes of lateness and uses triggers every ten seconds. Workers autoscale as load changes. These choices support the P99 freshness target of 60 seconds while still accepting delayed telemetry.

4. Deduplicate and handle late events

The preferred unique identity is event_id. If it is missing, the fallback identity is job_id, gpu_id, step, metric_type, and event_time. Dataflow keeps deduplication state through the watermark plus the allowed-lateness horizon. A watermark is Dataflow's estimate of how far event-time processing has progressed. The first copy of an event is kept, and later duplicates are dropped. Events arriving within ten minutes can update the main result using the deduplication key with an idempotent MERGE. Events arriving more than ten minutes late go to the separate telemetry_late_events table for later analysis.

5. Store analytics data in BigQuery

Dataflow writes the main stream through the BigQuery Storage Write API exactly-once mode shown in the diagram. The destination is the training_telemetry table in the telemetry dataset. The table uses time partitioning by event_time, with ingestion time shown only as a fallback. Partitioning reduces how much data time-based queries need to scan. The table clusters by job_id, metric_type, and gpu_id. Clustering keeps similar rows close together and helps common dashboard and investigation queries.

6. Serve dashboards, alerts, and recovery

Looker Studio, Looker, and SQL queries read the BigQuery data for dashboards. Cloud Monitoring handles alerts based on queries. Dataflow also sends operational metrics such as lag, watermark, throughput, error rate, and worker health into the monitoring path. Notifications can go to email, chat, or PagerDuty. If processing fails, Pub/Sub can redeliver messages, while Dataflow uses autoscaling and checkpoints. Poison events remain in the dead-letter topic for manual replay. The seven-day Pub/Sub retention also supports backfills filtered by event_time or job_id. This gives the design a clear recovery path without changing the normal streaming flow.

Practical Complexity & Trade-offs

The benefit of this design is that every service has a clear job. Pub/Sub absorbs bursts and keeps messages for recovery. Dataflow handles event time, duplicates, late arrivals, validation, and scaling. BigQuery is organized for fast time-based analysis. The downside is that duplicate detection and late-event handling require state inside Dataflow. Keeping that state longer uses more memory and can increase cost. A longer allowed-lateness window accepts more delayed data, but it also keeps processing state longer. The separate late-events table avoids holding the main path open forever. BigQuery partitioning reduces scanned data, while clustering helps common filters. We accept the extra state and storage because the system needs high throughput, low freshness delay, replay support, and clean analytical data.

Why Interviewers Ask This

This question tests whether a candidate can turn streaming requirements into a practical GCP design. The interviewer wants clear judgment about throughput, freshness, event time, duplicates, late data, and recovery. They also want to see whether the candidate gives Pub/Sub, Dataflow, BigQuery, dashboards, and monitoring the correct responsibilities. A strong answer explains partitioning and clustering choices, failure handling, and realistic trade-offs instead of only listing managed services.

Interviewer may ask next
What would you change if traffic suddenly doubled from 200,000 to 400,000 events per second?

I would keep the same architecture and scale the existing streaming path. Pub/Sub would remain the ingestion buffer because it separates producer traffic from Dataflow processing. The main component I would watch is Dataflow. I would check autoscaling limits, worker capacity, Pub/Sub backlog, processing lag, watermark delay, error rate, and BigQuery write throughput. The key success check is whether P99 freshness still stays within 60 seconds. If lag grows, I would increase available Dataflow processing capacity before changing the data model. Deduplication, the ten-minute allowed-lateness rule, the dead-letter path, and the event-time logic would stay the same. BigQuery would also keep event_time partitioning and clustering by job_id, metric_type, and gpu_id. This preserves correctness while load grows. The downside is higher Dataflow and BigQuery cost during the traffic spike. The benefit is that scaling does not require a different data path or a new consistency model.

How would you handle an event that arrives more than ten minutes late?

I would route it to the separate telemetry_late_events table shown in the design instead of treating it as normal fresh telemetry. Dataflow owns this decision because it performs event-time processing and applies the ten-minute allowed-lateness rule. Events that arrive inside the allowed window can update the main result using the deduplication key with an idempotent MERGE. Once an event is more than ten minutes late, it goes to the side table for later analysis. I would preserve its normal identity fields so later replay or investigation can still reason about duplicates. The main training_telemetry table therefore keeps a predictable freshness contract for dashboards and alerts. Historical investigations can include telemetry_late_events when needed. The downside is that analysts may need to look at two tables when studying old data. The benefit is bounded Dataflow state and a clear separation between fresh operational telemetry and unusually delayed events.

10. Design a multi-tenant feature and training data platform on GCP for several DeepMind research teams, where each team needs isolated access but shared infrastructure, and training jobs read 10 TB/day with both batch backfills and incremental updates. Describe your approach to storage (GCS, BigQuery), compute (Dataflow, Spark), governance (IAM, row-level security), and how you prevent one tenant from degrading others.Ai System DesignHardGoogle Deepmind

Question Details

Specify tenant identity and data boundaries, shared storage and compute layout, batch and incremental publication, quotas and scheduling, noisy-neighbor controls, lineage, recovery, and proof of access isolation at 10 TB/day.

Short Interview Answer (30-60 seconds)

At a high level, I would build one shared GCP data platform with strong tenant boundaries. Each research team gets its own identity, service accounts, data paths, quotas, and access rules. Dataflow handles streaming updates, while Dataproc Spark handles large batch backfills. GCS stores raw and curated data, and BigQuery provides tenant datasets with row-level security. Training jobs read from GCS or BigQuery. Fair scheduling, reservations, quotas, monitoring, and auto-throttling stop one team from consuming shared capacity. The trade-off is more governance complexity, but we gain better infrastructure sharing and cost efficiency.

Detailed Explanation

We need one shared data system for several research teams. Each team must see only its own information. At the same time, teams should share the expensive platform underneath. The system must handle large daily reads and two kinds of work. New information should arrive continuously. Older information must also be rebuilt when needed. We must also stop one busy team from slowing everyone else. The diagram solves this by separating team access, processing, storage, training, and shared capacity controls. It also tracks data history, access, reliability, and recovery.

Useful Questions to Ask the Interviewer
  • Are the 10 TB/day reads spread across teams or concentrated in a few teams?
  • How quickly must incremental updates become available for training?
  • Can teams temporarily use spare shared capacity when other teams are idle?
Design a multi-tenant feature and training data platform on GCP for several DeepMind research teams, where each team needs isolated access but shared infrastructure, and training jobs read 10 TB/day with both batch backfills and incremental updates. Describe your approach to storage (GCS, BigQuery), compute (Dataflow, Spark), governance (IAM, row-level security), and how you prevent one tenant from degrading others. diagram
How to Explain It in an Interview
1. Start with tenant identity and access

I would first give every research team a clear tenant identity. Team members enter through Google Identity and SSO. Group-based access decides which team they belong to. Workloads use separate service accounts for each tenant.

IAM gives each identity only the permissions it needs. VPC Service Controls add a service boundary around protected GCP resources. The management project keeps the tenant registry, policies, quotas, scheduling rules, monitoring, and alerts.

This gives us one shared platform without giving every tenant access everywhere.

2. Ingest data and choose the right processing path

Data can arrive from upstream systems, Pub/Sub event streams, or file and log uploads. Incremental data goes through Dataflow streaming pipelines. Dataflow parses, validates, and enriches records. It also handles windowing, deduplication, and the exactly-once sinks shown in the design.

Large backfills use Dataproc with Spark. These batch pipelines handle large transforms, reprocessing, and feature computation. Streaming and backfill jobs are separated because their workload patterns are different.

Both paths publish data into the shared storage layer.

3. Keep tenant data separated in GCS and BigQuery

GCS is the durable storage layer. Raw paths include the tenant identifier and keep data immutable and versioned. Curated feature paths also include the tenant identifier. Columnar formats such as Parquet or ORC make large analytical reads efficient.

BigQuery provides the query layer. The design uses datasets per tenant and row-level security on tenant-aware data. Authorized views expose only permitted information when controlled sharing is needed.

The key isolation rule is simple. Team A must not be able to list or read Team B data.

4. Serve training and analytics workloads

Training jobs run in Vertex AI using custom containers. They read training data from BigQuery or GCS through the connectors shown in the diagram. Training checkpoints are written back to GCS.

Researchers also use BigQuery for ad-hoc analysis. Per-tenant views and row-level security continue to apply on that path.

At about 10 TB/day, the design scales horizontally. Dataflow and Dataproc add parallel workers. BigQuery uses autoscaling slots and reservations. GCS remains the durable source of truth.

5. Prevent noisy neighbors

Every tenant gets quotas for shared services such as GCS, BigQuery, Dataflow, Dataproc, and Vertex AI. The scheduler applies priorities, fair-share rules, and burst limits.

BigQuery reservations provide committed capacity where needed. Compute pools can autoscale. Workload monitoring watches tenant usage. Auto-throttling can reduce a tenant's resource use when it threatens shared service health.

These controls stop one large backfill from starving another team's training job.

6. Add governance, lineage, proof, and recovery

IAM enforces least privilege. BigQuery also uses row-level and column-level security. CMEK provides customer-managed encryption keys. Cloud Audit Logs record data access.

Data Catalog and Dataplex track metadata and lineage. Data quality checks validate published data. Cloud Monitoring, logging, tracing, alerts, and per-tenant SLOs show platform health. Cost management attributes platform usage per tenant.

For recovery, GCS versioning protects stored objects, and the design includes cross-region recovery. Separate service accounts and quotas strengthen tenant boundaries. Audit logs provide evidence of who accessed what and when.

Practical Complexity & Trade-offs

The benefit of this design is that teams share one platform while keeping clear data and capacity boundaries. GCS gives durable storage for large files. BigQuery gives analytical access with tenant datasets, row-level security, column-level controls, and authorized views. Dataflow is a good fit for continuous updates. Spark on Dataproc is better for large backfills and reprocessing. The downside is operational complexity. Quotas, reservations, policies, service accounts, encryption keys, and monitoring all need careful management. Dedicated capacity can protect important jobs, but unused reserved capacity may cost more. Shared capacity improves resource use, but it needs fair scheduling and burst limits. We accept this extra control-plane work because tenant isolation and predictable performance matter more than having the simplest possible platform.

Why Interviewers Ask This

The interviewer is testing whether the candidate can share expensive infrastructure without weakening tenant isolation. They want to see good judgment around GCS, BigQuery, Dataflow, Spark, identity, and access control. They also want a clear answer for noisy-neighbor problems at large data volume. Strong candidates explain data boundaries, quotas, scheduling, lineage, recovery, audit evidence, and realistic trade-offs instead of only listing GCP products.

Interviewer may ask next
What would you change if one tenant starts a very large backfill and begins consuming most shared compute capacity?

I would keep the same architecture and tighten the controls already shown in the isolation and fairness layer. The scheduler would apply tenant priorities, fair-share scheduling, and burst limits before giving that backfill more capacity. Dataproc remains subject to that tenant's quota. BigQuery work stays inside its reservation and quota rules. Dataflow, GCS, and Vertex AI also keep their tenant limits.

Monitoring would detect unusual resource use. Auto-throttling could then reduce the noisy tenant's consumption before other teams lose their expected capacity. Important workloads can continue using committed or reserved capacity where the design provides it.

Correctness does not change. The backfill still reads and writes the same tenant-specific GCS paths and BigQuery data. IAM, service accounts, row-level security, and VPC Service Controls continue to enforce access boundaries.

The downside is that the backfill may finish more slowly. Reserved capacity can also be less efficient when demand is low. I would accept that because predictable shared-platform performance matters more than letting one tenant finish as quickly as possible.

How would you prove that Team A cannot access Team B's training data?

I would prove isolation at several layers instead of relying on one permission check. Team A uses its own Google group and tenant service accounts. IAM gives those identities only the permissions needed for Team A resources. GCS paths include the tenant identifier, so access controls keep Team A away from Team B objects.

In BigQuery, tenant datasets and row-level security restrict which data a caller can read. Authorized views expose only explicitly permitted information. Column-level security can further protect sensitive fields. VPC Service Controls add another service boundary around protected resources.

I would then test the negative case. A Team A identity should fail when it tries to list or read Team B data. Cloud Audit Logs provide evidence of attempted and successful access. Separate service accounts make the caller easy to identify.

The downside is more policy management and testing. Policies become harder to operate as tenant count grows. The benefit is defense in depth, meaning several independent controls protect the tenant boundary.

More questions load as you scroll

Disclaimer: This interview guide is for educational and informational purposes only. It is designed to help readers prepare, but it does not guarantee any interview result, hiring decision, offer, or outcome. Interview questions, hiring criteria, and preferred answers can vary by employer, interviewer, industry, location, and time. The examples and explanations reflect the authors' research and judgment, are provided without warranties of any kind, and should not be treated as the only correct approach. Diagrams are simplified illustrations intended to highlight the main components and their interactions; actual systems and implementations may be more complex. Alternative approaches may be equally valid or better suited to a particular question, context, or interviewer. To the fullest extent permitted by applicable law, the author, contributors, and publisher are not liable for decisions made, actions taken, or losses incurred based on this guide.

Company Notice: This guide is an independent educational resource and is not affiliated with, endorsed by, sponsored by, or approved by the company named in this guide. Company names are used only to identify interview experiences commonly reported by candidates. Interview practices can change without notice, and inclusion of company-specific content does not mean these questions are official, complete, or guaranteed to be asked. To the fullest extent permitted by law, the author, contributors, and publisher are not responsible for outcomes related to use of this material.