AI Engineer Interview Question

How do you write and maintain prompts for a production feature?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Treat prompts as code. Write clear instructions covering the task, the context, the constraints and the output format, put reference material in clearly delimited sections, and add a few varied examples where format matters. Keep prompts in version control with an identifier logged on every request, test each change against an evaluation set before release, and delete instructions that no longer earn their place rather than piling on patches.

Why interviewers ask this

Plenty of candidates can write a prompt that works in a playground. The interviewer wants to know whether you can keep one working for months while the product, the data and the model change underneath it. They listen for structure, deliberate use of examples, versioning, logging which prompt produced which output, and testing before release. Spotting prompt bloat, where every bug fix adds another rule, is a sign you have actually maintained one.

How to structure your answer

  • Describe how you structure a prompt and why.
  • Explain how you use examples and output rules.
  • Cover versioning, logging and testing each change.
  • Explain how you stop a prompt turning into a pile of patches.

Example answer

Spoken example, first person

I write them the way I would brief a capable new colleague who knows nothing about our product: a short statement of the job, the context they need, the rules that matter, and exactly what the output should look like. Reference material such as retrieved passages goes into clearly marked sections, so the model can tell instructions apart from content. Where format matters I add two or three examples covering different cases, because a single example tends to get copied too literally. Then the engineering side. Prompts live in the repository, not in a dashboard someone edits on a Friday afternoon. Each version has an identifier logged with every request, so when a bad output turns up I know exactly which prompt produced it. No change ships without running the evaluation set. The trap I watch for is bloat: every bug report adds another sentence in capitals until the rules contradict each other. Every few months I rewrite the prompt from the test cases, and it usually comes out shorter and scores better.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How do you decide between adding an example and adding an instruction?
  • How would you manage prompts that differ by customer or language?
  • What would you do if a prompt works well on one model but badly on another?

Related ai engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot