AI Interviews · Question

Phone screen: implement an "AI ToDo list" in Python (reported as a title only).

Practical coding question reported at Perplexity (May 2026). Sources, confidence and an answer card.

Researched · updated

eng-059 AI Engineer Practical LLM-plumbing code Practical coding Low confidence
On this page

What they’re really asking

If you only remember one thing, say this in the first minute: “First I’ll ask what the AI part should do. Then I’ll build a plain to-do list with tests in the first ten minutes. After that I add the AI part as a parser: the model turns free text into a task, my code checks every field, retries once if the reply is bad, and falls back to a plain task if it is still bad. The model never writes to the list directly; my code does, after checking. I test it with a fake model so every path runs.”

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

The task is reported only as a title, “AI ToDo list”, for a phone screen in Python. The real task is unknown, so this card gives the family’s standard answer for the most likely readings. Whatever the version, a screen of this shape checks whether you can build a small, correct program quickly and put a model inside it without letting the model break the program.

What makes this different from a normal coding screen

A normal to-do list is pure code: add, list, complete, delete. The “AI” part adds a large language model (LLM), a service that reads text and writes text. You send it “call the bank Friday, high priority” and ask for structured fields back. It will usually get them right. Sometimes it will wrap the answer in extra words, invent a priority you don’t support, or produce a date that makes no sense. So the model’s reply is untrusted input, and your program has to check it the same way it would check a form a user filled in.

Words you need first

  • Prompt: the text and instructions you send the model.
  • Parse: turn free text into fields (title, due date, priority).
  • Fake model: a function with the same signature as the real model call that returns fixed replies, so tests run without a network or cost.
  • Fallback: what the program does when the model’s reply can’t be used.

Where it was reported

The title comes from an aggregator page behind a login 1point3acresaggregator.

Clarify first

Ask, because the title fits several tasks:

  • Is the AI part real (a model call) or a stub? Assume a function from prompt to text that you can fake in tests.
  • What should AI do? Parse free text into tasks (“call the bank Friday, high priority”), prioritize, or break a goal into subtasks? Assume parsing first.
  • Storage? Assume in memory.
  • Is there a time cap or test harness? Assume 30–45 minutes and that the interviewer runs your code.
  • Are coding agents allowed? Perplexity’s official interview page lists an “Agentic Coding” round requiring frontier coding agents among its round types Perplexityofficial, but a phone screen may differ. Ask.

Answer

A picture of the program

User text: "call the bank Friday, high priority"
   │
   ▼
parse_task(text, model)
   │  prompt asks for JSON {title, due, priority}
   ▼
Model (real or fake)
   │  reply text
   ▼
Validate ── JSON? title non-empty? priority in the allowed list? date parses and is not in the past?
   │            │
   │ ok         └── bad → retry once with the error → still bad → fallback: title = raw text, no date
   ▼
TaskStore.add(task)   ◄── only code writes to the store

parse_task. Builds the prompt and calls whatever model function it was given, so tests can pass a fake.

Validate. The same checks you would put on a web form.

Fallback. A task with the raw text as its title and no date, and a message telling the user. The user never loses what they typed.

TaskStore. The plain part, with its own tests. The model never touches it directly.

Plain part first

A Task dataclass (id, title, due date, priority, done) and a store with add, list, complete and delete, with simple tests. Get this running in the first ten minutes. Say it like this: “The list works without AI. Now I’ll add the AI part on top, so if it misbehaves the list still works.”

Then the AI part as a parser

parse_task(text, model) builds a prompt asking for JSON with those fields, calls the model, and validates: title non-empty, priority in an enum (a fixed list such as low, medium, high), due date parseable and not in the past. On invalid output, retry once with the error; then fall back to a task with the raw text as the title and no date, and say so to the user. The model never writes to the store directly; your code does, after validation.

Follow three replies through it

Test with a fake model that returns each of these in turn:

Fake model replyWhat the code doesWhat to say in the interview
{"title": "Call the bank", "due": "Friday", "priority": "high"}Date resolved to the coming Friday; all checks pass; task added.”The happy path.”
Sure! Here is your task: {"title": ...}Strict JSON parse fails on the extra words; one retry with the error; the second reply is clean.”I retry once and tell the model what was wrong.”
{"title": "Call the bank", "due": "2019-02-30", "priority": "urgent"} twiceInvalid date and an unknown priority, twice; fallback task with the raw text and no date; user is told.”Bad output never reaches the list, and the user never loses their text.”

This is the same strict-parse, retry, fallback pattern as the family walkthrough’s reference loop.

If the follow-up is “prioritize my list” or “split this goal”

Same pattern. The model proposes; code validates (no invented task ids, subtasks attached to an existing parent) and applies.

Senior vs Staff

AI to-do list

Senior

  • Working CRUD with tests, a validated model-backed parser and a fallback path, done in time.

Staff

  • Asks which reading of the task matters, and mentions the eval they'd add (a few dozen phrasings with expected fields) and how dates and time zones would be handled for real users.

In plain words: Senior ships the working list, the checked parser and the fallback in time. Staff also asks which version of the task matters, and mentions how they would measure the parser on real phrasings and handle time zones.

Small-team version

“Turn free text into a structured record” is one of the most common small AI features: tickets, CRM notes, expense lines. Build it exactly this way on a cheap model tier, with a labelled set of real phrasings in CI, and keep the fallback the user can see.

What it costs, with assumed sizes: about $0.0002 per parse on gpt-5-mini ($0.25 / $2 per 1M input / output tokens, fetched 2026-10-11), so 10,000 parses a day cost about $2 a day, $59 per 30 days. Revisit the tier only if the labelled set shows the cheap model misreading dates or priorities.

The arithmetic behind the numbers (for a Staff-level follow-up)
  • Assumed: 300 input and 60 output tokens per parse.
  • 300 × $0.25 per million = $0.000075; 60 × $2 per million = $0.00012; total ≈ $0.0002.
  • × 10,000 = about $2 a day; × 30 = about $59.

Pitfalls

  • Starting with the model. Having no working list after 20 minutes leaves nothing to show if the AI part stalls.
  • Trusting the model’s date or priority. An unchecked value puts bad data in the list.
  • Not asking what “AI ToDo list” means. You may build the wrong feature well.

Go deeper

Family