GH-300 domain - 14% of the exam

Improve developer productivity with GitHub Copilot

Improve developer productivity with GitHub Copilot is 14% of the GitHub Copilot (GH-300) exam. These are the objectives it covers, each with practice questions and worked explanations.

Objectives in this domain

Sample question from this domain

Free sampleImprove developer productivity with GitHub Copiloteasy

A developer is writing a Python module and wants Copilot to generate a complete function body from a clear description before they write any code. Which prompting practice gives Copilot the best chance of generating an accurate first draft?

  • AType only the keyword def on a blank line with no name or parameters, so Copilot is free to invent the whole function from scratch without constraints.
  • BOpen a pull request first so Copilot code review can read the diff and then suggest the missing function body back inside the local editor for you.
  • CAdd a content exclusion entry for the file, because Copilot only generates a full function body once the path has been declared as excluded in settings.
  • DWrite a descriptive function signature and a short comment stating the inputs, the expected output, and an example, then let Copilot complete the body. Correct
Generate accurate code by giving Copilot a descriptive signature and a comment stating inputs, output, and an example. Copilot predicts completions from the context it is given. A descriptive signature plus a comment naming the inputs, expected output, and an example narrows the prediction toward the intended behaviour, which yields a more accurate first draft than an empty or contextless prompt.

Why A is wrong: Tempting as minimal effort, but with no name, parameters, or intent Copilot lacks context and is far more likely to produce an irrelevant or generic body.

Why B is wrong: Wrong surface: code review comments on existing diffs in a pull request and does not author a brand new function body in the editor before code exists.

Why C is wrong: Content exclusions stop named files being used as context; they do not trigger generation and would actually reduce the context available to Copilot.

Why D is correct: Correct: a clear signature plus a comment describing inputs, output, and an example gives Copilot the specific context it needs to generate an accurate body.

Other domains in this exam

See also the GH-300 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.