Skip to main content
CertRampLearning

GitHub · Free practice questions

GH-300 Practice Questions

15 original GH-300 practice questions spread across the six skill areas in the Microsoft Learn study guide (skills measured as of 7 August 2026), roughly by weight: three on responsible use, four on Copilot features, and two each on data and architecture, prompt engineering, developer productivity, and privacy and safeguards. Each one comes with the answer, a short explanation and the reason every other option is wrong.

Written for the skills measured as of 7 August 2026 · Updated November 11, 2026

These are original practice questions written by CertRamp to the official GitHub exam outline. They are not real exam questions and do not come from any exam. Try each question first, then open the answer to see the explanation for every option.

Domain 1

Use GitHub Copilot responsibly

Understand responsible AI principlesFoundationDomain: Use GitHub Copilot responsibly

Question 1. A team lead reminds developers that the team, not the tool, answers for any Copilot-generated code that ships, and that they must keep monitoring how it behaves in production. Which of Microsoft and GitHub's six responsible AI principles does this reflect most directly?

  1. Option A: Privacy and security
  2. Option B: Fairness
  3. Option C: Accountability
  4. Option D: Transparency
Show answer and explanation

Correct answer: C. Accountability

The six principles are fairness, reliability and safety, privacy and security, inclusiveness, transparency and accountability. Accountability keeps humans responsible for what an AI-assisted system does, which for Copilot means owning the code you accept.

  • A (incorrect)Privacy and security is about AI systems being secure and respecting privacy, not about who answers for outcomes.
  • B (incorrect)Fairness is about treating all people fairly, for example by avoiding biased outcomes.
  • C (correct)Correct. The accountability principle says people should be accountable for AI systems and that those who build and deploy them must monitor performance and mitigate risks.
  • D (incorrect)Transparency is about AI systems being understandable, for example through logging and auditability. It supports accountability but is not the principle described.

Reference: Microsoft Learn: Microsoft and GitHub's six principles of responsible AI (opens in a new tab)

Validate and operate AI toolsFoundationDomain: Use GitHub Copilot responsibly

Question 2. Copilot suggests a database helper that compiles cleanly and looks correct. What does GitHub's responsible use guidance expect the developer to do before relying on it?

  1. Option A: Review and test it carefully, especially security-sensitive parts such as query building
  2. Option B: Accept it, because Copilot filters every suggestion for security vulnerabilities before showing it
  3. Option C: Regenerate the suggestion until two versions are identical
  4. Option D: Ask Copilot Chat whether the code is correct and accept it if the answer is yes
Show answer and explanation

Correct answer: A. Review and test it carefully, especially security-sensitive parts such as query building

Generated code is a starting point, not a final answer. Review it against your design, follow secure coding practices and run tests, because a suggestion can be syntactically valid but semantically wrong.

  • A (correct)Correct. GitHub warns that suggestions can look valid without doing what you intended and can introduce weaknesses such as SQL injection, so users must review and test them.
  • B (incorrect)Copilot's filters reduce some risks but do not guarantee secure or correct code; GitHub says users assume the risks of generated code.
  • C (incorrect)Consistency between generations is not evidence of correctness.
  • D (incorrect)Asking the same AI to confirm its own output does not replace human review and testing.

Reference: GitHub Docs: Responsible use of GitHub Copilot inline suggestions (opens in a new tab)

Validate and operate AI toolsAdvancedDomain: Use GitHub Copilot responsibly

Question 3. A developer wants to run Copilot CLI without approval prompts but is worried about destructive commands. Which approach is the most responsible?

  1. Option A: Launch it from the home directory with --allow-all-tools so it can reach every project
  2. Option B: Use --allow-all-tools together with --allow-tool 'shell(rm)' to make the rule explicit
  3. Option C: Rely on trusted directories alone, since GitHub guarantees files outside them are protected
  4. Option D: Start it in the project directory with --allow-all-tools and --deny-tool 'shell(rm)'
Show answer and explanation

Correct answer: D. Start it in the project directory with --allow-all-tools and --deny-tool 'shell(rm)'

With automatic approval, Copilot CLI can run any shell command you can run, which raises the risk of data loss. Limiting the working directory and denying specific dangerous tools keeps the convenience while reducing that risk.

  • A (incorrect)GitHub advises against launching Copilot CLI from your home directory, and allowing all tools there maximises the potential damage.
  • B (incorrect)This explicitly allows rm rather than blocking it, which is the opposite of what is wanted.
  • C (incorrect)GitHub states that it does not guarantee that all files outside trusted directories will be protected.
  • D (correct)Correct. --deny-tool takes precedence over --allow-tool and --allow-all-tools, so the combination allows routine work while blocking the risky command, scoped to the project.

