GitHub Professional Certificate GitHub Copilot and AI Development Tools 2 — Questions and Answers
Question 1: How can developers accept a GitHub Copilot inline suggestion in VS Code?
- Press Enter
- Press Tab (Correct answer)
- Press Ctrl+Space
- Press Shift+Enter
Correct answer: Press Tab
In VS Code, pressing Tab accepts the currently displayed GitHub Copilot inline suggestion.
Question 2: What does GitHub Copilot use as context when generating code suggestions?
- Only the current line of code
- The entire open file and related open tabs in the editor (Correct answer)
- Only public GitHub repositories
- Only the project's README file
Correct answer: The entire open file and related open tabs in the editor
Copilot uses the content of the open file and other open editor tabs as context to generate more relevant and accurate suggestions.
Question 3: Which GitHub Copilot feature can automatically generate unit tests for a selected function?
- Copilot Fix
- Copilot Tests
- Copilot Generate Tests
- Copilot /tests slash command in Chat (Correct answer)
Correct answer: Copilot /tests slash command in Chat
The /tests slash command in Copilot Chat instructs Copilot to generate unit tests for the selected code.
Question 4: What is the purpose of a `.github/copilot-instructions.md` file in a repository?
- To disable Copilot for specific files
- To provide custom instructions that guide Copilot's suggestions for that repository (Correct answer)
- To list approved Copilot users
- To configure Copilot's billing settings
Correct answer: To provide custom instructions that guide Copilot's suggestions for that repository
The `copilot-instructions.md` file allows teams to provide persistent custom instructions that shape Copilot's behavior across the repository.
Question 5: Which setting allows an organization to prevent GitHub Copilot from suggesting code that matches public GitHub repositories?
- Public code duplication filter (Suggestions matching public code) (Correct answer)
- Repository visibility lock
- Copilot sandbox mode
- Code scanning enforcement
Correct answer: Public code duplication filter (Suggestions matching public code)
The 'Suggestions matching public code' setting (duplication filter) blocks Copilot from returning suggestions that closely match publicly available GitHub code.
Question 6: GitHub Copilot for Business differs from GitHub Copilot Individual primarily by offering what additional capability?
- Faster suggestion speed
- Organization-wide policy management and centralized billing (Correct answer)
- Support for more programming languages
- Offline mode for code suggestions
Correct answer: Organization-wide policy management and centralized billing
Copilot Business adds organization-wide policy controls, centralized seat management, and consolidated billing not available in the Individual tier.
How can developers accept a GitHub Copilot inline suggestion in VS Code?