# Free GH-300 practice questions

> 10 free GH-300 practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/github-gh-300/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/github-gh-300/

### Question 1 of 10

A team uses Copilot Chat to generate a function that ranks job applicants by parsing resumes. Which mitigation BEST addresses the risk of the generated logic treating candidates unfairly?

- A. Switch Copilot Chat to a different model in the model picker so that the answer is generated without training data
- B. Add the resume parser source folder to content exclusions so Copilot cannot read the candidate data
- C. Set the public code filter to Block so that the ranking logic cannot match any open-source implementation
- D. Review the ranking criteria for proxies of protected attributes and test outcomes across diverse sample profiles

**Answer:** D

**Explanation:** Bias in AI-generated logic is mitigated by human review of the criteria and by testing outcomes across varied inputs to detect unfair treatment. The public code filter addresses license and duplication concerns, not fairness; every model is trained on data so switching models does not remove bias; and content exclusions control what context Copilot reads, not whether the generated ranking is fair.

### Question 2 of 10 (choose 2)

Your organization adopts the Microsoft Responsible AI principles for its Copilot rollout. A policy states that developers must be able to explain how AI-assisted changes were produced and that a named engineer signs off on every merge. Which TWO principles does this policy primarily address? (Choose two.)

- A. Fairness
- B. Reliability and safety
- C. Inclusiveness
- D. Transparency
- E. Accountability

**Answer:** D, E

**Explanation:** Requiring a named engineer to own each merge reflects accountability, and requiring developers to explain how AI-assisted changes were produced reflects transparency. Inclusiveness concerns empowering people of all abilities, fairness concerns avoiding biased treatment of groups, and reliability and safety concerns consistent, safe operation; none of these is the main focus of the stated policy.

### Question 3 of 10

A team runs Copilot CLI in a script and wants it to be able to run git commands without prompting, while never being allowed to run rm. Which configuration meets this requirement with the LEAST privilege?

- A. Add the project folder to the trusted folders list, which auto-approves git commands but nothing else
- B. Pass --deny-tool 'shell(git)' and approve rm manually at the first prompt
- C. Pass --allow-all-tools and rely on the trusted-folder prompt to block rm
- D. Start the CLI with the options --allow-tool 'shell(git)' and --deny-tool 'shell(rm)'

**Answer:** D

**Explanation:** The --allow-tool and --deny-tool options let you pre-approve specific tools such as shell(git) and explicitly block others such as shell(rm), giving narrow permissions. --allow-all-tools grants everything, the trusted-folder prompt controls which directories Copilot can work in rather than which commands run, and denying git is the opposite of the requirement.

### Question 4 of 10

A team wants every Copilot Chat response in their repository to assume TypeScript strict mode, the team's logging library, and Vitest for tests, without each developer repeating this in prompts. What should they add?

- A. A CODEOWNERS entry that assigns the Copilot bot to the source folder
- B. A .github/prompts/conventions.prompt.md file that developers run manually
- C. A .copilotignore file listing the files that use other conventions
- D. A .github/copilot-instructions.md file describing these conventions

**Answer:** D

**Explanation:** Repository custom instructions in .github/copilot-instructions.md are automatically added to chat requests in that repository, giving consistent context. A prompt file must be invoked explicitly, so it would not apply automatically; .copilotignore is not a supported Copilot mechanism; and CODEOWNERS controls review assignment, not Copilot context.

### Question 5 of 10

A developer uses Copilot CLI and wants it to run a single prompt non-interactively in a CI script and print the result. Which approach should they use?

- A. Run copilot with the -p option followed by the prompt text
- B. Run gh copilot explain with the prompt in quotes
- C. Run copilot --resume and paste the prompt when asked
- D. Run copilot and type /delegate followed by the prompt text

**Answer:** A

**Explanation:** Copilot CLI supports a programmatic mode where copilot -p "prompt" executes one prompt and exits, suitable for scripts. /delegate hands work to Copilot coding agent from an interactive session, gh copilot explain was part of the retired GitHub CLI extension, and --resume reopens a previous interactive session.

