Your journey at a glance
Four steps, start to finish. Hover or tap any stop to see what happens there.
Foundations
Understand what an LLM actually does, learn the vocabulary, and master the five-part prompt structure: role, task, context, format, constraints.
You will have: a personal cheat sheet of five prompt templates you actually use.
Core techniques
Zero-shot, few-shot, chain of thought, role prompting, delimiters and structured output. Solve a real problem with each one and compare results.
You will have: a prompt that reliably returns valid JSON you could feed into code.
Build something
Automate a task you genuinely repeat, using prompt chaining. Call the API from a script instead of a chat window. Meet Semantic Kernel and RAG.
You will have: a working script or notebook doing something useful with an LLM.
Go deeper
Function calling and a tiny agent. Build an evaluation set so you can measure prompts instead of guessing. Learn prompt injection and safety basics.
You will have: a GitHub repo and a short write-up worth showing in an interview.
Tap a numbered stop to jump between steps
Why prompt engineering matters
Two people use the same AI model. One gets vague, generic output. The other gets exactly what they need, first try. The difference is not the tool, it is how they ask.
This is now a real, paid skill. It shows up in job descriptions across engineering, product, marketing, and support. More importantly, it makes everything else you do faster: writing code, debugging, research, drafting, learning.
Same model. Same cost. Completely different value. That gap is what this page closes.
Understand what you are talking to
You do not need the maths, but a rough mental model makes you dramatically better at prompting. Here is the honest version.
What an LLM actually does
A large language model predicts the next most likely chunk of text, over and over, based on everything it has seen so far. That is genuinely it. Everything impressive it does comes from doing that extremely well at massive scale.
Three consequences you should internalise:
- It has no memory between chats unless the tool gives it one. Every conversation starts fresh.
- It can be confidently wrong. It predicts plausible text, not verified truth. Always check facts that matter.
- Context is everything. It only knows what is in the conversation right now, plus its training. Give it what it needs.
The vocabulary you will keep hearing
| Term | What it actually means |
|---|---|
| LLM | Large Language Model. The engine, for example GPT, Claude, Gemini, Llama. |
| GPT | Generative Pre-trained Transformer. OpenAI's family of models. |
| Token | A chunk of text, roughly 4 characters. Models read and bill in tokens, not words. |
| Context window | How much text the model can hold at once. Go over it and the earliest parts fall away. |
| Temperature | Randomness dial. Low (0 to 0.3) for facts and code. Higher (0.7+) for creative work. |
| System prompt | Instructions that set the model's role and rules before the conversation starts. |
| Hallucination | When the model invents something false but says it confidently. |
| RAG | Retrieval Augmented Generation. Feeding the model your own documents so it answers from real sources. |
| Fine-tuning | Further training a model on your data. Expensive. Usually good prompting is enough. |
| Agent | An LLM given tools and a goal, so it can take actions in a loop, not just reply. |
Start here (free)
Understand the basics
- What is OpenAI - plain-English explainer
- GPT models explained and compared
- GPT-2 vs GPT-3 vs GPT-3.5 vs GPT-4
- How LLMs work (video walkthroughs)
The anatomy of a good prompt
Almost every strong prompt has some combination of these five parts. You will not always need all five, but knowing them means you always know what to add when the output is not right.
1. Role
Tell it who to be. This shapes vocabulary, depth, and assumptions.
You are a senior backend engineer reviewing code for a junior developer.
2. Task
Say exactly what you want done. Use a clear action verb.
Review this function and list the three most serious issues.
3. Context
Give the background it cannot guess: audience, constraints, what you already tried.
This runs in production handling 10k requests a minute. We cannot add dependencies.
4. Format
Describe the shape of the answer you want. This one saves the most time.
Answer as a markdown table with columns: Issue, Severity, Fix.
5. Constraints
Set the boundaries: length, tone, what to avoid, what to assume.
Under 150 words. No code snippets. If you are unsure, say so rather than guessing.
Putting it together
You rarely write these as labelled sections. You just make sure each one is present somewhere.
Missing output not right? Ask yourself which of the five is missing.
A full example
You are an experienced technical interviewer at a product company.
I am a final-year CS student preparing for backend interviews.
I understand basic SQL but have never designed a schema from scratch.
Design a database schema for a food delivery app.
Walk me through your thinking step by step, then show the final
tables with columns and relationships.
Keep it to 5 tables maximum. Explain each design decision in one
sentence. End with two follow-up questions an interviewer would
likely ask about this schema.
Every one of the five parts is in there: role, context, task, format, constraints. That is the whole trick.
The techniques that matter
These are the named patterns you will see referenced everywhere. Learn the first four properly and you will handle 90% of real situations.
Zero-shot prompting
Just ask, with no examples. The default way most people use AI.
Use when: the task is common and well understood. Classify this review as positive or negative.
Few-shot prompting
Show 2 to 5 examples of input and desired output, then give your real input. The single highest-leverage technique.
Use when: you need a specific format or style. Examples teach far better than descriptions.
Chain of thought
Ask it to reason step by step before answering. Dramatically improves accuracy on logic, maths, and multi-step problems.
Use when: the answer requires reasoning. Add: Think through this step by step before answering.
Role prompting
Assign an identity and expertise level. Changes vocabulary, depth, and what it assumes you already know.
Use when: you want a specific perspective or level of detail.
Output formatting
Specify the exact structure: JSON, markdown table, bullet list, numbered steps. Essential when feeding output into code.
Use when: you need machine-readable or consistently structured output.
Prompt chaining
Break a big task into several prompts, feeding each output into the next. Far more reliable than one giant prompt.
Use when: the task has distinct stages. Research, then outline, then draft, then edit.
Delimiters
Wrap different parts in clear markers so the model knows what is instruction and what is data.
Use when: passing in text to process. Use triple quotes, XML-style tags, or markdown headings.
Self-critique
Ask it to review and improve its own answer. Often catches real errors on the second pass.
Use when: quality matters. Add: Now critique your answer and give an improved version.
Tree of thought
Ask it to generate several distinct approaches, evaluate each, then pick and develop the best.
Use when: there are genuinely multiple valid strategies and the choice matters.
RAG (grounding)
Supply your own documents in the prompt so answers come from real sources instead of memory. The main cure for hallucination.
Use when: you need accuracy on private, recent, or domain-specific information.
Tool and function calling
Let the model call real functions: search, database queries, APIs, calculations. The foundation of AI agents.
Use when: the model needs live data or must take actions in the world.
Evaluation
Build a small test set of inputs with expected outputs, then measure prompt changes against it instead of guessing.
Use when: a prompt goes into production. This is what separates hobby from professional.
See the difference
Three real situations, weak prompt versus strong prompt. Try both in any free chatbot and compare.
Debugging code
Learning something new
Getting feedback on your work
Common mistakes to avoid
Your 4-step plan
Go at your own pace. Each step takes a few days of focused practice. By the end you will have a small portfolio of prompts that solve real problems, which is genuinely worth showing in an interview.
Step 1 Foundations
- Read the Microsoft Learn and Google Cloud guides linked above
- Learn the vocabulary table until the terms feel obvious
- Practise the five-part structure: role, task, context, format, constraints
- Rewrite 10 lazy prompts you have used before into strong ones
- Deliverable: a personal cheat sheet of your five best prompt templates
Step 2 Core techniques
- Practise zero-shot, few-shot, chain of thought, and role prompting
- For each one, solve a real problem from your own work or study
- Learn delimiters and structured output (JSON, markdown tables)
- Try the same task with each technique and compare quality
- Deliverable: one prompt that reliably produces valid JSON you could feed into code
Step 3 Build something
- Pick a repetitive task you actually do and automate it with prompt chaining
- Try the OpenAI or Azure OpenAI API from a script, not just the chat window
- Explore Semantic Kernel or LangChain to see how prompts work inside applications
- Learn what RAG is and why grounding beats fine-tuning for most cases
- Deliverable: a small working script or notebook that uses an LLM to do something useful
Step 4 Go deeper
- Learn function and tool calling, then build a tiny agent
- Create a small evaluation set and measure your prompts objectively
- Read about prompt injection and basic AI safety
- Write up what you built and share it publicly
- Deliverable: a GitHub repo plus a short post explaining what you learned
Free resources
Everything here is genuinely free. Start with the official guides, they are better than most paid courses.
Official guides (start here)
Free courses
Understand the fundamentals
Build with prompts in code
Practise for free
- ChatGPT - free tier
- Claude - free tier
- Google Gemini - free tier
- Microsoft Copilot - free
- HuggingChat - open models
Prompt quality checklist
Not getting what you want? Run through this before rewriting from scratch.
- Have I said who it should be (role and expertise level)?
- Is the task a single clear action, not three tangled ones?
- Have I given the context it cannot possibly guess?
- Have I described the format I want the answer in?
- Have I set constraints on length, tone, and scope?
- Would examples teach this faster than my description?
- Does this need step-by-step reasoning before the answer?
- Have I said what to do rather than only what to avoid?
- Should I split this into a chain of smaller prompts?
- Am I about to paste anything private or confidential?
Where to go next
Prompt engineering pairs well with these:
One last thing. The people who get the most out of AI are not the ones who memorised the most techniques. They are the ones who think clearly about what they actually want before they start typing. Prompting is mostly just that skill, written down.
You do not need a machine learning degree for this. Prompt engineering is mostly clear thinking plus a handful of patterns you can learn in an afternoon. Read the first two sections, try the examples in any free chatbot, and you will already be ahead of most people. Everything linked here is free.