GitHub Copilot certification · GH-300 · Skills outline of August 7, 2026 · Official skills outline · Original practice content
Free GH-300 practice questions: Apply prompt engineering and context crafting
Reviewed by the FlashGenius certification content team · Last updated: December 5, 2026 · Aligned to the published GH-300 skills outline and weights
The Apply prompt engineering and context crafting domain is 10-15% of the GH-300 exam and covers prompt structure and context, how context is determined, zero-shot and few-shot prompting, best practices, and chat history. Review each answer and explanation as you practice.
GH-300 has 60 scored multiple-choice questions (plus about 10-15 unscored ones) in 100 minutes, costs $99 USD and needs a scaled 700 to pass.
What Apply prompt engineering and context crafting covers on the GH-300 exam
This domain is 10-15% of the GH-300 exam (about 9 questions in a 60-question mock). The official skills outline includes:
Prompt structure and context
How Copilot determines context
Zero-shot and few-shot prompting
Best practices for prompt crafting
Prompt engineering principles, the prompt process flow and chat history
How to study Apply prompt engineering and context crafting
Good prompts state the goal, the constraints and an example; vague prompts get generic code.
When an earlier wrong turn keeps steering answers, start a new chat thread so only correct context remains.
GH-300 Apply prompt engineering and context crafting sample questions with answers
Apply prompt engineering and context crafting
Sample question 1
A developer wants Copilot Chat to write a function that validates postal codes for three countries. Which prompt structure follows GitHub's prompt engineering guidance?
Give only the function name and let Copilot infer the rest
List every edge case first and leave the goal implied
State the overall goal, then list the specific requirements
Mix the goal and requirements into one long sentence
Show correct answer and explanation
Correct answer: C. State the overall goal, then list the specific requirements
C is correct because GitHub's guide says to start general, then get specific: describe the broad goal first and follow it with the detailed requirements. A is incorrect because a bare name leaves the requirements ambiguous, so the result is unlikely to match what is needed. B is incorrect because without the goal stated up front Copilot has to guess what the edge cases are for. D is incorrect because a single run-on sentence hides the requirements instead of listing them clearly after the goal. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 2
A developer writes a long chat prompt. The most important requirement, that no external libraries be used, sits in the middle of a list and Copilot ignores it. What change is most likely to help?
Split it across two sentences in the middle
Put it in a comment in an unrelated file
Move it to the start or end of the prompt
Write it in capital letters where it is now
Show correct answer and explanation
Correct answer: C. Move it to the start or end of the prompt
C is correct because GitHub's guide notes that Copilot gives extra weight to instructions at the start and end of a prompt, so the most important requirements belong there. A is incorrect because spreading it out in the middle keeps it in the least weighted part of the prompt. B is incorrect because an unrelated file is unlikely to be part of the context at all. D is incorrect because the position, not the formatting, is what the guidance says gives a requirement extra weight. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 3
GitHub recommends stating rules directly in a prompt. Instead of writing "Remember to always return JSON", a developer should write ___.
"Keep JSON in mind as you go"
"Return the result as JSON"
"JSON would be nice for this"
"Try to return JSON if you can"
Show correct answer and explanation
Correct answer: B. "Return the result as JSON"
B is correct because GitHub's guide says to state rules and requirements directly rather than as meta-instructions, and this wording states the rule itself. A is incorrect because, like the original, it is an indirect reminder rather than a direct rule. C is incorrect because it hints at a preference rather than giving a clear instruction. D is incorrect because it makes the requirement optional instead of stating it directly. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 4
A team lead is writing guidance for prompts that assign work to Copilot cloud agent. Which statement is true?
Screenshots cannot be attached to cloud agent tasks, so visual needs must be described in text.
A cloud agent prompt works best as one short phrase, so the agent can decide its own scope.
Acceptance criteria should be left out, since the agent writes its own tests to define success.
A good task prompt states the objective, the acceptance criteria and the relevant files.
Show correct answer and explanation
Correct answer: D. A good task prompt states the objective, the acceptance criteria and the relevant files.
D is correct because GitHub's guide says that for cloud agent you choose the repository and base branch, then describe the objective, acceptance criteria and relevant files. A is incorrect because GitHub recommends attaching screenshots or mockups when visual context matters. B is incorrect because GitHub recommends a scoped prompt with objective, acceptance criteria and files, not a vague phrase. C is incorrect because acceptance criteria are one of the elements GitHub tells you to include. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 5
A developer asks Copilot cloud agent to fix a bug that exists only on a release branch. The agent's work starts from the wrong branch. What should the developer have done when creating the task?
Name the branch in a code comment in the file
Add the branch to the org custom instructions
Rely on the agent to pick the newest branch
Select the repository and base branch first
Show correct answer and explanation
Correct answer: D. Select the repository and base branch first
D is correct because GitHub's guide says a cloud agent prompt starts by scoping the repository and base branch before describing the objective. A is incorrect because a comment in a file does not set where the agent's work starts. B is incorrect because organization instructions carry standing guidance for everyone, not a per-task base branch. C is incorrect because the agent works from the base branch that is selected, not whichever branch is newest. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 6
A developer wants Copilot Chat to generate unit tests for a tax function. Which prompt is best structured for a useful result?
Write unit tests for calculateTax covering zero, negative and very large incomes
Make tests for the code, and make them good and complete and useful
Write some tests for this file that cover whatever seems important to you
Help me with the tests here, the usual kind that people normally write
Show correct answer and explanation
Correct answer: A. Write unit tests for calculateTax covering zero, negative and very large incomes
A is correct because it names the function and lists the specific cases to cover, so Copilot knows exactly what to test. B is incorrect because adjectives such as good and complete do not tell Copilot which function or cases to test. C is incorrect because it neither names the function nor says which cases matter, leaving Copilot to guess. D is incorrect because "the usual kind" is ambiguous and gives no target function or cases. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 7
A developer using Copilot Chat in the IDE wants Copilot to consider a specific GitHub issue and a related file when answering. What is the most direct way to add them as context?
Type @ and attach the issue and the file
Add the issue number to the instructions file
Paste the issue link into a code comment
Star the issue so Copilot can find it
Show correct answer and explanation
Correct answer: A. Type @ and attach the issue and the file
A is correct because GitHub's guide says that in IDE chat and on the GitHub website you type @ to attach files, issues, pull requests or repositories as context. B is incorrect because instructions files hold standing guidance, not context for one question. C is incorrect because a comment in a file is not a reliable way to attach an issue to the chat request. D is incorrect because starring an issue has no effect on what Copilot uses as context. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 8
In GitHub Copilot CLI, a developer references an issue with #number and attaches a file to the prompt with ___.
the # sign followed by the file path
a --file flag added to each prompt
a /attach command and the file path
@ followed by the file path
Show correct answer and explanation
Correct answer: D. @ followed by the file path
D is correct because GitHub's guide says that in Copilot CLI you attach a file with @path and reference an issue or pull request with #number. A is incorrect because # with a number references an issue or pull request, while files are attached with @. B is incorrect because files are attached inside the prompt with @path, not with a command-line flag. C is incorrect because files are attached inline with @path, not with a separate attach command. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 9
A team adds .github/copilot-instructions.md with its coding conventions. When is this file's content used as context for Copilot Chat in that repository?
After an admin enables an org policy
Automatically, with each chat request
When someone attaches its path with @
In the first message of a conversation
Show correct answer and explanation
Correct answer: B. Automatically, with each chat request
B is correct because repository custom instructions apply automatically and are sent with every chat message, which is why GitHub advises keeping them short. A is incorrect because repository custom instructions are available on all plans and do not need an organization policy. C is incorrect because instructions apply automatically; attaching on demand describes prompt files, not instructions. D is incorrect because the instructions are sent with every chat message, not just the first. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
Apply prompt engineering and context crafting
Sample question 10
A platform team is checking how Copilot decides which context to use. Which statement is true?
Personal instructions saved on GitHub.com also apply to inline suggestions in every IDE.
Content-excluded files are still used as chat context while they are open in the editor.
Copilot code review reads custom instructions from the base branch, so a PR cannot change them.
Copilot code review reads repository custom instructions from the pull request's head branch.
Show correct answer and explanation
Correct answer: D. Copilot code review reads repository custom instructions from the pull request's head branch.
D is correct because GitHub's docs say that when reviewing a pull request, Copilot reads custom instructions, agent instructions and skills from the head branch, not the base branch. A is incorrect because personal instructions on GitHub.com apply to Copilot Chat in GitHub only. B is incorrect because excluded content does not inform suggestions in other files or chat responses. C is incorrect because the instructions are read from the head branch, so changes made in the pull request are used. Skills measured: Apply prompt engineering and context crafting > Craft effective prompts.
FlashGenius is an independent study resource and is not affiliated with or endorsed by GitHub or Microsoft. GitHub and GitHub Copilot are trademarks of GitHub, Inc. 300 original practice questions.