### Question 6 of 10

Arrange the general flow of a Copilot inline suggestion. Which sequence is correct?

- A. Proxy filters prompt; IDE gathers context; post-processing filters; model generates; suggestion shown
- B. IDE gathers context and builds prompt; proxy filters prompt; model generates; post-processing filters; suggestion shown
- C. Model generates; IDE gathers context and builds prompt; proxy filters prompt; suggestion shown; post-processing filters
- D. IDE gathers context; model generates; suggestion shown; proxy filters prompt; post-processing filters

**Answer:** B

**Explanation:** The client first gathers context and constructs a prompt, the proxy screens it, the model generates a completion, post-processing applies filters such as toxicity and public code matching, and then the suggestion is displayed. The other sequences place generation before context gathering or filtering after display, which does not match the pipeline.

### Question 7 of 10

A developer wonders why Copilot suggested a variable name that appears only in another open tab and not in the current file. Which part of the prompt-building process explains this?

- A. The proxy service rewrites suggestions to reuse identifiers found in recent commits
- B. The model was retrained overnight on the developer's local workspace and memorized the variable name
- C. The public code filter substitutes local identifiers for matching public identifiers
- D. Snippets from neighboring open files are ranked by similarity and included as context

**Answer:** D

**Explanation:** The client looks at other open files, ranks snippets by relevance to the code at the cursor, and includes the best ones in the prompt, which is how identifiers from other tabs appear. There is no overnight retraining, the proxy does not rewrite identifiers from commits, and the public code filter suppresses matches rather than substituting names.

### Question 8 of 10

A developer builds a multi-turn conversation: first asking Copilot to design a schema, then to generate a repository layer, then tests. On the fourth turn Copilot forgets a field defined in turn one. What is the MOST likely cause and fix?

- A. Older turns may be trimmed as history grows; restate key details or reference the schema file
- B. Copilot only keeps the very first message of a conversation; delete the later turns and ask again
- C. Chat history is sent only for slash commands; prefix every message with /explain to keep context
- D. The model's knowledge cutoff hides newly defined fields; wait for the next model update to include it

**Answer:** A

**Explanation:** As conversations grow, older history can be trimmed or condensed to fit the context window, so restating key facts or referencing the schema file restores them. Copilot does not keep only the first message, knowledge cutoff is unrelated to fields defined in the chat, and history is not limited to slash commands.

### Question 9 of 10

Copilot generated tests for a function that parses currency strings, and all tests pass. A reviewer suspects the tests only mirror the implementation. What should the developer do?

- A. Delete the tests, since tests written by Copilot cannot ever detect any real defect
- B. Write assertions from the specification with known expected values, including invalid formats
- C. Increase the code coverage target to 100 percent and keep all of the existing assertions unchanged
- D. Ask Copilot to regenerate the implementation so that it matches the passing tests

**Answer:** B

**Explanation:** Tests derived from the implementation can encode its bugs; assertions based on the specification with known expected values, including invalid input, test real behavior. Generated tests can be valuable, coverage alone does not validate correctness, and changing the code to fit the tests reverses the purpose of testing.

### Question 10 of 10

Copilot suggestions stop working for all developers behind a corporate proxy after a firewall change, while GitHub.com browsing still works. What is the MOST likely fix?

- A. Reassign every developer's Copilot seat so that their licenses are refreshed after the change
- B. Allow the Copilot endpoints through the firewall and set the IDE proxy and certificates
- C. Turn on the public code filter so that suggestions are served from GitHub's public cache
- D. Remove all content exclusion rules, because exclusions block Copilot requests sent through corporate proxies

**Answer:** B

**Explanation:** Copilot needs network access to specific service domains, so a firewall change must allow them, and IDEs may need proxy and custom certificate settings. Seat reassignment does not fix network blocks, content exclusions are unrelated to proxies, and the public code filter does not change where suggestions come from.

Ready for a timed run? Take the free 15-question GH-300 mini exam: https://devopscodelab.com/app/exams/github-gh-300/mini/

DevOpsCode Lab is not affiliated with GitHub. GH-300 and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
