GitHub Copilot study materials
GitHub Copilot study resources

GitHub Copilot practice questions

One question at a time. Build your GitHub Copilot understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Use GitHub Copilot Responsibly

Which GitHub Copilot feature setting most directly reduces the risk of suggestions matching publicly available code verbatim?

  1. Increasing the inline suggestion delay in the editor
  2. Enabling the duplicate detection filter that blocks suggestions matching public code Correct answer.
  3. Disabling the Copilot chat panel for the repository
  4. Turning on the agent mode toggle in the chat panel

Explanation

GitHub Copilot includes a duplication detection filter that, when enabled, suppresses suggestions matching publicly available code on GitHub. Organizations can enforce this at the policy level so members cannot disable it. The other settings affect workflow or latency, not provenance risk.

Question 2Use GitHub Copilot Responsibly

A developer pastes a proprietary algorithm into Copilot Chat and asks for an optimization. Which responsible-use concern is most relevant?

  1. The prompt content leaves the local editor and is processed under the organization's data retention and telemetry policies Correct answer.
  2. The pasted code will be published to a public gist automatically
  3. Chat responses are always shorter than inline completions
  4. Copilot Chat will silently rewrite the file on disk without confirmation

Explanation

Chat prompts, including pasted code, are sent to the service for processing and are governed by the plan's data handling, retention, and telemetry terms. Developers should confirm their organization's policy before sharing sensitive or proprietary code in prompts. The other options describe behaviors Copilot does not perform.

Question 3Use GitHub Copilot Responsibly

What is the primary purpose of a content exclusion configured in GitHub Copilot settings?

  1. To force Copilot to generate suggestions only in those paths
  2. To block developers from opening those files in the editor
  3. To encrypt the excluded files at rest in the repository
  4. To prevent Copilot from using the contents of specified files or repositories when generating suggestions Correct answer.

Explanation

Content exclusion tells Copilot which files or repositories should not be used as context for suggestions. It is a context-restriction control for sensitive material, not an access-control or encryption mechanism. Excluded files remain readable by developers with normal permissions.

Question 4Use GitHub Copilot Responsibly

Which statement best describes the developer's responsibility when accepting a Copilot suggestion?

  1. The developer owns the code and must review it for correctness, security, and license suitability before committing Correct answer.
  2. GitHub reviews every accepted suggestion before it reaches the repository
  3. Suggestions are pre-approved for production because they compile
  4. Accepting a suggestion transfers authorship and liability to GitHub

Explanation

Copilot is an assistive tool; the developer remains accountable for the code they commit. That means reviewing logic, security implications, and licensing fit rather than trusting the suggestion. GitHub does not gate individual accepted suggestions, and compiling does not establish correctness or safety.

Question 5Use GitHub Copilot Responsibly

Which practice best limits the chance that Copilot suggests code copied from a licensed open-source project you did not intend to use?

  1. Increase the maximum suggestion count in settings
  2. Keep the public-code matching filter enabled and review suggestions with unusually specific comments or identifiers Correct answer.
  3. Ask Copilot to generate the entire module in one prompt
  4. Disable the chat feature and rely only on inline completions

Explanation

The matching filter is the built-in guard against verbatim public code, and human review catches suspiciously specific fragments. Requesting whole modules in one prompt increases volume without improving provenance. Disabling chat does not affect inline suggestion provenance.

Question 6Use GitHub Copilot Responsibly

An organization wants to guarantee that no member can turn off the public-code matching filter. What should an administrator do?

  1. Ask each developer to sign a written pledge
  2. Set the matching-filter policy at the organization level so member settings cannot override it Correct answer.
  3. Remove Copilot Chat from the organization's plan
  4. Enable agent mode for all members

Explanation

Organization-level policies take precedence over individual user settings, so members cannot disable a control the admin has enforced. Informal pledges are unenforceable, and unrelated feature toggles do not affect the filter. This is the standard way to make a responsible-use control durable.

Question 7Use GitHub Copilot Responsibly

Why should developers avoid including secrets such as API keys in a Copilot Chat prompt?

  1. Copilot automatically posts prompts to the repository's issue tracker
  2. Chat encrypts prompts with a key the developer must supply
  3. Prompt content may be retained or logged under the plan's data policies, so a leaked secret may persist beyond the session Correct answer.
  4. Secrets in prompts cause Copilot to refuse all future suggestions

