GH-300 - Apply prompt engineering and context crafting (13% of the exam) - Section 4.3

Explain prompt engineering principles, the prompt process flow, and how chat history is used.

Explain the principles behind prompt engineering for GitHub Copilot, the prompt process flow from intent to response, and how chat history and prior turns are used to refine answers. Use iterative prompting and follow-up turns to improve a result.

Prompt process flowChat historyIterative promptingPrompt engineering principles

Practice question for this objective

Free sampleApply prompt engineering and context craftingmedium

A developer asks Copilot Chat to refactor a function, then sends a one-line follow-up reading now also add retry handling without naming the function again, and Copilot correctly applies it to the same function. Which aspect of the prompt process flow best explains why the follow-up landed on the right target?

  • AThe model was trained on this developer's prior sessions, so it has learned which function they usually mean when they omit the name in a request.
  • BCopilot permanently remembers the function across all conversations once it has been refactored, so any later thread can refer to it without naming it again.
  • CChat history carries the earlier turns into the new prompt, so the previously discussed function remains in context and resolves the unnamed reference. Correct
  • DThe follow-up triggers a fresh repository-wide scan that re-identifies the only function recently refactored, independent of anything said earlier in the thread.
Chat history feeds earlier turns into each new prompt, which is how an unnamed follow-up reference resolves to the right subject. Within one Copilot Chat conversation, prior turns are included as context when the next prompt is assembled. That history lets Copilot resolve a pronoun or unnamed target to the function discussed earlier, without persistence across threads or any model training on the developer's data.

Why A is wrong: Tempting because it sounds adaptive, but Business and Enterprise prompts are not used to train the model, and resolution relies on in-thread history.

Why B is wrong: Tempting because memory sounds plausible, but history is scoped to the single thread and does not persist across separate conversations.

Why C is correct: Correct: conversation history supplies the prior turns as context, letting Copilot resolve now to the function established earlier in the thread.

Why D is wrong: Tempting because Copilot does use repository context, but the resolution here comes from the conversation turns, not a special scan tied to refactoring.

See more GH-300 practice questions, answers explained.

Exam traps in Apply prompt engineering and context crafting

Answers that look right on this material and are not. Each one is a distractor from a different question in the GH-300 bank for this domain.

  • Copilot rescans the entire repository on every request and infers the target from whichever function was most recently edited on disk.

    Why it is wrong: Copilot does not re-index the whole repository per turn, and disk edit recency is not how a follow-up resolves its referent; the prior conversation supplies that.

  • The request is sent straight to the model unchanged, the model returns text, and Copilot displays it exactly as received without any further handling of the candidate.

    Why it is wrong: Tempting because it sounds direct, but it omits context gathering and the post-processing the proxy performs, so it misrepresents the flow.

  • Reword the request as a single vague noun and trust Copilot to recover the lost intent from the earlier muddled message in the thread.

    Why it is wrong: A single vague noun gives Copilot even less to work with, so it repeats the drift rather than sharpening the answer the developer wants.

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