nerdexam
MicrosoftMicrosoft

GH-300 · Question #42

GH-300 Question #42: Real Exam Question with Answer & Explanation

The correct answer is A: "Show me how to improve the readability of this function.". {"question_number": 9, "question": "Which of the following prompts can be used to guide GitHub Copilot Chat in refactoring code for quality improvements?", "correct_answer": "A and B", "explanation": "Effective prompts for refactoring should be specific, actionable, and scoped. '

Apply prompt engineering and context crafting

Question

Which of the following prompts can be used to guide GitHub Copilot Chat in refactoring code for quality improvements? (Each correct answer presents part of the solution. Choose two.)

Options

  • A"Show me how to improve the readability of this function."
  • B"Suggest ways to enhance the maintainability of this code segment."
  • C"Refactor my application to meet the latest coding standards."
  • D"Predict future coding trends and update my codebase accordingly."

Explanation

{"question_number": 9, "question": "Which of the following prompts can be used to guide GitHub Copilot Chat in refactoring code for quality improvements?", "correct_answer": "A and B", "explanation": "Effective prompts for refactoring should be specific, actionable, and scoped. 'Show me how to improve the readability of this function' (A) and 'Suggest ways to enhance the maintainability of this code segment' (B) are both focused, realistic asks that align with what Copilot Chat can do. Option C is too broad and vague - 'latest coding standards' is undefined and spans the entire application. Option D is not a valid refactoring task; predicting future trends is speculative and outside the scope of Copilot's capabilities.", "generated_by": "claude-sonnet", "llm_judge_score": 4}

Topics

#GitHub Copilot Chat#Prompt Engineering#Code Refactoring#Code Quality

Community Discussion

No community discussion yet for this question.

Full GH-300 PracticeBrowse All GH-300 Questions