AI Interviews · Question

Take-home variant: build an LLM judge that scores faithfulness and relevance, then calibrate it against human labels on 30 labeled pairs.

Take-home question reported at Applied-AI loops (no single company) (2026). Sources, confidence and an answer card.

Researched · updated

eng-040 AI Engineer Evaluation Take-home Low confidence
On this page

What they’re really asking

If you only remember one thing, say this in the first minute: “I’ll build two small pass/fail judges, one for faithfulness and one for relevance, because they are different failures. I’ll tune them on half the labelled pairs and report on the other half. For each judge I’ll report how many real failures it catches, how many good answers it wrongly fails, and an agreement score that corrects for luck, all with intervals. And I’ll say plainly that 30 labels make the judge promising, not proven.”

The rest of this page explains each part of that answer.

Words you need first

A large language model (LLM) reads text and writes text. Many products first look up documents that might help and paste them into the LLM’s input (the prompt). Those pasted documents are the retrieved context.

An LLM judge is a second LLM call that grades the first one’s answer against written rules, the rubric. A human label is the grade a person gave the same answer.

The take-home asks you to grade two things:

  • Faithfulness: does the answer stick to the retrieved context, or does it claim things the context doesn’t support?
  • Relevance: does the answer address the question that was asked?

Why this isn’t a normal test

In normal code you test against an exact expected value, and the test is trusted because anyone can read it. Here neither holds. Two different answers can both be correct, so you can’t string-compare. And the grader is itself an LLM, which makes mistakes in predictable directions (it tends to like longer answers, for example).

So the take-home is not really “write a judge prompt”. That part takes ten minutes. It is “show me how often your judge is wrong, and in which direction, and what that means for how it can be used”. The reviewer grades the numbers next to the judge, and your honesty about how far 30 labels can take you.

The techinterview.org applied-AI prep guide describes this as “a common take-home”: a prompt, “thirty sample input/output pairs”, and a request for an automated faithfulness and relevance eval calibrated against the provided human labels. It is the guide’s own description, not a candidate report. The guide says the real check is whether you would trust the judge before testing it against people: “The right answer is no” (techinterview.orgsecondary).

Clarify first

If you can ask questions (in a live version or by email), these are the ones that change your design. In a take-home with no one to ask, state your assumption for each in the README.

  • Are the labels pass/fail, or scores? “If they’re 1-to-10 scores, I’ll convert them to pass/fail per criterion. Pass/fail is easier to check and to agree on.”
  • Who labelled them? “One expert, or several? If several, I can measure how well they agree with each other.”
  • How many failures are there? “If only 3 of the 30 are unfaithful, everything I say about catching failures rests on 3 examples.”
  • Which judge model can I use, and can I pin its version? “A judge that silently changes model version changes its error rates.”
  • Is any of the 30 held out? “If not, I’ll hold out half myself and explain why.”

Answer

The example we’ll use

Picture a support chatbot. For each customer question it retrieves help articles and writes an answer. One of the 30 pairs (illustrative):

PartContent
Question”Can I return my headphones after 30 days?”
Retrieved context”Returns are accepted within 14 days of delivery. Opened audio products cannot be returned.”
Answer”Yes, you have 30 days to return any product.”
Human label (faithfulness)fail

Across all 30 pairs, the human marked 9 fail and 21 pass for faithfulness. We’ll follow those numbers.

Step 1: two judges, not one

Write one judge per failure mode, meaning one specific way an answer can go wrong. Unfaithful and irrelevant are two different failure modes. Each judge returns a binary grade: pass or fail.

  • The faithfulness judge gets the retrieved context and the answer. It returns pass/fail plus a list of the claims it couldn’t find support for. That list makes every “fail” easy to check by eye.
  • The relevance judge gets the question and the answer. It doesn’t need the context at all.

Use plain code wherever code can decide. If the answer cites a source, a few lines can check that the source is really in the retrieved context. Save the LLM for the judgments that need reading.

Why split? One judge per failure mode is easier to compare with labels, as Hamel Husain and Shreya Shankar’s evals FAQ argues. A single judge scoring “overall quality” mixes two questions, and you can’t tell which one it got wrong.

Say it like this: “Each judge answers one yes/no question. That’s what makes it measurable.”

Step 2: split the 30

You need labels for two different jobs. You look at the dev set while you improve the judge’s prompt. You keep the test set untouched until the end and report numbers on it. If you tune and report on the same pairs, you will keep editing until the judge gets those particular pairs right, and the number you report will be too optimistic. This is the same reason you don’t test a model on its training data.

With 30 pairs, tune on about 15 and report on the other 15. Or rotate: tune on some, test on the rest, and repeat with different splits. Either way, say in the README that 30 is too few to do both well.

Step 3: report what kinds of mistakes the judge makes

Treat “fail” as the thing you are hunting for, the way a spam filter hunts for spam. The judge can then be wrong in two ways:

  • It can miss a real failure. The share of real failures it catches is the true-positive rate (TPR).
  • It can raise a false alarm on a good answer. The share of good answers it correctly passes is the true-negative rate (TNR).

Say the judge, run on our 30 pairs, gives this:

Human said fail (9)Human said pass (21)
Judge said fail7 caught2 false alarms
Judge said pass2 missed19 correctly passed

That is TPR 7 of 9, about 78%, and TNR 19 of 21, about 90%. Judge and human agree on 26 of 30.