Explanation

Prompts are processed by the service and may be subject to retention, logging, or telemetry depending on the plan and configuration. Treating prompts as potentially durable records means secrets should be redacted or replaced with placeholders. Copilot does not publish prompts to issue trackers or require developer-supplied keys.

Question 8Use GitHub Copilot Responsibly

Which action best reflects responsible use when Copilot generates a security-sensitive function such as password hashing?

  1. Assume the suggestion is safe if it contains no obvious typos
  2. Verify the implementation against established guidance and test it before merging Correct answer.
  3. Merge it immediately because Copilot is trained on security code
  4. Replace the function with a comment describing the intent

Explanation

Security-critical code demands independent verification against authoritative guidance and testing, regardless of how it was generated. Training data does not guarantee current or correct practice. Replacing code with a comment or relying on superficial checks leaves the requirement unmet.

Question 9Use GitHub Copilot Responsibly

A team wants Copilot suggestions to stop appearing in files that contain customer PII. Which control addresses this directly?

  1. Configure content exclusion for those file paths at the organization or repository level Correct answer.
  2. Add the PII files to .gitignore
  3. Turn off inline suggestions for the whole organization
  4. Ask developers to close those files while typing

Explanation

Content exclusion is designed to keep specified files from being used as Copilot context, which directly addresses sensitive content like PII. Organization-level configuration makes it consistent across the team. The other actions either rely on discipline or affect unrelated behavior.

Question 10Use GitHub Copilot Responsibly

Which scenario is the clearest violation of responsible Copilot use?

  1. Committing an accepted suggestion that contains a hardcoded credential without review Correct answer.
  2. Using Copilot to draft unit tests for existing code
  3. Requesting a refactor of a small helper method
  4. Asking Copilot to explain an unfamiliar function

Explanation

Accepting and committing unreviewed code that embeds a credential creates a real security exposure and bypasses the developer's review duty. The other options are ordinary, low-risk assistive uses. Responsibility hinges on review and handling of sensitive material, not on using the tool.

Question 11Use GitHub Copilot Responsibly

How does enabling the public-code matching filter affect the developer's review obligations?

  1. It removes the need for any license review because matches are blocked
  2. It only applies to chat responses, not inline suggestions
  3. It guarantees all suggestions are original to the developer
  4. It reduces but does not eliminate provenance risk, so review for licensing and correctness is still required Correct answer.

Explanation

The filter suppresses suggestions that match public code, but near-matches, paraphrases, and non-public licensed code can still appear. Developers must still review for licensing and correctness. The filter applies broadly and does not certify originality.

Question 12Use GitHub Copilot Responsibly

A developer is unsure whether a repository's license permits reusing a Copilot-suggested snippet. What is the most responsible next step?

  1. Rewrite variable names and treat the result as original
  2. Commit the snippet and address licensing only if a complaint arises
  3. Assume permissive licensing because the snippet is short
  4. Treat the snippet as potentially encumbered and confirm licensing with the appropriate owner before use Correct answer.

Explanation

Uncertainty about licensing should be resolved before the code enters the codebase, typically by consulting the organization's open-source or legal reviewers. Short length and cosmetic renaming do not settle license obligations. Reactive handling shifts risk onto the organization.

Question 13Use GitHub Copilot Responsibly

Which configuration best supports an audit requirement that Copilot usage in an enterprise be attributable to named users?

  1. Share a single service account among the whole team
  2. Manage access through the enterprise or organization with seats assigned to individual accounts and audit logging enabled Correct answer.
  3. Disable all logging to protect developer privacy
  4. Allow personal Copilot accounts to be used for company work

Explanation

Attribution requires individual seats tied to named accounts plus audit logging that records activity. Shared accounts destroy attribution, and personal accounts bypass organizational controls. Disabling logging removes the evidence an audit needs.

Question 14Use GitHub Copilot Responsibly

Why is it risky to let Copilot generate a database migration that drops a column, without review?

  1. Migrations are excluded from all Copilot suggestions by default
  2. Generated code can be plausible but wrong, and destructive operations require human verification of intent and impact Correct answer.
  3. Database changes are always reverted automatically
  4. Copilot cannot produce SQL of any kind

