Design the workflow, not just the words
Advanced prompting is about structure: breaking work into steps, giving the model room to reason, connecting it to tools and data, and making each piece testable.
- ReasoningChain-of-thought, thinking modes and self-consistency.
- WorkflowsPrompt chaining, ReAct and tools.
- ContextLong documents, templates and caching.
Once the basics are solid, interviews move to design: how do you break a complex task into steps, get the model to reason well, use tools, and handle long documents? These techniques are what separate a demo from a dependable AI feature.
1. What is chain-of-thought prompting? Is it still needed?
Chain-of-thought asks the model to reason step by step before answering, which improves maths, logic and multi-step analysis. Many current models have built-in reasoning (often called extended or adaptive thinking) that does this internally, so you usually enable that feature and set how much effort to spend, rather than asking for visible reasoning in the answer. Keep the final answer separate from the reasoning so your code can parse it.
2. What is prompt chaining and when is it better than one big prompt?
Splitting a task into steps where each prompt's output feeds the next: extract facts → analyse → draft → review. Each step is simpler, easier to test and can use a different model or settings. Use chains when a task has distinct stages, when you need to validate intermediate results, or when one prompt keeps dropping requirements.
def review_resume(resume: str, job: str) -> str:
facts = ask(f"List the candidate's skills, projects and years of experience.\n<resume>{resume}</resume>")
gaps = ask(f"Compare these facts with the job description and list missing skills.\n<facts>{facts}</facts>\n<job>{job}</job>")
return ask(f"Write three concrete, kind suggestions for the candidate.\n<gaps>{gaps}</gaps>")3. What is self-consistency?
Generate several independent answers to the same question and pick the most common one (or have a final step reconcile them). It improves accuracy on reasoning tasks with a single correct answer, at the cost of more calls. Useful for high-stakes classification or calculations.
4. What is the ReAct pattern?
Reason + Act: the model alternates between thinking about what to do, calling a tool (search, calculator, database), and reading the result, until it can answer. It is the foundation of tool-using agents. Today it is implemented with native tool or function calling rather than parsing text like “Action: search[…]”.
5. How should you prompt with long documents?
Put long documents at the start, wrapped in tags with metadata (title, source, date), and put your question and instructions at the end — models tend to answer long-context questions better that way. Ask the model to first pull out relevant quotes, then answer from them. For many documents, give each an index so citations are unambiguous.
<documents>
<document index="1"><source>leave_policy_2026.pdf</source>
<content>{{leave_policy}}</content></document>
<document index="2"><source>travel_policy_2026.pdf</source>
<content>{{travel_policy}}</content></document>
</documents>
First copy the sentences relevant to the question into <quotes>, citing the document index.
Then answer in <answer> using only those quotes.
Question: Can I combine annual leave with a business trip abroad?6. How do you build reusable prompt templates?
Separate the fixed instructions from variables ({{customer_name}}, {{ticket_text}}), keep templates in version control, validate and escape inputs before filling them, and keep the fixed part identical between calls — that also lets providers cache it, cutting cost and latency.
7. What is meta-prompting?
Using a model to help write or improve prompts: describe the task and failure cases and ask it to draft a prompt, or give it failing outputs and ask why the prompt produced them. It speeds up iteration, but the result still has to pass your test set.
8. How do you choose between prompting, RAG and fine-tuning?
Start with prompting — fastest and cheapest to change. Add RAG when the model needs knowledge it does not have or that changes (company docs, product catalogue). Consider fine-tuning only for a narrow, stable behaviour or format at large volume where prompts cannot get there. Most products never need fine-tuning.
Remember
Key points
- Chain distinct stages
Smaller prompts are easier to test.
- Documents first, question last
For long-context prompts.
- Quote then answer
Grounds long-document answers.
- Prompt → RAG → fine-tune
In that order of effort.
Interview drill
Follow-up questions
What the interviewer asks after your first answer. Turn on practice mode, answer each one aloud, then reveal.
-
1 When can chain-of-thought hurt? Intermediate
On simple tasks it adds latency and cost with no gain, and visible reasoning can leak into output users see. Use reasoning where tasks are genuinely multi-step.
-
2 How do you run independent steps faster? Intermediate
Run them in parallel (for example, analyse five documents at once) and merge the results in a final step.
-
3 What is prompt caching? Intermediate
Providers can cache a long, unchanged prompt prefix (system prompt, documents) so repeat requests are cheaper and faster. Keep stable content at the start and changing content at the end.
-
4 How do you stop a chain from compounding errors? Advanced
Validate between steps (schemas, rules, a checker prompt), stop or retry when a step fails, and log intermediate outputs so you can see where things went wrong.
-
5 What is an evaluator-optimiser loop? Advanced
One prompt generates, another critiques against clear criteria, and the generator revises — repeated a fixed number of times or until the critique passes. Good for writing and code where quality is checkable.