Reference: GitHub Docs: About GitHub Copilot CLI (opens in a new tab)

Domain 2

Use GitHub Copilot features

Use GitHub Copilot CLIIntermediateDomain: Use GitHub Copilot features

Question 4. A developer whose Copilot seat comes from her organization installs Copilot CLI with npm install -g @github/copilot on Node.js 22, but cannot use it. Her seat is active. What is the most likely cause?

  1. Option A: Copilot CLI is only available with a Copilot Enterprise plan
  2. Option B: Her organization has disabled the Copilot CLI policy
  3. Option C: The npm package requires Node.js 24 or later to run
  4. Option D: Copilot CLI can only be installed through Homebrew
Show answer and explanation

Correct answer: B. Her organization has disabled the Copilot CLI policy

Installing the CLI is only half the picture: organization and enterprise policies decide whether members may use it. On first launch the user signs in with the /login slash command, or authenticates with a fine-grained token that has the Copilot Requests permission.

  • A (incorrect)Copilot CLI is included with all Copilot plans.
  • B (correct)Correct. When Copilot comes through an organization, the Copilot CLI policy must be enabled; if an owner or enterprise admin disables it, the CLI cannot be used even with an active seat.
  • C (incorrect)The documented npm requirement is Node.js 22 or later, which she meets.
  • D (incorrect)npm, WinGet, Homebrew, an install script and direct download are all documented install methods.

Reference: GitHub Docs: Installing GitHub Copilot CLI (opens in a new tab)

Use GitHub Copilot in the IDEIntermediateDomain: Use GitHub Copilot features

Question 5. In VS Code, a developer wants Copilot to research a refactoring with read-only tools and produce an implementation plan she can approve before any file changes. Which option in the chat agents dropdown fits?

  1. Option A: Ask
  2. Option B: Agent
  3. Option C: Plan
  4. Option D: A subagent started with the runSubagent tool
Show answer and explanation

Correct answer: C. Plan

Copilot Chat in the IDE offers Ask for questions, Plan for read-only research and planning, and Agent for autonomous multi-file changes. After approving a plan you can start implementation or open the plan as a Markdown file.

  • A (incorrect)Ask answers questions and makes no code changes, but it is not designed to research the task and draft an approvable implementation plan.
  • B (incorrect)Agent decides which files to change, proposes edits and terminal commands and iterates until the task is done, which goes beyond planning first.
  • C (correct)Correct. Plan researches the task with read-only tools and drafts an implementation plan, making no code changes until the plan is approved.
  • D (incorrect)Subagents run delegated tasks in an isolated context window from Agent mode; they are not the review-before-change workflow.

Reference: GitHub Docs: Asking GitHub Copilot questions in your IDE (opens in a new tab)

Use GitHub Copilot features and capabilitiesAdvancedDomain: Use GitHub Copilot features

Question 6. A repository's branch rules require one approving review. A developer requests a review from Copilot on a pull request, with Copilot approvals left at their default setting. What happens?

  1. Option A: Copilot leaves a Comment review that does not count as an approval
  2. Option B: Copilot approves the pull request if it finds no issues, satisfying the rule
  3. Option C: Copilot's review blocks merging until a human resolves every comment
  4. Option D: Copilot automatically re-reviews after every new push
Show answer and explanation

Correct answer: A. Copilot leaves a Comment review that does not count as an approval

Copilot code review adds feedback but, by default, leaves required approvals to humans. Its behaviour can be guided with .github/copilot-instructions.md, path-specific instruction files and AGENTS.md, which it reads from the pull request's head branch.

  • A (correct)Correct. By default Copilot submits a Comment review, so it does not satisfy required approvals; Copilot approvals are off by default and must be enabled separately.
  • B (incorrect)Copilot can only submit approving reviews once approvals have been enabled at the enterprise, organization or repository level.
  • C (incorrect)Copilot's default review is comment-only; resolving its comments is not a merge requirement by default.
  • D (incorrect)Copilot only reviews new pushes when automatic review with Review new pushes is configured in a ruleset.

Reference: GitHub Docs: Using GitHub Copilot code review (opens in a new tab)

Manage organization-wide settings and policiesAdvancedDomain: Use GitHub Copilot features

Question 7. An organization owner calls DELETE /orgs/{org}/copilot/billing/selected_users to remove a user's Copilot seat. When does the user lose access?

  1. Option A: Immediately, as soon as the API call returns a success status code
  2. Option B: After a fixed 30 days, regardless of when the billing cycle ends
  3. Option C: At the end of the billing cycle, unless a team still grants a seat
  4. Option D: Never, because seats can only be removed in the web interface