Explanation

Copilot produces plausible-looking code that may not match the actual schema or intent, and destructive operations carry irreversible consequences. Human review confirms intent, dependencies, and rollback plans. Copilot can generate SQL, and no automatic revert exists.

Question 15Use GitHub Copilot Responsibly

Which statement about Copilot and intellectual property indemnity is most accurate for a business user?

  1. Indemnity applies to all plans and all suggestion types without conditions
  2. Indemnity coverage depends on the plan and its terms, including conditions such as the matching filter being enabled Correct answer.
  3. Indemnity covers code the developer writes by hand
  4. Indemnity means the developer no longer needs to review suggestions

Explanation

Indemnity is a contractual benefit whose scope and conditions vary by plan and are defined in the terms of service. Conditions commonly include keeping the public-code filter enabled. It does not remove review duties or extend to hand-written code.

Question 16Use GitHub Copilot Responsibly

A developer wants to use Copilot on a side project while employed at a company with a Copilot policy. Which approach aligns with responsible use?

  1. Paste work code into a personal account to test ideas
  2. Follow the employer's policy for work code and keep personal and work contexts separate Correct answer.
  3. Use the work account for personal projects because it has better features
  4. Disable the matching filter on the work account to speed up personal work

Explanation

Employer policy governs work code, and mixing contexts risks exposing proprietary material and breaching terms. Using work accounts or pasting work code into personal accounts blurs that boundary. Separation of contexts is the defensible practice.

Question 17Use GitHub Copilot Responsibly

Which practice best mitigates prompt-injection risk when Copilot processes content from untrusted sources such as issue text?

  1. Trust the fetched content because Copilot filters malicious text perfectly
  2. Grant Copilot broad permissions so it can complete tasks unattended
  3. Treat instructions embedded in fetched content as untrusted data and review any resulting changes before applying them Correct answer.
  4. Disable all code review for AI-generated changes

Explanation

Untrusted content can contain instructions that attempt to steer the assistant, so developers should treat such text as data and review resulting actions. No filter is perfect, and unattended broad permissions increase blast radius. Review remains the key control.

Question 18Use GitHub Copilot Responsibly

What is the main responsible-use reason to keep Copilot-generated tests under human review?

  1. Tests are automatically excluded from Copilot context
  2. Copilot cannot generate assertions
  3. Reviewed tests run slower than unreviewed ones
  4. Tests can encode the same misunderstanding as the implementation, giving false confidence in correctness Correct answer.

Explanation

If a model misunderstands the requirement, it may write tests that assert the same wrong behavior, so the suite passes while the bug persists. Human review checks that tests express intended behavior. Generation capability and runtime speed are unrelated to this risk.

Question 19Use GitHub Copilot Responsibly

An organization enables content exclusion but a developer reports Copilot still suggests code resembling an excluded file's contents. What is the most likely explanation?

  1. Exclusion only applies to chat, never to inline suggestions
  2. Content exclusion is a global kill switch that disables Copilot entirely
  3. Exclusion deletes the file from the repository
  4. Exclusion prevents that content from being used as context, but Copilot may still produce similar output from its general training Correct answer.

Explanation

Content exclusion restricts what is sent as context; it does not guarantee that similar code will never be generated from model knowledge. It is a context control, not a global disable or file deletion. Understanding this distinction prevents false expectations about the safeguard.

Question 20Use GitHub Copilot Responsibly

Which combination best balances productivity and responsible use for a regulated team adopting Copilot?

  1. Personal accounts with no organizational policy
  2. A shared account with logging disabled to protect privacy
  3. Individual seats with audit logging, content exclusion for sensitive paths, an enforced matching-filter policy, and a documented review process Correct answer.
  4. Organization-wide inline suggestions disabled for everyone

Explanation

Layered controls address attribution, sensitive context, provenance, and human review together, which is what regulated environments need. Shared or personal accounts break attribution and policy, while disabling suggestions entirely forfeits the productivity benefit without addressing the specific risks.

Question 21Use GitHub Copilot Responsibly

