productinterview.tools
MenuClose

The LLM Feature Works Locally but Fails in Production

The interviewer asksYour AI feature works perfectly in your tests, but in production about 5% of requests return broken results. How do you debug it?

AI Product EngineerForward Deployed EngineerCoreBuild roundRepresentative7 min

On this page
  1. The 30-second version
  2. What it's really testing
  3. How to structure your answer
  4. The interview, played out
  5. The strong answer, distilled
  6. How it's scored
  7. How the answer changes by role
  8. Common mistakes
  9. More follow-ups to practise
  10. Go deeper
  11. Sources

The 30-second version

  1. Get examples: logged request, raw response, and what "broken" means.
  2. Compare production inputs with test inputs: length, language, special characters.
  3. Check the boring causes: timeouts, token limits truncating output, rate limits, malformed output.
  4. Reproduce with the exact logged request, several times.
  5. Fix: input limits, output validation with retry, and add the cases to tests.

Watch it played outSee the strong answerHow it's scored

What it's really testing

  • Debugging LLM integrations
  • Production vs test differences
  • Defensive fixes

How to structure your answer

  1. Examples.
  2. Compare inputs.
  3. Boring causes.
  4. Reproduce.
  5. Fix.

The interview, played out

A written example interview, not a real candidate or company transcript.Strong moveRevealed when asked
  1. Interviewer
    Your AI feature works in tests, but 5% of production requests return broken results. How do you debug it?
  2. Candidate
    What does broken look like? And can I see the logged requests and raw responses for some failures?
  3. Revealed when asked
    Broken means the output JSON can't be parsed. Failing requests have much longer inputs than test cases.
  4. Strong move
    Looks for what differs between failing and passing inputs.
  5. Candidate
    Long inputs suggest the output is being cut off: the model hits the maximum output tokens mid-JSON, or the whole request is near the context limit. I'd check the finish reason on those responses.
  6. Revealed when asked
    They stop because of the output token limit.
  7. Candidate
    Fix: raise the output limit where needed, ask for more compact output, validate the JSON and retry once with a stricter instruction, and add long inputs to our tests.

The strong answer, distilled

  • Examples: parse failures on long inputs.
  • Compare: production inputs far longer than tests.
  • Boring cause: output token limit truncates JSON.
  • Confirm: finish reason on failing responses.
  • Fix: higher limits, compact output, validation with retry, long-input tests.

This is one strong answer, not the only one.

How it's scored

Dimension Weak (2) Passable (3) Strong (5)
Evidence Guess Logs Failing vs passing comparison
Cause Model randomness Formatting Truncation confirmed
Fix Retry everything Raise limit Limits, validation, tests

Round scorecard: FDE: technical and build round, filled in for the mock candidate

DimensionWeakPassableStrongThe mock candidate
ClarifyingStarts coding immediately.Asks a few questions.Pins down the goal, inputs and what done means first.Strong. Asked what "broken" looks like.
ApproachUnworkable or over-built.Workable.The simplest approach that works, stated before building.Strong. Compared production inputs with test inputs.
TestingTries one happy-path input.Tries a few inputs.Tests varied and bad inputs, and checks outputs systematically.Strong. Reproduced failures with logged requests.
Trade-offsNone mentioned.Some.Says what was cut, why, and what comes next.Strong. Fixed with validation and limits.

How the answer changes by role

Role What to emphasise
AI Product Engineer Logging and fixes
Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation Debugging on customer data

Common mistakes

  • Blaming randomness
  • Not logging raw responses
  • Tests that don't match production inputs

More follow-ups to practise

  • "Failures are random, not tied to length." Hint: repeat runs; temperature; structured output.
  • "The provider is rate-limiting." Hint: backoff and queueing.

Go deeper

Sources

Representative question: written to match build rounds for AI product roles, not a specific reported interview.