Skip to content

Owning every line, out loud

Any line you keep from the assistant is yours to explain, so say why you prompt, what you expect, and how you'll check.

Predict first

Before you read: predict

AI-assisted practice round. The assistant wrote ExamHall's exam-end reconciliation, you pasted it in, and its test (12 answers, every save accepted) passes:

The interviewer says: “At exam end the store rejects the saves of 2 of the 12 answers.” What does this function do?

Code for this question
export async function reconcileAtExamEnd(examId, answers, store) {  const results = await Promise.allSettled(answers.map((a) => store.save(a)));  const saved = results.filter((r) => r.status === 'fulfilled').map((r) => r.value);  await store.closeExam(examId, { saved: saved.length });  return saved;}
Pick one

The 30-second version

In an AI-assisted round, interviewers test your grip on generated code with line questions: why is this here, what does it return? Before each prompt, say why you are asking, what you expect back and how you will check it. Read every line you keep and answer from your own trace; say so when one is wrong or unclear.

Any line you keep from the assistant is yours to explain, so say why you prompt, what you expect, and how you'll check.

How it works

Step 1 of 9

Kept means yours. A line you paste from the assistant is your code, and the interviewer may ask about any of it. [S2]

Analogy: A minister's speech, then the press conference

A minister asks her speechwriter for a speech on the new rail timetable. First she tells him the one point it must make, that it must run under ten minutes, and that she will read it aloud at rehearsal. At rehearsal she reads every sentence aloud and strikes the two she cannot defend. At the press conference a journalist quotes a sentence back: "What did you mean by 'capacity will follow demand'?" She answers from her own reading. "My speechwriter wrote that" would undo the whole speech, and so would reading out an aide's whispered note.

Speech and press conference AI-assisted round
The point, the length, "I'll read it aloud at rehearsal" Why you prompt, what you expect back, how you'll check
Reading every sentence aloud before the event Reading every line before you keep it
A journalist quoting one sentence back "Why is this line here?"
"My speechwriter wrote that" "The assistant added that one"
Reading out the aide's whispered note Pasting the question into the assistant
Striking a sentence she cannot defend Replacing a line you cannot explain

Breaks down when: a speech is read once as written, while code also runs, so a line can be traced on an input and its output checked; a sentence cannot. Wrong inference: "if the wording sounds right, the line is right." The journalist also chooses the sentence after the speech; an interviewer can ask about any line while you are still building.

In real terms: at every line you keep, you could say what it does with the input the interviewer names.

Examples, run for real

EXH-3160 is a synthetic practice round: the assistant wrote ExamHall's exam-end reconciliation, the one printed in the opening question. The first run is the assistant's own test, in which the store accepts every save. The second is the interviewer's question, in which the store rejects the saves of answers a4 and a9; the script traces that run line by line. It then runs the candidate's rewrite against both cases.

EXH-3160 reconcileAtExamEnd, as generated · ECON-201 · 12 answers
  the assistant's test, store accepts all 12: closeExam { saved: 12 } · returned 12 · test passes
  the interviewer's case, store rejects a4 and a9, traced:
    line 2 allSettled   12 outcomes · fulfilled 10 · rejected 2 · nothing thrown
    line 3 filter, map  kept 10 · dropped a4, a9
    line 4 closeExam    { saved: 10 }
    line 5 return       10 answers · a4 and a9 named nowhere
MR !3460 the rewrite, store rejects a4 and a9: closeExam { saved: 10, failed: [a4, a9] } · returned failed a4, a9
  its tests: all 12 accepted passes · a4 and a9 rejected passes · 2 of 2

The assistant's test passed, and it said nothing about rejected saves: no rejection ever reached line 3. The trace answers the interviewer's question line by line. Line 2 settles every save and throws nothing; line 3 keeps the 10 fulfilled answers; line 4 closes the exam with 10; and the two failed answers appear nowhere.

That trace is where ownership started. Having said aloud what line 3 does to a rejected save, the candidate rewrote it to collect the failed answers and pass them to closeExam as failed, and added the rejection case as a test. Why all would behave differently belongs to js-promise-combinators; here what matters is that each answer came from a traced line.

The script runs an in-memory store on fixed inputs. It shows what the code does, not how well a candidate explains it.

Try it

Answer first, then check. Nothing is saved.

Question 1 of 6

AI-assisted round on a box-office service, phase 2. You pasted the assistant's holdSeats, and its tests pass. The interviewer points at holds.sort((a, b) => b.expiresAt - a.expiresAt); and asks why it is there. You walk three holds through it aloud: it puts the latest expiry first, and the brief releases the earliest first.

What do you do next?

Pick one

Question 2 of 6

AI-assisted round on a box-office service, phase 2. You have planned the expiry sweep yourself: find the expired holds, put their seats back on sale, email each buyer. The assistant will write it.

Before you type the first prompt, what do you tell the interviewer?

Pick one

Question 3 of 6

AI-assisted round on a box-office service. The assistant wrote this, and the interviewer points at it: A 100-seat show has 90 seats sold and five seat holds. Measured from now, the holds expire 60 s ago, 1 s ago, exactly at now, in 60 s and in 120 s.

What does seatsLeft(100, 90, holds, now) return?

Code for this question
export function seatsLeft(capacity, sold, holds, now) {  const live = holds.filter((h) => h.expiresAt > now);  return capacity - sold - live.length;}
Pick one

Question 4 of 6

AI-assisted round on a box-office service. The assistant wrote the order step that reserves seats:

In a test, an order asks for 6 seats; 2 of them are already taken, so reserve rejects for those two. The audit row reads confirmed: 6. The interviewer asks you to find the line at fault.

Which line puts the two taken seats into that count?

Code for this question
export async function confirmSeats(orderId, seatIds, inventory, audit) {  const results = await Promise.allSettled(    seatIds.map((id) => inventory.reserve(id).catch(() => null)),  );  const confirmed = results    .filter((r) => r.status === 'fulfilled')    .map((r) => r.value);  await audit.write({ orderId, confirmed: confirmed.length });  return confirmed;}
Pick one

Question 5 of 6

AI-assisted round, minute 35, on a box-office service. At the start the interviewer said they would ask about lines in anything you paste. The assistant drafted a 30-line allocateSeats. You worked out the expected seat plans from the brief, ran them in the project, and all four pass; so far you have skimmed the code itself. Phase 3 starts next.

What do you do with the draft?

Pick one

Question 6 of 6

The assistant wrote this for a box office's checkout form:

The buyer types 2, 3 and 1, so typed is ['2', '3', '1']. The interviewer asks you to make the code match its comment.

Which one change does that?

Code for this question
// Read the seat counts the buyer typed (adults, students, children) as numbers.export function seatCounts(typed) {  return typed.map(parseInt);}
Pick one

Go deeper

Pro tip

In a practice round, have a friend point at random lines of code you pasted and ask "why is this here?". Tally the lines you could not answer from your own reading, and practise tracing that kind of line first.

Checked against the tools and docs as of 2026-10-06.