Show answer and explanation

Correct answer: C. At the end of the billing cycle, unless a team still grants a seat

Seat objects carry a pending_cancellation_date so admins can see which seats are ending. If a user's seat was assigned through a team, removing the user directly fails with a 422 error and the team assignment must be changed instead.

  • A (incorrect)Removal does not end access immediately; the seat is set to pending cancellation.
  • B (incorrect)The timing follows the billing cycle, not a fixed 30-day window.
  • C (correct)Correct. The seat is marked pending cancellation and access ends at the end of the billing cycle; a user who also gets a seat through another team keeps access.
  • D (incorrect)The REST API provides endpoints to add and remove seats for users and teams.

Reference: GitHub Docs: REST API endpoints for Copilot user management (opens in a new tab)

Domain 3

Understand GitHub Copilot data and architecture

Describe data handling and flowIntermediateDomain: Understand GitHub Copilot data and architecture

Question 8. In the Copilot prompt flow described on Microsoft Learn, what is the role of the proxy server in GitHub's Azure tenant before the prompt reaches the model?

  1. Option A: It stores every prompt permanently so that suggestions can be audited later
  2. Option B: It filters traffic and blocks attempts to manipulate the prompt or system
  3. Option C: It compiles the code around the cursor to check it for syntax errors
  4. Option D: It chooses which of the open editor tabs to include as context
Show answer and explanation

Correct answer: B. It filters traffic and blocks attempts to manipulate the prompt or system

The inbound flow is secure transmission and context gathering, proxy filtering, toxicity filtering and then model generation. On the way back, post-processing checks the response again and truncates or discards anything that fails.

  • A (incorrect)The proxy's described role is filtering traffic, not long-term storage.
  • B (correct)Correct. The proxy filters traffic and blocks prompt manipulation attempts before the prompt is passed on.
  • C (incorrect)Context gathering collects surrounding code, but the proxy does not compile it.
  • D (incorrect)Context such as adjacent open tabs is gathered in the first step, together with secure transmission, before the proxy is involved.

Reference: Microsoft Learn: GitHub Copilot user prompt process flow (opens in a new tab)

Understand lifecycle and limitationsAdvancedDomain: Understand GitHub Copilot data and architecture

Question 9. A developer assumes that if Copilot shows no code reference for an accepted suggestion, the code cannot match any existing code anywhere. Why is that assumption wrong?

  1. Option A: Code referencing only runs for Copilot Chat responses, never for inline suggestions
  2. Option B: Code referencing checks only suggestions that were rejected
  3. Option C: References are shown only to enterprise owners
  4. Option D: The index excludes private and non-GitHub code and is refreshed only periodically
Show answer and explanation

Correct answer: D. The index excludes private and non-GitHub code and is refreshed only periodically

Code referencing compares a suggestion and about 150 characters of surrounding code with an index of public GitHub code. It is a useful signal for licensing review, but it has a limited scope like any detection mechanism.

  • A (incorrect)Code referencing covers IDE inline suggestions as well as chat responses on GitHub and agent session logs.
  • B (incorrect)It is accepted, unchanged suggestions that are checked, not rejected ones.
  • C (incorrect)References are shown to the user who receives the matching suggestion, where the policy allows it.
  • D (correct)Correct. The public-code index does not include private repositories or code hosted outside GitHub, and it is refreshed periodically, so no reference does not prove the code is unique.

Reference: GitHub Docs: GitHub Copilot code referencing (opens in a new tab)

Domain 4

Apply prompt engineering and context crafting

Craft effective promptsFoundationDomain: Apply prompt engineering and context crafting

Question 10. Inline suggestions in a service file keep using the wrong data model. The correct model is defined in another file that is not open, while several unrelated files are open. What should the developer try first?

  1. Option A: Open the file with the correct model and close the unrelated files
  2. Option B: Rename the service file so that Copilot treats it as a brand-new file
  3. Option C: Turn off inline suggestions and use only Copilot CLI
  4. Option D: Add more unrelated files so Copilot has a larger context
Show answer and explanation

Correct answer: A. Open the file with the correct model and close the unrelated files

Copilot uses the open files to understand what you are working on, and the Microsoft Learn prompt flow lists adjacent open tabs among the context it gathers. Steering that context is one of the easiest ways to improve suggestions.

  • A (correct)Correct. Copilot gathers context such as adjacent open tabs, and GitHub's prompt engineering guidance is to open relevant files and close irrelevant ones.
  • B (incorrect)The file name is part of the context, but renaming does not supply the missing model definition.
  • C (incorrect)Switching tools does not fix the missing context.
  • D (incorrect)Irrelevant context dilutes the useful signal rather than helping.

