GH-300 sample exam questions
15 exam-style questions for Microsoft GH-300: GitHub Copilot, with answers and explanations. Take them as a timed practice exam first if you want a score out of 1000.
- How does GitHub Copilot Chat utilize its training data and external sources to generate responses when answering coding questions?
- AIt primarily relies on the model’s training data to generate responses.
- BIt combines its training data set, code in user repositories, and external sources like Bing to generate responses.
- CIt uses user-provided documentation and exclusively to generate responses.
- DIt primarily uses search results from Bing to generate responses.
Show answer
Correct answer: B
WhyCopilot Chat combines the model's training data with context from your code and repositories, and can use external sources such as Bing web search for up-to-date answers. It does not rely only on training data, only user documentation, or primarily on Bing results.
- A
- How can the concept of fairness be integrated into the process of operating an AI tool?
- AFocusing on accessibility will ensure fairness.
- BTraining AI data and algorithms to be free from biases will ensure fairness.
- CRegularly monitoring the AI tool’s performance will ensure fairness in its outputs.
- DFocusing on collecting large datasets for training will ensure fairness.
Show answer
Correct answer: B
WhyFairness is built in by training on data and algorithms that are checked and corrected for bias, so the system does not treat groups differently. Monitoring (C) helps detect issues but does not by itself ensure fairness; accessibility relates to inclusiveness, and large datasets can still be biased.
- A
- What kind of insights can the GitHub Copilot usage metrics API provide to help evaluate the effectiveness of GitHub Copilot? Each correct answer presents part of the solution. (Choose two.)
- AThe API can generate detailed reports on code quality improvements made by GitHub Copilot.
- BThe API can track the number of code suggestions accepted and used in the organization.
- CThe API can provide feedback on coding style and standards compliance.
- DThe API can provide Copilot Chat specific suggestions acceptance metrics.
- EThe API can refactor your code to improve productivity.
Show answer
Correct answer: B, D
WhyThe Copilot usage metrics API reports counts such as code suggestions shown and accepted, active users, and Copilot Chat interactions and acceptances, broken down by language and editor. It does not grade code quality, check style compliance, or refactor code.
- A
- What reasons could apply if code suggestions are not working in your editor? (Choose three.)
- AYou do not have an active internet connection
- BYour programming language is not supported
- CYou are working in files included in your .gitignore
- DYou do not have a valid GitHub Copilot license
- EYour content exclusion is active and blocks the use of GitHub Copilot
Show answer
Correct answer: A, D, E
WhySuggestions stop when there is no internet connection (Copilot runs in the cloud), when you lack a valid Copilot license or seat, or when content exclusion blocks the file. Files in .gitignore still get suggestions, and Copilot works with essentially all languages, so B is weaker.
- A
- Identify the steps involved in the life cycle of a GitHub Copilot code suggestion? Each correct answer presents part of the solution. (Choose two.)
- AProcessing telemetry data
- BGenerate suggestions
- CRetraining the model
- DStoring user data
- ECapturing the user’s context
Show answer
Correct answer: B, E
WhyA code suggestion's life cycle starts by capturing the user's context (code around the cursor, open files, the prompt), building a prompt, and then generating suggestions with the model before filtering and returning them. Retraining the model, storing user data, and telemetry processing are not part of producing a suggestion.
- A
- Where is the proxy service hosted?
- AAmazon Web Service
- BSelf hosted
- CMicrosoft Azure
- DGoogle Cloud Platform
Show answer
Correct answer: C
WhyThe GitHub Copilot proxy service, which receives prompts, applies filters and forwards requests to the model, is hosted in Microsoft Azure. It is not hosted on AWS or Google Cloud and cannot be self-hosted.
- A
- Select a strategy to increase the performance of GitHub Copilot Chat.
- AUse a single GitHub Copilot Chat query to find resolutions for the collection of technical requirements
- BOptimize the usage of memory-intensive operations within generated code
- CApply prompt engineering techniques to be more specific
- DLimit the number of concurrent users accessing GitHub Copilot Chat
Show answer
Correct answer: C
WhyThe most effective way to get better results from Copilot Chat is prompt engineering: be specific, give context and examples, and break problems into smaller questions. A single query for many requirements gives weaker answers, and limiting users or memory use in generated code does not affect Chat quality.
- A
- What is few-shot prompting?
- ATelling GitHub Copilot to try multiple times to answer the prompt
- BTelling GitHub Copilot to iterate several times on the answer before returning it to you
- CTelling GitHub Copilot from which sources it should base the response on
- DTelling GitHub Copilot about the mechanism you want it to use and how to incorporate that into the response
Show answer
Correct answer: D
WhyFew-shot prompting gives the model a few examples showing the pattern or mechanism you want, so it applies that approach in its response. It is not asking Copilot to retry or iterate multiple times, nor specifying which sources to use.
- A
- In what ways can GitHub Copilot contribute to the design phase of the Software Development Life Cycle (SDLC)?
- AGitHub Copilot can generate user interface (UI) prototypes without prompting.
- BGitHub Copilot can suggest design patterns and best practices relevant to the project.
- CGitHub Copilot can independently create a complete software design.
- DGitHub Copilot can manage design team collaboration and version control.
Show answer
Correct answer: B
WhyIn the design phase, Copilot Chat can suggest suitable design patterns, architectures and best practices for the project's requirements. It does not create UI prototypes without prompting, produce a complete design independently, or manage team collaboration and version control.
- A
- How does GitHub Copilot assist developers in reducing the amount of manual boilerplate code they write?
- ABy refactoring the entire codebase to eliminate boilerplate code without developer input.
- BBy suggesting code snippets that can be reused across different parts of the project.
- CBy engaging in real-time collaboration with multiple developers to write boilerplate code.
- DBy predicting future coding requirements and pre-emptively generating boilerplate code
Show answer
Correct answer: B
WhyCopilot reduces boilerplate by suggesting repetitive code, such as constructors, mappings or test scaffolding, based on patterns in your project. It does not refactor the whole codebase without input, collaborate with multiple developers in real time, or predict future requirements.
- A
- When using GitHub Copilot Chat to generate boilerplate code for various test types, how can you guide the AI to follow the testing standards of your company?
- ABy using a specific slash command in the prompt.
- BBy using a specific command in the terminal.
- CBy using a specific setting in GitHub Copilot’s configuration.
- DBy using specific prompt examples in your chat request.
Show answer
Correct answer: D
WhyTo follow company testing standards, include specific examples or explicit requirements of your standards in the chat prompt so Copilot mirrors them. A slash command like /tests alone does not know your standards, and no terminal command applies them. Custom instructions files are now another option.
- A
- When using GitHub Copilot to identify missing tests in your codebase, which of the following is the most important factor to consider?
- AHaving a high test coverage percentage in the codebase.
- BUsing well-known coding practices in your repository.
- CEnsuring that the correct context is available to GitHub Copilot.
- DClose all the tabs in your IDE that do not have tests in them.
Show answer
Correct answer: C
WhyCopilot can only spot missing tests if it sees the relevant code, so the key factor is giving it the right context: open the source and test files, select code, or reference files with #file or @workspace. Closing other tabs removes context, and existing coverage is not the deciding factor.
- A
- When using GitHub Copilot Chat to generate unit tests, which slash command would you use?
- A/create-tests
- B/generate-tests
- C/tests
- D/init-tests
Show answer
Correct answer: C
WhyThe /tests slash command asks Copilot Chat to generate unit tests for the selected code. Commands such as /create-tests, /generate-tests or /init-tests do not exist.
- A
- What GitHub Copilot configuration needs to be enabled to protect against IP infringements?
- ABlocking license check configuration
- BBlocking public code matches
- CAllowing license check configuration
- DAllowing public code matches
Show answer
Correct answer: B
WhyTo reduce the risk of IP or license infringement, set the suggestions matching public code policy to Block, so Copilot suppresses suggestions that match public code. Allowing public code matches does the opposite, and there is no license check configuration setting.
- A
- What GitHub Copilot feature can be configured at the organization level to prevent GitHub Copilot suggesting publicly available code snippets?
- AGitHub Copilot Chat in the IDE
- BGitHub Copilot access to Bing
- CGitHub Copilot duplication detection filter
- DGitHub Copilot Chat in GitHub Mobile
Show answer
Correct answer: C
WhyThe duplication detection filter (the suggestions matching public code policy) can be set to Block at the organization level so Copilot does not suggest code matching public code on GitHub. Chat in the IDE or on GitHub Mobile and Bing access are unrelated policies.
- A