Interview Practice

Live Coding

Implement a small, testable piece of an AI application against fixtures.

What interviewers evaluate

  • Clarifying the contract
  • Writing or running fixture tests
  • Handling edge cases
  • Narrating failure modes

What you will be asked

Write a small validator for structured model output, with tests.

In the room

You get a JSON contract and a few model outputs, write a pure function that accepts or rejects each one, and talk through edge cases while you code.

Timebox

45-60 minutes

Mock interview

A timed answer to a random question from this level, then the reference answer and your score.

Start a mock interview

How to practice

  • Start with the linked Easy exercise: read the contract, write the tests first, then the function. Try the Medium exercise as a stretch: it adds a source check and a recovery plan.
  • Keep the function pure: no network calls, no clocks, and no randomness.
  • With a peer: they answer contract questions and add one surprise input at the end.

What a strong answer shows

  • Restates the contract and asks about unclear cases before coding
  • Writes tests for valid, invalid, and edge-case inputs
  • Returns clear error codes instead of crashing on bad model output
  • Explains what the validator cannot prove

Questions for this level

Each question opens on its Practice tab, and Previous and Next follow this list.

Prompting & Structured Output

Easy
Hands-on

1.5 h

Write a pure function that accepts a model's JSON review summary or returns every contract violation as a stable error code, predict its result for eight replies, and say what a valid summary still cannot prove.

Prompting & Structured Output

Medium
Hands-on

3 h

Implement a dependency-free validator for a ticket contract, classify each fixture failure by layer, and design a two-attempt recovery that never commits invalid output.

Follow-up questions

An interviewer may ask these next.

  • How do you handle a field the contract does not mention?
  • What should happen when the output is not valid JSON?
  • Would you ask the model again after a failed validation? How many times?
  • How do you keep the tests readable as the contract grows?

Scoring rubric

Interview ready at 8 of 10 with no 0.

Dimension012
Problem framingJumps to a solution or solves the wrong problemRestates the problem but misses key constraints or success criteriaClarifies goals, constraints, and success criteria before solving
CorrectnessKey claims or code are wrongMostly right with gaps or unhandled casesCorrect and precise, including edge cases
Evidence or testingNo way to verify the answerGeneric testing ideasConcrete fixtures, metrics, or traces that would confirm or refute the approach
Trade-offsOne option, no alternativesNames alternatives superficiallyCompares options against the stated constraints and says what would change the decision
CommunicationDisorganized or unclearUnderstandable but meanderingStructured and concise; states assumptions; checks in with the interviewer