GH-300 domain - 13% of the exam

Apply prompt engineering and context crafting

Apply prompt engineering and context crafting is 13% of the GitHub Copilot (GH-300) exam. These are the objectives it covers, each with practice questions and worked explanations.

Objectives in this domain

Sample question from this domain

Free sampleApply prompt engineering and context craftingmedium

A developer asks Copilot Chat to write a function and gets a vague, unfocused answer. They want to improve the result by giving the request a clearer shape. Which way of structuring the prompt is most likely to produce a focused, usable response?

  • AKeep the request to a single ambiguous word so that Copilot is free to infer the broadest possible interpretation of what is wanted.
  • BPaste several unrelated requests into one message so that Copilot can choose whichever of the competing tasks it judges to be the easiest.
  • CRepeat the same broad sentence three times in a row so the model treats the heavily emphasised instruction as the most important one.
  • DState the goal, then the relevant inputs and constraints, then the expected output, so Copilot has a clear and ordered picture of the task. Correct
Structure prompts as goal, then context and constraints, then expected output to give Copilot the specifics needed for a focused response. A well-structured prompt sequences the goal, the relevant context and constraints, and the desired output. This ordering gives Copilot the concrete signals it needs to scope the task, so the response is targeted rather than the vague output produced by a one-word or scattered request.

Why A is wrong: Tempting because short prompts feel quick, but a single ambiguous word removes the goal, inputs, and constraints Copilot needs, so it tends to produce exactly the vague output described.

Why B is wrong: Bundling unrelated tasks confuses the intent and splits Copilot's focus, which produces a muddled answer rather than the clear single result the developer wants.

Why C is wrong: Repetition adds no new specifics and does not clarify goal or constraints, so the answer stays as unfocused as the original vague request.

Why D is correct: Correct: structuring a prompt as goal, then context and constraints, then desired output gives Copilot the specifics it needs to generate a focused, relevant response.

Other domains in this exam

See also the GH-300 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.