D4: Crafting Effective Prompts
GH-300 GitHub Copilot exam practice questions · 10 flashcards
Question
Prompt structure?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Crafting Effective Prompts practice questions and answers
- Prompt structure?Goal/task, context, constraints/requirements, examples, desired output format.
- 4 S's of prompting (GitHub)?Single (one task), Specific, Short, Surround (provide context).
- How Copilot determines context?Open files, cursor location, selection, chat references, instructions, workspace index.
- Zero-shot prompting?Ask without examples.
- Few-shot prompting?Provide examples of desired input/output to guide the pattern.
- One-shot prompting?Single example.
- Best practices?Be specific, break down complex tasks, provide examples, iterate, use meaningful names and comments.
- Role prompting?Ask Copilot to act as e.g. a security reviewer.
- Specifying output format?e.g. 'Return a TypeScript interface and Jest tests'.
- Scenario: Copilot generates wrong date format. Fix?Add explicit constraint/example of expected format (few-shot).