Reference: GitHub Docs: Prompt engineering for GitHub Copilot Chat (opens in a new tab)

Craft effective promptsIntermediateDomain: Apply prompt engineering and context crafting

Question 11. A developer asks Copilot Chat to convert log lines into a JSON structure, but the field names come out differently each time. Which prompt change applies few-shot prompting?

  1. Option A: Repeat the same request in a new thread until the output matches
  2. Option B: Shorten the request to a single sentence so that it is less ambiguous
  3. Option C: Include sample log lines, each with the exact JSON output expected
  4. Option D: Ask Copilot to be more careful
Show answer and explanation

Correct answer: C. Include sample log lines, each with the exact JSON output expected

A zero-shot prompt describes the task with no examples; a few-shot prompt adds worked examples. Examples are one of the most reliable ways to pin down a precise output format.

  • A (incorrect)Starting fresh helps when history is irrelevant, but repeating the same prompt gives Copilot no new information.
  • B (incorrect)Shorter is not the same as clearer, and it still provides no examples.
  • C (correct)Correct. Few-shot prompting gives the model examples of inputs and outputs; GitHub's guidance recommends providing example input, output and implementations.
  • D (incorrect)A vague instruction adds no concrete guidance about the expected format.

Reference: GitHub Docs: Prompt engineering for GitHub Copilot Chat (opens in a new tab)

Domain 5

Improve developer productivity with GitHub Copilot

Support testing and securityIntermediateDomain: Improve developer productivity with GitHub Copilot

Question 12. A developer wants Copilot Chat in VS Code to write unit tests for a CalculateDiscount method, cover negative and zero values, and fix obvious failures before handing back. Which approach best fits the Microsoft Learn guidance?

  1. Option A: Use Ask mode and paste the generated tests into the project by hand without running them
  2. Option B: Use Agent mode, name the method and edge cases, and ask it to run the tests
  3. Option C: Type /setupTests and accept whatever it produces
  4. Option D: Rely on ghost text alone, since generated tests always cover every scenario
Show answer and explanation

Correct answer: B. Use Agent mode, name the method and edge cases, and ask it to run the tests

Specific prompts that name the framework, the target and the conditions produce more useful tests. Even then, review the diff, run the tests and check coverage yourself before keeping them.

  • A (incorrect)Ask mode does not edit files or run tests, and skipping the test run leaves failures undetected.
  • B (correct)Correct. The module recommends naming the target and cases, and notes that asking the agent to run the tests lets it catch and fix obvious failures.
  • C (incorrect)/setupTests helps configure a test framework in a project; it does not target specific edge cases for a method.
  • D (incorrect)Learn warns that generated test cases might not cover every scenario, so they still need review.

Reference: Microsoft Learn: Generate unit tests with the GitHub Copilot Chat view (opens in a new tab)

Enhance productivity and code qualityAdvancedDomain: Improve developer productivity with GitHub Copilot

Question 13. A team wants every developer's Copilot to follow the same test conventions (framework, naming, Arrange-Act-Assert) whenever it works on test files, without repeating them in each prompt. What should they do?

  1. Option A: Ask each developer to paste the conventions into their first chat message every day
  2. Option B: Add the conventions to a content exclusion rule
  3. Option C: Put the conventions in each developer's local editor settings
  4. Option D: Commit a *.instructions.md file with applyTo: tests/**
Show answer and explanation

Correct answer: D. Commit a *.instructions.md file with applyTo: tests/**

Custom instructions turn team conventions into persistent context. Repository-wide guidance goes in .github/copilot-instructions.md, while path-specific files under .github/instructions use applyTo globs to target parts of the codebase.

  • A (incorrect)This works for one conversation but is repetitive and inconsistent across the team.
  • B (incorrect)Content exclusions stop Copilot from using files as context; they do not provide instructions.
  • C (incorrect)Local settings are not shared through source control, so the team would drift apart.
  • D (correct)Correct. Learn recommends storing test preferences in an instructions file scoped to test files with applyTo and committing it so the whole team shares it.

Reference: Microsoft Learn: Generate unit tests with the GitHub Copilot Chat view (opens in a new tab)

Domain 6

Configure privacy, content exclusions, and safeguards

Apply safeguards and troubleshootIntermediateDomain: Configure privacy, content exclusions, and safeguards

Question 14. An organization owner adds a content exclusion for "**/.env". A developer with VS Code already open still gets suggestions that seem to use values from a .env file. What is the best next step?

  1. Option A: Run Developer: Reload Window, since changes can take up to 30 minutes to reach open IDEs
  2. Option B: Ask the developer to upgrade to Copilot Pro so that exclusions apply
  3. Option C: Move the rule to the repository level, because organization rules do not apply to .env files
  4. Option D: Delete the .env file, because exclusions never work in VS Code
