How to Approach Prompt Engineering in Interviews
This is a shorter version of a lesson from the AI Engineering course on Aced. The full lesson goes deeper on each technique. Prompt engineering is the work of getting a language model to do a specific task reliably. Most of that work happens after the first draft, when you test the prompt against t

Posted on Nov 24 • Originally published at aced.io
This is a shorter version of a lesson from the AI Engineering course on Aced. The full lesson goes deeper on each technique.
Prompt engineering is the work of getting a language model to do a specific task reliably. Most of that work happens after the first draft, when you test the prompt against the inputs it will actually see and revise it based on what goes wrong, much like debugging code.
We use one running example throughout: a prompt that turns customer support emails into a structured ticket with a category, an urgency level and a one-line summary.
Before you write anything, define the task and how you will judge the output. For the ticket example, that means listing the categories, deciding what counts as urgent, setting a length for the summary and choosing an output format, such as JSON with three fields. Then gather 10 to 20 real emails to test against, including the messy ones: a forwarded thread, an angry email with no actual question, an email written in Spanish.
Run the prompt on your test set and read every output. When something fails, form a guess about why, change one part of the prompt, and run the whole set again. If you change several things at once, you can't tell which change fixed the problem or which one broke a case that used to work, so keep a short log of each change and its result.
A few failures come up often, and each has a usual fix:
Some problems can't be fixed with wording. If the model lacks information it needs, such as your current return policy, retrieval is the fix (see What is RAG? ). If you need a very consistent style across thousands of outputs, fine-tuning may be worth it, and if cost or latency is the issue, a smaller model with a tighter prompt is often the better trade.
If you're asked to write or improve a prompt in an interview, narrate this loop out loud: state the success criteria, write a first version, test it on a few inputs including an edge case, and explain each change you make and why. Interviewers usually learn more from how you diagnose a bad output than from your first draft.
The full lesson on Aced covers these techniques in more depth, and the rest of the AI Engineering course covers RAG, evaluation and AI prototyping.