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.

  1. Question 1Single choiceTopic 1
    How does GitHub Copilot Chat utilize its training data and external sources to generate responses when answering coding questions?
    1. A
      It primarily relies on the model’s training data to generate responses.
    2. B
      It combines its training data set, code in user repositories, and external sources like Bing to generate responses.
    3. C
      It uses user-provided documentation and exclusively to generate responses.
    4. D
      It primarily uses search results from Bing to generate responses.
    Show answer

    Correct answer: B

    Why

    Copilot 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.

  2. Question 2Single choiceTopic 1
    How can the concept of fairness be integrated into the process of operating an AI tool?
    1. A
      Focusing on accessibility will ensure fairness.
    2. B
      Training AI data and algorithms to be free from biases will ensure fairness.
    3. C
      Regularly monitoring the AI tool’s performance will ensure fairness in its outputs.
    4. D
      Focusing on collecting large datasets for training will ensure fairness.
    Show answer

    Correct answer: B

    Why

    Fairness 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.

  3. Question 3Multiple responseTopic 2
    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.)
    1. A
      The API can generate detailed reports on code quality improvements made by GitHub Copilot.
    2. B
      The API can track the number of code suggestions accepted and used in the organization.
    3. C
      The API can provide feedback on coding style and standards compliance.
    4. D
      The API can provide Copilot Chat specific suggestions acceptance metrics.
    5. E
      The API can refactor your code to improve productivity.
    Show answer

    Correct answer: B, D

    Why

    The 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.

  4. Question 4Multiple responseTopic 2
    What reasons could apply if code suggestions are not working in your editor? (Choose three.)
    1. A
      You do not have an active internet connection
    2. B
      Your programming language is not supported
    3. C
      You are working in files included in your .gitignore
    4. D
      You do not have a valid GitHub Copilot license
    5. E
      Your content exclusion is active and blocks the use of GitHub Copilot
    Show answer

    Correct answer: A, D, E

    Why

    Suggestions 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.

  5. Question 5Multiple responseTopic 3
    Identify the steps involved in the life cycle of a GitHub Copilot code suggestion? Each correct answer presents part of the solution. (Choose two.)
    1. A
      Processing telemetry data
    2. B
      Generate suggestions
    3. C
      Retraining the model
    4. D
      Storing user data
    5. E
      Capturing the user’s context
    Show answer

    Correct answer: B, E

    Why

    A 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.

  6. Question 6Single choiceTopic 3
    Where is the proxy service hosted?
    1. A
      Amazon Web Service
    2. B
      Self hosted
    3. C
      Microsoft Azure
    4. D
      Google Cloud Platform
    Show answer

    Correct answer: C

    Why

    The 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.

  7. Question 7Single choiceTopic 4
    Select a strategy to increase the performance of GitHub Copilot Chat.
    1. A
      Use a single GitHub Copilot Chat query to find resolutions for the collection of technical requirements
    2. B
      Optimize the usage of memory-intensive operations within generated code
    3. C
      Apply prompt engineering techniques to be more specific
    4. D
      Limit the number of concurrent users accessing GitHub Copilot Chat
    Show answer

    Correct answer: C

    Why

    The 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.

  8. Question 8Single choiceTopic 4
    What is few-shot prompting?
    1. A
      Telling GitHub Copilot to try multiple times to answer the prompt
    2. B
      Telling GitHub Copilot to iterate several times on the answer before returning it to you
    3. C
      Telling GitHub Copilot from which sources it should base the response on
    4. D
      Telling GitHub Copilot about the mechanism you want it to use and how to incorporate that into the response
    Show answer

    Correct answer: D

    Why

    Few-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.

  9. Question 9Single choiceTopic 5
    In what ways can GitHub Copilot contribute to the design phase of the Software Development Life Cycle (SDLC)?
    1. A
      GitHub Copilot can generate user interface (UI) prototypes without prompting.
    2. B
      GitHub Copilot can suggest design patterns and best practices relevant to the project.
    3. C
      GitHub Copilot can independently create a complete software design.
    4. D
      GitHub Copilot can manage design team collaboration and version control.
    Show answer

    Correct answer: B

    Why

    In 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.

  10. Question 10Single choiceTopic 5
    How does GitHub Copilot assist developers in reducing the amount of manual boilerplate code they write?
    1. A
      By refactoring the entire codebase to eliminate boilerplate code without developer input.
    2. B
      By suggesting code snippets that can be reused across different parts of the project.
    3. C
      By engaging in real-time collaboration with multiple developers to write boilerplate code.
    4. D
      By predicting future coding requirements and pre-emptively generating boilerplate code
    Show answer

    Correct answer: B

    Why

    Copilot 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.

  11. Question 11Single choiceTopic 6
    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?
    1. A
      By using a specific slash command in the prompt.
    2. B
      By using a specific command in the terminal.
    3. C
      By using a specific setting in GitHub Copilot’s configuration.
    4. D
      By using specific prompt examples in your chat request.
    Show answer

    Correct answer: D

    Why

    To 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.

  12. Question 12Single choiceTopic 6
    When using GitHub Copilot to identify missing tests in your codebase, which of the following is the most important factor to consider?
    1. A
      Having a high test coverage percentage in the codebase.
    2. B
      Using well-known coding practices in your repository.
    3. C
      Ensuring that the correct context is available to GitHub Copilot.
    4. D
      Close all the tabs in your IDE that do not have tests in them.
    Show answer

    Correct answer: C

    Why

    Copilot 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.

  13. Question 13Single choiceTopic 6
    When using GitHub Copilot Chat to generate unit tests, which slash command would you use?
    1. A
      /create-tests
    2. B
      /generate-tests
    3. C
      /tests
    4. D
      /init-tests
    Show answer

    Correct answer: C

    Why

    The /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.

  14. Question 14Single choiceTopic 7
    What GitHub Copilot configuration needs to be enabled to protect against IP infringements?
    1. A
      Blocking license check configuration
    2. B
      Blocking public code matches
    3. C
      Allowing license check configuration
    4. D
      Allowing public code matches
    Show answer

    Correct answer: B

    Why

    To 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.

  15. Question 15Single choiceTopic 7
    What GitHub Copilot feature can be configured at the organization level to prevent GitHub Copilot suggesting publicly available code snippets?
    1. A
      GitHub Copilot Chat in the IDE
    2. B
      GitHub Copilot access to Bing
    3. C
      GitHub Copilot duplication detection filter
    4. D
      GitHub Copilot Chat in GitHub Mobile
    Show answer

    Correct answer: C

    Why

    The 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.