GH-300 study notes · 10–15% of the exam
Apply prompt engineering and context crafting
First draft for review. Check details against Microsoft Learn before relying on them.
What this area covers
Writing prompts that get useful results from Copilot, and understanding how context and chat history shape them.
Key concepts
- Prompt structure: state the goal, the context (language, framework, constraints), examples and the expected output format.
- How context is chosen: the current file and cursor position, open tabs, selected code, chat variables (
#file,@workspace), custom instructions and previous turns. - Zero-shot means no examples. Few-shot means you include examples of the pattern you want, which is useful for consistent formats.
- Best practices: be specific, break big tasks into steps, use meaningful names and comments, give examples, iterate, and start a new thread when the topic changes so stale history doesn't confuse the answer.
- Prompt process flow: the prompt and history are combined, trimmed to fit the context window, sent to the model, and the response is filtered.
Exam tips
- If a question asks how to get suggestions that follow an existing pattern, show an example (few-shot) or open a file that uses it.
- If chat answers keep referring to an old topic, clear the history or start a new chat.