Prompts and context, from one call to a whole agent loop
Prompting questions now test whether you can treat the context window as an engineered system. This lesson covers what goes in each role, when examples and reasoning help, how to get output a program can trust, how to lay out and cache long prompts, and how to improve a prompt with evidence instead of taste.
What you'll be able to do
- Decide what belongs in the system prompt, the user turn, tool definitions and retrieval, and say why
- Choose between zero-shot, few-shot, chain of thought and a reasoning model for a given task
- Explain how schema-constrained decoding works and what it does not guarantee
- Lay out a long prompt for attention, injection resistance and cache hits, and keep an agent's context clean over many steps
- Improve, version and roll out a prompt change with an eval set rather than by rewording
Before this: how-llms-work
Log in to read the rest of this lesson
Prompting questions now test whether you can treat the context window as an engineered system. This lesson covers what goes in each role, when examples and reasoning help, how to get output a program can trust, how to lay out and cache long prompts, and how to improve a prompt with evidence instead of taste. This walkthrough runs about 17 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.
Log in to continueThe first module of every track is free to read on the web: see what's open in AI interviews.