A developer notices Copilot suggesting a block that closely resembles a known GPL-licensed library while the filter is enabled. What is the most defensible response?

  1. Assume the filter guarantees the code is unencumbered and proceed
  2. Rename the functions and merge without further checks
  3. Publish the snippet publicly to establish prior art
  4. Treat the similarity as a licensing question, stop, and consult the organization's open-source review before using it Correct answer.

Explanation

The filter targets matches against public code but cannot certify that a suggestion is free of license obligations, and close resemblance warrants review. Proceeding on the assumption of safety or making cosmetic changes does not resolve license risk. Publishing the snippet creates additional exposure.

Question 22Use GitHub Copilot Responsibly

Which reasoning best explains why 'it compiles and tests pass' is insufficient justification for merging Copilot-generated code in a security-sensitive service?

  1. Tests are never generated by Copilot
  2. Merging is only permitted for hand-written code
  3. Compilation proves the code was written by a human
  4. Passing tests only reflect the behaviors tested and cannot establish absence of vulnerabilities or policy compliance Correct answer.

Explanation

Tests validate the scenarios they encode; they do not prove the absence of vulnerabilities, insecure defaults, or licensing issues. Security review and policy checks address dimensions that tests do not cover. Compilation and authorship are separate concerns.

Question 23Use GitHub Copilot Responsibly

A team lead wants evidence that responsible-use controls are working across the organization. Which set of signals is most relevant?

  1. The count of repositories created this quarter
  2. The number of suggestions accepted per developer per day
  3. The average length of chat responses
  4. Audit logs of seat activity, records of enforced policy settings, and tracked review outcomes for AI-assisted changes Correct answer.

Explanation

Responsible-use evidence comes from attribution logs, proof that policies are enforced rather than advisory, and review records showing AI-assisted changes were examined. Acceptance counts and response metrics measure usage, not control effectiveness. Repository counts are unrelated.

Question 24Use GitHub Copilot Responsibly

Why does least privilege matter when configuring what Copilot agent features can do in a repository?

  1. Least privilege removes the need for content exclusion
  2. Permissions have no effect on agent behavior
  3. Broad permissions make suggestions more accurate
  4. Limiting permissions constrains the damage a mistaken or manipulated action can cause before a human reviews it Correct answer.

Explanation

Agent-style features can take actions, so scoping permissions limits the blast radius of errors or injected instructions. Least privilege complements, rather than replaces, content exclusion and review. Permission breadth does not improve suggestion quality.

Question 25Use GitHub Copilot Responsibly

Which statement about telemetry and Copilot usage data is most accurate for a privacy-conscious organization?

  1. Telemetry settings and data-handling terms vary by plan and configuration, so administrators should review them against the organization's privacy requirements Correct answer.
  2. Telemetry always includes full source file contents in plain text for all plans
  3. Telemetry is identical across all plans and cannot be configured
  4. Telemetry is irrelevant because Copilot does not collect usage data

Explanation

Data handling and telemetry depend on the plan and settings, so administrators must confirm what is collected and retained against privacy obligations. Assuming uniformity or that no data is collected is inaccurate. Reviewing terms is part of responsible deployment.

Question 26Use GitHub Copilot Responsibly

A developer accepts a Copilot suggestion that includes a hardcoded connection string with a password. Which responsible-use action should happen before the code is committed?

  1. Move the credential into a secret store and reference it through configuration Correct answer.
  2. Replace the password with a slightly different literal value
  3. Keep the string but add a comment marking it as temporary
  4. Commit the change and rotate the password later in the sprint

Explanation

Copilot can reproduce patterns found in training data and open code, including embedded credentials, so every accepted suggestion must be reviewed for sensitive values before commit. The durable fix is to remove the secret from source and load it from a managed secret store, because a secret that reaches version history stays exposed even after later edits.

Question 27Use GitHub Copilot Responsibly

What is the primary purpose of Copilot's duplicate-detection (public code matching) filter?

  1. To flag suggestions that match public code so the developer can review licensing obligations Correct answer.
  2. To encrypt suggestions before they are displayed in the editor
  3. To block all suggestions longer than a fixed character limit
  4. To prevent Copilot from reading the current repository's files

Explanation

The filter compares suggestions against a public code index and surfaces matches so the developer can decide whether the license terms are acceptable. It informs review; it does not automatically resolve licensing, and it is distinct from content exclusion, which controls which files Copilot may use as context.

