Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.
Question 1 · choose 1
A Java developer joins a Go project and wants to understand a goroutine-heavy function in the editor without searching the web. Which Copilot Chat slash command, used with the function selected, serves that?
A/fix
B/help
C/explain
D/fixTestFailure
Show the answer and why
A/fix
Incorrect
/fix proposes a fix for problems in the selected code.
B/help
Incorrect
/help gives a quick reference to the basics of using Copilot.
C/explain
Correct
/explain explains how the code in your active editor works.
D/fixTestFailure
Incorrect
/fixTestFailure finds and fixes a failing test.
Copilot Chat in VS Code offers slash commands for common scenarios: /explain explains how the code in your active editor works, /fix proposes a fix, /help gives a quick reference and /fixTestFailure finds and fixes a failing test. Explaining unfamiliar code in place helps developers learn a new language with less context switching.
A QA engineer needs 500 realistic customer records to load-test a signup flow. Production data contains personal information that must not leave the database, and the records must match the current schema. What is the most appropriate use of Copilot?
AExport a production sample and ask Copilot Chat to anonymize it after pasting it in
BAsk Copilot to write a script that copies production rows into the test database
CGive Copilot the schema and ask it to generate realistic synthetic sample data
DAsk Copilot cloud agent to find similar public datasets on GitHub to import
Show the answer and why
AExport a production sample and ask Copilot Chat to anonymize it after pasting it in
Incorrect
Pasting production personal data into a prompt is what the constraint forbids.
BAsk Copilot to write a script that copies production rows into the test database
Incorrect
Copying production records keeps the personal data the engineer must avoid.
CGive Copilot the schema and ask it to generate realistic synthetic sample data
Correct
Copilot can generate realistic sample data for testing, which saves manual data creation without using production records.
DAsk Copilot cloud agent to find similar public datasets on GitHub to import
Incorrect
Importing third-party data does not guarantee it matches the schema, and it is not the documented use.
Microsoft Learn lists sample data creation among the routine tasks Copilot handles: when testing, it can generate realistic sample data, saving time on manual data creation. Generating synthetic records from the schema meets the need without moving production personal data into prompts or test systems.
A reviewer flags a 200-line JavaScript function with parameters named a, b and c, deep nesting and a long if...else chain. The author wants Copilot's help to make it maintainable. Which approach matches GitHub's cookbook guidance?
ASelect it and ask Copilot Chat for clearer names, less nesting and smaller methods
BAsk Copilot to translate the function into another language, which forces a cleaner design
CEnable the public code filter so that Copilot rewrites the function from a known clean source
DRun /tests on the function so that its structure is rewritten to be testable
Show the answer and why
ASelect it and ask Copilot Chat for clearer names, less nesting and smaller methods
Correct
The cookbook shows Copilot Chat suggesting better variable names, avoiding sequential conditional checks, reducing nested logic and splitting large methods.
BAsk Copilot to translate the function into another language, which forces a cleaner design
Incorrect
Translation changes the language, not the readability problems the reviewer flagged.
CEnable the public code filter so that Copilot rewrites the function from a known clean source
Incorrect
The public code filter decides whether matching suggestions are shown; it does not refactor code.
DRun /tests on the function so that its structure is rewritten to be testable
Incorrect
/tests generates tests for the code; it does not refactor the function itself.
GitHub's cookbook article on readability shows Copilot Chat improving variable names, avoiding sequential conditional checks, reducing nested logic and splitting large methods into smaller ones. You select the code in the editor and ask Copilot Chat for the change, then review the non-deterministic response.
Only one engineer still knows Perl, and the team wants a Perl word-count script moved to TypeScript. How can Copilot help most directly?
AUse /tests on the Perl script to rewrite it in TypeScript
BAsk Copilot Chat to translate it and explain how to run it
CEnable next edit suggestions so the Perl file changes language as you type
DAsk Copilot to add comments, because commented Perl no longer needs translating
Show the answer and why
AUse /tests on the Perl script to rewrite it in TypeScript
Incorrect
/tests generates unit tests; it doesn't translate code.
BAsk Copilot Chat to translate it and explain how to run it
Correct
Copilot can translate code to another language; translating a standalone script is straightforward, and it can explain how to run the result.
CEnable next edit suggestions so the Perl file changes language as you type
Incorrect
Next edit suggestions predict edits; they don't convert languages.
DAsk Copilot to add comments, because commented Perl no longer needs translating
Incorrect
Comments help readability but don't move the code to a maintained language.
Copilot Chat can rewrite code to perform the same operations in a different language, for example to move code from a language few people know, such as Perl, to Python or TypeScript. Translating a standalone file, such as a script, is straightforward, and Copilot can explain how to run the new file.
A team's service has almost no documentation. Which documentation tasks does Microsoft Learn describe Copilot helping with?
AOnly README files, because Copilot can't see function bodies
BOnly translating existing documentation into other languages
CInline comments, function descriptions and README files
DDocumentation is out of scope; Copilot only writes executable code
Show the answer and why
AOnly README files, because Copilot can't see function bodies
Incorrect
Copilot also suggests inline comments and function descriptions.
BOnly translating existing documentation into other languages
Incorrect
Learn describes generating new documentation, not only translation.
CInline comments, function descriptions and README files
Correct
Copilot generates inline comments, suggests function descriptions including parameters and return values, and helps create README files.
DDocumentation is out of scope; Copilot only writes executable code
Incorrect
Documentation writing is one of the listed productivity use cases.
Microsoft Learn lists enhanced documentation writing among Copilot's productivity benefits: contextually relevant inline comments for complex sections, function descriptions with parameter and return value details, README generation based on the codebase, and consistent documentation style across a project.
A new team member wants to understand how an unfamiliar repository handles HTTP requests and responses, without cloning it. What is a good way to use Copilot?
AAsk Copilot Chat on GitHub how the repository handles HTTP requests
BRun Copilot code review on the default branch to get a summary
CAssign an issue to Copilot cloud agent asking it to rename the HTTP classes
DGenerate a pull request summary of the latest commit
Show the answer and why
AAsk Copilot Chat on GitHub how the repository handles HTTP requests
Correct
With a repository context, Copilot Chat uses the semantic code search index to reference relevant code in its answer.
BRun Copilot code review on the default branch to get a summary
Incorrect
Code review reviews pull request changes, not a whole repository's design.
CAssign an issue to Copilot cloud agent asking it to rename the HTTP classes
Incorrect
That asks for changes, not an explanation.
DGenerate a pull request summary of the latest commit
Incorrect
A summary of one change won't explain how the repository works.
When you start a Copilot Chat conversation with a repository context, the repository is indexed automatically to improve answers about the code's structure and logic. For example, you can ask "How does this repo manage HTTP requests and responses?" and Copilot Chat will reference relevant sections of the code.
A developer editing files in the GitHub web editor wants help writing a clear commit message. What can Copilot do there?
ANothing; commit message generation is only available in the CLI
BGenerate the message only after the pull request is merged
CSuggest a title and description at Commit changes, for her to edit
DCopy the pull request summary into every commit automatically
Show the answer and why
ANothing; commit message generation is only available in the CLI
Incorrect
Commit message generation is available on GitHub.com and in GitHub Desktop.
BGenerate the message only after the pull request is merged
Incorrect
The message is suggested when you commit, before merge.
CSuggest a title and description at Commit changes, for her to edit
Correct
On GitHub.com, Copilot generates a suggested summary and description from the changes in the selected files when you click Commit changes.
DCopy the pull request summary into every commit automatically
Incorrect
Commit messages are generated on request from the selected changes.
On GitHub.com, when you click Commit changes, Copilot can generate a suggested commit summary (title) and description based on the changes in the selected files; in GitHub Desktop you can select lines or files for more context. Review and edit the suggestion before committing; English is the only supported language.