Flashcardsfor IT Certifications

D4: Prompt Examples & Context Techniques

GH-300 GitHub Copilot exam practice questions · 10 flashcards

Question
Weak prompt example?
1 / 10

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 10 Prompt Examples & Context Techniques practice questions and answers
  1. Weak prompt example?
    'Write code for users.'
  2. Stronger prompt example?
    'Create a Python function validate_email(email: str) -> bool using regex; return False for empty strings; include 5 pytest tests.'
  3. Few-shot example in code?
    Show two example test cases, then ask Copilot to write more in the same style.
  4. Context via open tabs?
    Keep related files open; close irrelevant ones.
  5. Context via #file?
    Explicitly reference files in chat.
  6. Context via selection?
    Highlight code before asking.
  7. Context via instructions files?
    Persistent project conventions.
  8. Iterating prompts?
    Refine: 'Use async/await', 'add error handling'.
  9. Asking for plan first?
    'Outline steps before writing code' improves complex tasks.
  10. Scenario: Copilot uses wrong framework. Fix?
    State framework explicitly and reference existing file examples.