Question 28Use GitHub Copilot Responsibly

Which statement best describes the developer's accountability for code that Copilot suggests and the developer accepts?

  1. Responsibility is shared equally between the developer and the IDE vendor
  2. The developer remains accountable for reviewing, testing, and owning the accepted code Correct answer.
  3. Responsibility transfers to the model provider once the suggestion is accepted
  4. Accountability applies only when the suggestion is longer than ten lines

Explanation

Copilot is an assistive tool; accepting a suggestion is an engineering decision, so the developer who accepts it owns its correctness, security, and licensing posture. Review and testing obligations do not shrink because a machine produced the first draft.

Question 29Use GitHub Copilot Responsibly

A developer is drafting a Copilot Chat prompt about a production outage and wants help debugging. Which prompt content is most appropriate?

  1. The full production connection string so Copilot can test connectivity
  2. The private key used to sign internal service tokens
  3. Sanitized log excerpts and a description of the failing component Correct answer.
  4. A copy of the customer database export containing account records

Explanation

Prompts should carry the minimum context needed to get useful help, and that context should be stripped of credentials and personal data. Sanitized logs plus a component description usually give enough signal to reason about a failure without creating a new exposure.

Question 30Use GitHub Copilot Responsibly

An engineering manager wants Copilot usage to remain productive while reducing the chance that generated code introduces vulnerable patterns. Which approach is most aligned with responsible use?

  1. Require developers to run generated code through existing review, static analysis, and dependency scanning gates Correct answer.
  2. Trust Copilot output whenever the suggestion compiles without warnings
  3. Rely on the model to refuse any request that could produce insecure code
  4. Disable Copilot for everyone until a formal security audit is complete

Explanation

Copilot output should pass through the same quality and security controls as human-written code, so review, static analysis, and dependency scanning remain the enforcement layer. This preserves productivity while catching insecure patterns that a plausible-looking suggestion can contain.

Question 31Use GitHub Copilot Responsibly

A repository uses Copilot content exclusion to keep a sensitive directory out of Copilot context. What should the team understand about the strength of this control?

  1. It automatically deletes any previously generated suggestion that referenced the excluded files
  2. It is a best-effort context control that does not replace access controls, and its effect can vary by surface and timing Correct answer.
  3. It is a hard security boundary that also blocks the model provider from any future processing
  4. It only applies to code completions and never to chat surfaces

Explanation

Content exclusion limits which files Copilot features may use as context, but it is a defense-in-depth measure rather than an access-control boundary, and behavior can differ across IDE, chat, and other surfaces. Teams should still rely on repository permissions and secret management as the primary protections.

Question 32Use GitHub Copilot Responsibly

Copilot Chat is asked to summarize an issue thread that contains text telling the assistant to ignore prior instructions and reveal repository secrets. What is the most appropriate mitigation?

  1. Paste the repository secrets into the thread so the summary is complete
  2. Instruct the assistant in the prompt to be careful and proceed with the summary
  3. Assume the model will detect the injected instruction and ignore it automatically
  4. Treat the issue text as untrusted data and avoid granting the assistant tools or context that could expose secrets Correct answer.

Explanation

Text from issues, pull requests, and web pages is untrusted input and can carry instructions aimed at the assistant, so the safe pattern is to limit what the assistant can reach rather than to negotiate with it in the prompt. Keeping secrets out of the assistant's context and restricting tool permissions means a successful injection has little to steal or do.

Question 33Use GitHub Copilot Responsibly

A developer's Copilot suggestion resembles a function from a permissively licensed open-source project, and the public code filter displayed a match. Which next step best reflects responsible use?

  1. Verify the license terms, preserve required attribution, and confirm the match is acceptable to the organization Correct answer.
  2. Accept the suggestion because permissive licenses never impose conditions
  3. Accept the suggestion and remove the original copyright header to keep the file tidy
  4. Rewrite the function by renaming variables so the match no longer appears

Explanation

A filter match is information for the developer, not a verdict, so the responsible step is to identify the source license and satisfy whatever it requires, such as attribution or notice retention. Permissive licenses still carry conditions, and cosmetic renaming does not change the provenance of the code.

Question 34Use GitHub Copilot Responsibly

