Skip to content

Interview question · Model API Foundations

A model reply comes back with empty content and no error. What do you check before calling it a blank answer?

The first screening question about model calls. A strong answer names the four fields a response carries, reads the stop reason before the text, and explains why a blank content field is more often a tool request than a blank answer.

easyEssentialNewUpdated Nov 2026

TL;DR: Read the stop reason first, then the tool-call field, then usage. Empty content with a stop reason of tool_calls is the model asking for a tool, not saying nothing; the harness dispatches the calls. Empty content with stop is a real empty answer and worth a retry or an escalation. Empty content with length means the output allowance was zero or tiny. A refusal or filter flag is its own case. A harness that checks if content: before anything else has three bugs, not one.

How to approach it

Say what a response actually contains before saying what you would do. It is a record with four parts: content (text, tool calls, or both), a stop reason, usage, and sometimes a refusal or filter signal. Then walk the stop reasons in order, because each one gives a different meaning to "content is empty". Ask one clarifying question if the interviewer leaves room: which provider, because the field names differ and some leave content null rather than empty.

A strong answer

Start with the branch the loop should take, keyed on the stop reason:

Stop reasonWhat empty content meansWhat the harness does
tool_calls (or tool_use)The model asked for tools and wrote no prose beside the request, which is normalValidate and dispatch each call, append results under their ids, loop
stop (or end_turn)A real empty answerTreat as a failed step: retry once with the same context, then escalate with the reason
length (or max_tokens)The output allowance was exhausted before any visible text, often because max_tokens was tiny or a reasoning model spent it allRetry with a larger allowance, or shorten the context; never return it as an answer
content_filter or a refusal blockThe provider or model declinedRecord it, do not retry blindly, route to a person if the task needs one

Then say why the check order matters. The commonest bug in a first harness is if not reply.content: return "". On a tool turn that line turns a correct tool request into a blank answer, so the agent appears to give up at exactly the moment it was about to do something useful. In a trace it shows up as a run that ends after one model call with an empty final message and no tool spans.

Show the normaliser you would put at the boundary, because providers spell everything differently:

STOP = {"stop": "stop", "end_turn": "stop", "tool_calls": "tool_calls",
        "tool_use": "tool_calls", "length": "length", "max_tokens": "length",
        "content_filter": "filtered"}

def classify(reply):
    stop = STOP[reply["stop_reason"]]
    calls = reply.get("tool_calls") or []
    text = reply.get("content") or ""           # None on many tool turns
    if stop == "tool_calls" and calls:
        return "dispatch"
    if stop == "length":
        return "incomplete"
    if stop == "filtered":
        return "declined"
    return "answer" if text.strip() else "empty_answer"

print(classify({"content": None, "stop_reason": "tool_calls",
                "tool_calls": [{"id": "c1", "name": "orders_get"}]}))  # => dispatch
print(classify({"content": "", "stop_reason": "end_turn"}))  # => empty_answer
print(classify({"content": "", "stop_reason": "max_tokens"}))  # => incomplete

Close with usage. Even a blank reply carries token counts, and they tell you something: an input count near the window with a length stop says the context left no room for output, which is a context-management problem (The Context Window as a Budget), not a model problem.

What interviewers probe next

"The stop reason says tool_calls but the tool-calls field is empty too. Now what?" Treat it as a malformed response: log the raw body, retry the call once, and if it repeats, fail the step with a reason. Never guess a tool from the context.

"Why not just retry any empty reply?" Because a tool request is not a failure, and retrying it wastes a turn and the whole rereading cost of the context, and may get a different proposal back. Branch on the stop reason first; retry only the cases where retrying can help.

"Where does this check live?" In the adapter that normalises the provider's response into one shape, so the loop only ever sees four stop values and never a provider's spelling (One Loop, Many Providers).

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A support agent's trace shows runs that end after a single model call with an empty final answer. Customers see a blank reply. The tool spans that should follow are missing.

  1. Start here

    What is the first field you read in those responses?

How it's scored

Weak: Says the model "didn't answer" and proposes a retry or a stronger prompt, without mentioning the stop reason or the tool-call field.

Hire: Names the four fields, branches on the stop reason, explains that empty content on a tool turn is normal, and distinguishes the length case.

Strong Hire: Does all that, places the check in a provider-normalising adapter, reads usage as diagnostic data, bounds the retry, and describes what the trace of this bug looks like.

Common mistakes

  • Testing content before the stop reason, which turns every tool request into a blank answer.
  • Treating null and "" differently when both mean the model wrote no prose.
  • Retrying a tool-call turn as if it had failed, wasting a turn and the context rereading cost.
  • Repairing or returning a length-stopped reply as if it were complete.
  • Ignoring usage, so a context-full failure is misdiagnosed as a model problem.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.