Show answer and explanation

Correct answer: A. Run Developer: Reload Window, since changes can take up to 30 minutes to reach open IDEs

Content exclusion stops excluded files from being used for inline suggestions and chat context. Remember it is not a replacement for operating system permissions or other access controls, and agents may not detect indirect file access.

  • A (correct)Correct. GitHub notes the delay of up to 30 minutes and says reloading the VS Code window applies the change sooner.
  • B (incorrect)Content exclusion is a Copilot Business and Enterprise feature configured by the organization; the developer's own plan is not the issue.
  • C (incorrect)Organization-level rules can target .env files with a pattern like "**/.env", including files outside Git repositories.
  • D (incorrect)VS Code is a supported IDE for content exclusion; deleting files is unnecessary.

Reference: GitHub Docs: Excluding content from GitHub Copilot (opens in a new tab)

Manage privacy settings and exclusionsFoundationDomain: Configure privacy, content exclusions, and safeguards

Question 15. A legal team wants to minimise the chance that developers accept suggestions that closely match public code on GitHub. Which safeguard addresses this directly?

  1. Option A: Configure content exclusion for the repository's source folders
  2. Option B: Enable audit log streaming to a SIEM
  3. Option C: Set the policy for suggestions matching public code to Blocked
  4. Option D: Turn on Copilot code review for all pull requests
Show answer and explanation

Correct answer: C. Set the policy for suggestions matching public code to Blocked

Copilot compares suggestions and about 150 characters of surrounding code with an index of public GitHub code. Admins can block matching suggestions, or allow them and use code referencing to see the source repositories and licences.

  • A (incorrect)Content exclusion controls what Copilot may read as context; it does not filter suggestions that match public code.
  • B (incorrect)Audit logs record plan, policy and seat events; they do not filter suggestions.
  • C (correct)Correct. Depending on policy, suggestions that match public code are either blocked or shown with information about the matching code and its licence.
  • D (incorrect)Code review comments on changes; it is not a filter for public code matches in suggestions.

Reference: GitHub Docs: GitHub Copilot code referencing (opens in a new tab)

Exam information last verified: November 4, 2026

Exam details can change. Always confirm them with the official provider before you book.

Want more practice?

15 questions are a sample. The exam is much longer.

The full CertRamp GH-300 practice exams have 6 tests that grow with you, from a diagnostic start to an exam-level Test 4 and a challenge set beyond the exam, with an explanation for every option.

Who writes the exams

Written by a practitioner, not a question mill

Joshua Ravnjak, founder of CertRamp Learning

Joshua Ravnjak

Senior Consultant, digital transformation and AI

Founder, CertRamp Learning

921 learners and 61 reviews on Udemy (as of November 3, 2026)

I have more than 12 years of professional experience and work as a senior consultant in an IT management consultancy, focusing on digital transformation, AI and requirements engineering in the insurance industry. I have earned many certifications myself, so I know what exam preparation feels like. That is why every CertRamp practice exam follows the same progression: an easy start to see where you stand, then real exam level, then beyond it. You walk into the exam with a buffer and a good feeling.

Selected certifications

  • IREB® CPRE Foundation Level
  • ITIL® 4 Foundation
  • Professional Scrum Master I (PSM I)
  • Professional Scrum Product Owner I (PSPO I)
  • Certified SAFe® 6 Scrum Master
  • Certified AI-Empowered SAFe® 6 Product Owner/Product Manager

Plus further certifications from Microsoft and Anthropic (Claude).

ITIL® is a registered trademark of PeopleCert. IREB® is a registered trademark of IREB e.V. SAFe® is a registered trademark of Scaled Agile, Inc. PSM and PSPO are trademarks of Scrum.org.

Also in print

Cover: CPRE Foundation Level Prüfungsvorbereitung 2026 by Joshua Ravnjak

CPRE Foundation Level Prüfungsvorbereitung 2026

6 Übungsprüfungen mit 270 Fragen und ausführlichen Erklärungen

Paperback, German, October 2026

My CPRE Foundation Level exam-prep book (in German) follows the same progressive approach.

View on Amazon (opens in a new tab)