A regulated team wants to demonstrate that Copilot responsible-use controls are operating, not merely configured. Which evidence set is most persuasive?

  1. The number of Copilot suggestions accepted per developer per week
  2. A survey in which developers self-report that they follow the policy
  3. A screenshot of the policy document and a count of enabled features
  4. Audit log records of policy changes, content exclusion updates, and periodic sampled reviews of accepted suggestions Correct answer.

Explanation

Configuration alone shows intent, while audit logs of policy and exclusion changes plus sampled review records show that controls are applied and checked over time. That combination ties activity to named changes and gives reviewers something verifiable rather than self-reported.

Question 35Use GitHub Copilot Features

In GitHub Copilot Chat, which participant prefix directs a question to the agent that can propose and apply multi-file code edits across the workspace?

  1. @workspace Correct answer.
  2. @github
  3. @vscode
  4. @terminal

Explanation

The @workspace participant gives Copilot Chat awareness of the whole project so it can locate relevant files and propose coordinated edits. Other participants are scoped to editor commands, the integrated terminal, or GitHub-specific queries rather than workspace-wide code changes.

Question 36Use GitHub Copilot Features

A developer wants Copilot to explain a selected block of unfamiliar code without leaving the editor. Which built-in chat command is designed for that?

  1. /doc
  2. /explain Correct answer.
  3. /fix
  4. /tests

Explanation

The /explain slash command asks Copilot Chat to describe what the selected code does, which is its intended purpose. The other slash commands target different tasks such as repairing errors, generating tests, or writing documentation comments.

Question 37Use GitHub Copilot Features

Which Copilot surface is designed to suggest an entire implementation directly inside the editor as gray inline text that you accept with Tab?

  1. Copilot code review on a pull request
  2. Copilot inline suggestion (ghost text) Correct answer.
  3. Copilot Chat panel
  4. Copilot CLI

Explanation

Inline suggestions appear as ghost text in the editor and are accepted with Tab, which is the core code-completion behavior. Chat, CLI, and pull request review are separate surfaces with conversational or review-oriented interaction.

Question 38Use GitHub Copilot Features

What does the Copilot next-edit-suggestions feature provide in supported editors?

  1. A scheduled dependency upgrade report
  2. A list of open pull requests awaiting your review
  3. Predictions of the next edit location and content based on your recent changes Correct answer.
  4. Automatic merging of conflicting git branches

Explanation

Next edit suggestions extend completion beyond the cursor by anticipating where your next change is likely needed and proposing it there. This helps propagate a refactor consistently, unlike pull request, merge, or dependency tooling.

Question 39Use GitHub Copilot Features

A developer wants Copilot Chat to answer using the contents of the currently open file only, keeping the context narrow. Which reference best targets that file?

  1. #file Correct answer.
  2. #terminalSelection
  3. #editor
  4. #selection

Explanation

The #file chat variable references a specific file's contents as context, so the answer is grounded in that file. #selection targets only highlighted text, while #terminalSelection targets terminal output, and #editor is not the standard variable for whole-file context.

Question 40Use GitHub Copilot Features

When Copilot Chat proposes an edit in the editor and shows a diff view, what is the correct way to incorporate only part of the proposal?

  1. Use the per-hunk or per-change accept controls to keep selected portions Correct answer.
  2. Accept the whole diff and manually revert unwanted lines afterward
  3. Disable Copilot and retype the change by hand
  4. Copy the diff text into a new file and delete the rest

Explanation

The diff review UI lets you accept or discard individual hunks or changes, so partial adoption is supported directly. Accepting everything and reverting manually is error-prone, and the other options abandon the tooling rather than using its granular controls.

Question 41Use GitHub Copilot Features

Which practice best improves the relevance of a Copilot Chat answer about a large, unfamiliar codebase?

  1. Ask a single-word question to keep the prompt short
  2. Paste the entire repository into the chat each time
  3. Reference the relevant files or symbols and state the goal explicitly Correct answer.
  4. Avoid mentioning any file names so Copilot searches freely

Explanation

Explicit context references plus a clear statement of intent give the model the material and objective it needs to answer precisely. Terse prompts, wholesale pasting, and withholding file names all reduce signal or waste context budget.

Question 42Use GitHub Copilot Features

