Tools Interview Questions (2026)

Covers structured outputs — forcing a model's response into a schema. See also all interview topics. These assume you already know the concept — if this is unfamiliar, read the full concept page first; the questions test judgment on top of the concept, not the concept itself.

Structured Outputs

Full concept page →

Your classifier returns a schema-valid response — the right JSON shape, a category from your allowed list. Your team concludes the output must be correct. What's wrong with that conclusion?

Schema enforcement guarantees shape and, for a closed set of values, that only allowed values can appear — it says nothing about whether the specific value is right for this input. A perfectly valid, schema-conforming response can still name the wrong category. Enforcement fixes formatting reliability, not correctness.

Your prompt says "respond only with valid JSON matching this shape," and it works fine in testing. Is that equivalent to real structured output enforcement?

No. A prompt instruction is a request the model can still drift from, especially as a response gets longer or more complex — testing looking fine doesn't mean it holds under every input. Real enforcement blocks invalid tokens during generation itself, so the response mechanically cannot leave the schema. One relies on the model complying; the other doesn't give it the option.

You're deciding whether a plain conversational reply to a user needs a defined schema. Does it?

Usually not. Schema enforcement earns its cost when something downstream — code, a database, another system — has to parse the response without a person reading it first. A reply meant to be read directly by a user gains nothing from being forced into a rigid shape; the constraint is solving a problem that reply doesn't have.

A model calls a tool with arguments that don't match the tool's declared parameters. How is that possible if structured output enforcement is working?

It usually means the arguments weren't actually schema-enforced at generation time — the model was asked to format them correctly rather than mechanically restricted to a valid shape. Tool call arguments are themselves structured output; when real enforcement is in place, an argument outside the tool's schema isn't something the model can produce in the first place, not something your code has to catch afterward.