Why not just report that 26 of 30 (87%) as accuracy? Because it hides which mistake is happening. If 10% of answers fail, a judge that passes everything is 90% accurate and catches nothing.

Step 4: correct the agreement for luck

Some agreement happens by chance. Here the human says “pass” 70% of the time. A judge that guessed “pass” 70% of the time would agree often just by luck.

Cohen’s kappa (κ) removes that luck. It is 1 for perfect agreement and 0 for no better than chance. For our example, chance alone would give 58% agreement; the judge got 86.7%; that works out to κ = 0.68. A judge that always says “pass” would agree 70% of the time and score κ = 0.

Step 5: put intervals on every rate

“78%” rests on 9 examples. A confidence interval is the range of true rates consistent with what you saw. For small pass/fail counts the usual choice is the Wilson interval. Computed by a short script run on 2026-10-12 (shown in the family walkthrough):

MeasureValue95% interval
Agreement26 of 30 = 86.7%70% to 95%
TPR7 of 9 = 78%45% to 94%
TNR19 of 21 = 90%71% to 97%

Read the TPR row out loud: the judge catches somewhere between half and nearly all real failures. And these numbers use all 30 pairs to keep the arithmetic simple. On a 15-pair test half there are only 4 or 5 failures, so the real intervals are even wider.

The arithmetic behind the numbers (for a Staff-level follow-up)
Cohen's kappa
κ = (p_o − p_e) ÷ (1 − p_e)
p_o
observed agreement
p_e
chance agreement from each rater's label shares
Worked example

p_o = 26 ÷ 30 = 0.867; both say pass 70%: p_e = 0.58; κ = 0.287 ÷ 0.42 = 0.68

  • Chance agreement: the human fails 9 of 30 (30%) and the judge fails 7 + 2 = 9 of 30 (30%). So p_e = 0.7 × 0.7 + 0.3 × 0.3 = 0.49 + 0.09 = 0.58.
  • Always-pass judge: p_e = 1.0 × 0.7 = 0.7 and p_o = 0.7, so κ = 0.
  • Wilson interval, 7 of 9: p = 0.778, z = 1.96, n = 9. Centre = (p + z² ÷ 2n) ÷ (1 + z² ÷ n) ≈ 0.695; half-width ≈ 0.242. So 0.45 to 0.94.

Step 6: write the README a reviewer wants

This is where most of the marks are. Include:

  1. The disagreements. Every pair where judge and human differ, and what each one taught you about the rubric. For example, a partial contradiction (“30 days” for most products but correct for one) may show the rubric never said whether a partly wrong answer fails.
  2. The biases you tested. Did the judge pass longer answers more often? If you compared answers in pairs, did the winner change when you swapped their order?
  3. The honest conclusion. “The judge is promising, but it can’t block releases yet. Its catch rate is known only to within about ±25 points.”
  4. What you’d do next. Label at least 50 failing and 50 passing examples per criterion, as the FAQ recommends, and keep a test split never used for tuning. With 50 failures and the same catch rate, the interval narrows to about 65% to 87%.

Say it like this: “Ready to be a dashboard signal, not a release blocker. Here’s the labelling plan that would change that.”

Senior vs Staff

30-pair calibration

Senior

  • Two binary judges, dev/test split, TPR, TNR and kappa with intervals, disagreements analysed.

Staff

  • Says what 30 labels cannot support, proposes the labelling plan and re-validation schedule, and states the decision the judge will be allowed to make.

In plain words: a Senior submission measures the judge correctly. A Staff submission also says what the judge is allowed to decide, what more labels would buy, and how often it gets re-checked.

Small-team version

This take-home is exactly what a small team does in production. One domain expert labels. You build the judge as a few API calls. The agreement report decides whether the judge is trusted. Buy nothing for this.

What it costs:

  • Labels: 100 items is about 3.3 hours of expert time, about $310.
  • Judge calls: about half a cent each, about $4.75 per thousand.

The labels cost more than the tokens. Add a second annotator, and measure kappa between the two people, when the domain is regulated or the expert’s calls are contested.

The arithmetic behind the numbers (for a Staff-level follow-up)
  • Labels: 100 items at an assumed 2 minutes each = 200 minutes ≈ 3.3 hours. At a loaded $93 an hour, that is about $310. The hourly figure is the BLS median developer pay of $135,980 (May 2025), divided by 0.70 (wages are about 70% of total compensation) and by 2,080 working hours a year.
  • Judge calls: assume 4,500 input and 50 output tokens per call (a token is roughly ¾ of a word; APIs bill per token). On Claude Haiku 4.5 at $1 per million input and $5 per million output (Anthropic pricing, fetched 2026-10-11): $0.0045 + $0.00025 = $0.00475 a call, about $4.75 per thousand.

Pitfalls

  • Reporting accuracy only. It hides class balance and chance agreement; a judge that passes everything can look accurate.
  • Tuning and reporting on the same 30 pairs. The judge overfits them, so the reported number is too optimistic.
  • One judge scoring both criteria on a 1–10 scale. You can’t tell which criterion it got wrong, and scores are harder to agree on than pass/fail.
  • Calling the judge “validated” on 30 labels. A catch rate known to ±25 points is a starting point, not a validation.

Go deeper

Family

LLM-as-judge and human labels: when to trust automated grading

How to check an LLM that grades other LLM outputs: compare it with human labels, report how many failures it catches, correct agreement for chance, test its biases, and handle outputs people judge by taste.

Other questions in this family