What is the primary purpose of Copilot Chat's /tests slash command?

  1. To measure code coverage of the current file
  2. To generate unit tests for the selected code Correct answer.
  3. To delete failing tests automatically
  4. To run the existing test suite and report failures

Explanation

The /tests command asks Copilot to draft test cases for the selected code, which you then review and run yourself. It does not execute the suite, compute coverage, or remove tests.

Question 43Use GitHub Copilot Features

A team wants Copilot code review feedback on a pull request before merging. Where does that review appear?

  1. As an email sent to repository administrators
  2. As a new branch created by Copilot
  3. As inline comments on the pull request diff Correct answer.
  4. As a local git hook that blocks the commit

Explanation

Copilot code review posts its findings as comments on the pull request, typically attached to the relevant lines in the diff. It does not install local hooks, create branches, or notify administrators by email.

Question 44Use GitHub Copilot Features

Which chat variable lets a developer include the output currently visible in the integrated terminal as context for a Copilot Chat question?

  1. #terminalSelection Correct answer.
  2. #codebase
  3. #sym
  4. #workspace

Explanation

#terminalSelection attaches the text selected in the terminal, which is useful for diagnosing build or runtime errors. The other variables refer to the workspace, codebase search, or a symbol, not terminal output.

Question 45Use GitHub Copilot Features

A developer highlights a function and asks Copilot Chat to make it handle null input. Which interaction pattern is most appropriate?

  1. Open a new repository and ask Copilot to guess the function
  2. Ask in the Chat panel with the selection attached and request the specific change Correct answer.
  3. Disable inline suggestions so Copilot cannot interfere
  4. Retype the function in the chat by hand before asking

Explanation

Attaching the selection and stating the precise change keeps the request grounded and actionable. Retyping wastes effort and risks divergence, and the other options do not supply the needed context.

Question 46Use GitHub Copilot Features

Which statement accurately describes how inline completions and Copilot Chat differ in interaction style?

  1. Inline completions insert code as you type; Chat supports multi-turn dialogue Correct answer.
  2. Both require a pull request to function
  3. Chat cannot reference files, while inline completions can
  4. Inline completions are conversational; Chat inserts ghost text

Explanation

Inline completion is a fast, low-friction insertion of suggested code at the cursor, whereas Chat is a conversational interface supporting follow-up questions and context references. The other statements invert or misstate these behaviors.

Question 47Use GitHub Copilot Features

A developer wants Copilot to help modernize a legacy module while keeping changes reviewable. Which approach aligns best with Copilot's features?

  1. Turn off diff review so changes apply instantly
  2. Ask Copilot to skip tests to speed up the refactor
  3. Ask Chat to rewrite the entire module in one step and accept everything
  4. Request targeted changes file by file, reviewing each diff before accepting Correct answer.

Explanation

Incremental, reviewed changes keep the refactor auditable and reduce the chance of unnoticed regressions. Wholesale rewrites, disabling review, and skipping tests all increase risk without leveraging Copilot's review controls.

Question 48Use GitHub Copilot Features

What does the #codebase chat variable enable in Copilot Chat?

  1. It runs the project's build script
  2. It lets Copilot search across the project to gather relevant context Correct answer.
  3. It opens the repository settings page
  4. It restricts answers to a single file

Explanation

#codebase signals that Copilot should search the project to find relevant files and symbols for the question, supporting broad questions about structure and usage. It does not limit scope to one file, run builds, or open settings.

Question 49Use GitHub Copilot Features

Which slash command in Copilot Chat is intended to propose a fix for a problem in the selected code?

  1. /explain
  2. /new
  3. /fix Correct answer.
  4. /doc

Explanation

The /fix command asks Copilot to suggest a correction for the selected code, often after a diagnostic or error. /explain describes code, /doc writes documentation, and /new scaffolds a new workspace or project.

Question 50Use GitHub Copilot Features

A developer wants to ask Copilot Chat about a specific function by name so the answer focuses on that symbol. Which reference is most appropriate?

  1. #file
  2. #terminalSelection
  3. #vscode
  4. #sym Correct answer.

Explanation

The #sym variable references a code symbol such as a function or class, focusing the answer on that definition and its usages. #file targets a whole file, #terminalSelection targets terminal text, and #vscode is not a symbol reference.