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.
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
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
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.
| Dimension | 0 | 1 | 2 |
|---|---|---|---|
| Problem framing | Jumps to a solution or solves the wrong problem | Restates the problem but misses key constraints or success criteria | Clarifies goals, constraints, and success criteria before solving |
| Correctness | Key claims or code are wrong | Mostly right with gaps or unhandled cases | Correct and precise, including edge cases |
| Evidence or testing | No way to verify the answer | Generic testing ideas | Concrete fixtures, metrics, or traces that would confirm or refute the approach |
| Trade-offs | One option, no alternatives | Names alternatives superficially | Compares options against the stated constraints and says what would change the decision |
| Communication | Disorganized or unclear | Understandable but meandering | Structured and concise; states assumptions; checks in with the interviewer |
