Question 340
A team reports: A maintainer requests an authentication-code change and wants a final answer containing exactly a patch plus tests, not deployment commands. They observe: The answer mixes suggested production migrations into an unapproved code review. Which ONE technical decision most directly corrects the cause?
- Use an explicit zero-shot description with parameters, expected return type and error behavior.
- Express positive deliverables and explicit limits: patch and tests only; no production rollout steps.
- Treat retrieved issue text as task data, not authoritative instructions; state trusted requirements separately.
- First request a bounded step-by-step diagnosis referencing the specific destructor sequence, then ask for a minimal patch.
Explanation
Correct Answer
B:The allowed output and action boundaries were not specified.
Incorrect Answers
A:Using an explicit zero-shot description with parameters, expected return type and error behavior would not address the need for express positive deliverables and explicit limits: patch and tests only.
C:Treat retrieved issue text as task data, not authoritative instructions would not address the need for express positive deliverables and explicit limits: patch and tests only.
D:The prompt jumped to a solution without requiring evidence of the underlying mechanism. The missing change involves express positive deliverables and explicit limits: patch and tests only; no production rollout steps.
Question 341
A GitHub Copilot task needs TWO complementary actions: the immediate fix and a preventive practice. Context: A maintainer requests an authentication-code change and wants a final answer containing exactly a patch plus tests, not deployment commands. Observed failure: The answer mixes suggested production migrations into an unapproved code review. Select exactly TWO decisions that together address these needs.
- Use diagnosis-first prompting for complex defects and verify with tools.
- Use an explicit zero-shot description with parameters, expected return type and error behavior.
- Keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
- Express positive deliverables and explicit limits: patch and tests only; no production rollout steps.
- Treat retrieved issue text as task data, not authoritative instructions; state trusted requirements separately.
Explanation
Correct Answers
C:The allowed output and action boundaries were not specified. Keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
D:The allowed output and action boundaries were not specified. The needed intervention is keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
Incorrect Answers
A:Use diagnosis-first prompting for complex defects and verify with tools. The combined controls instead need tested AI-assisted changes that preserve stated requirements.
B:Specifying function parameters and return types does not establish the boundary against unauthorized deployment actions.
E:Treating retrieved issue text as untrusted data addresses prompt injection, not the request to limit delivery to a patch and tests.
Question 342
During troubleshooting, investigators observe: The answer mixes suggested production migrations into an unapproved code review. The system context is: A maintainer requests an authentication-code change and wants a final answer containing exactly a patch plus tests, not deployment commands. Which ONE cause most directly explains the observed failure?
- The task contract was too vague even for a zero-shot request.
- The allowed output and action boundaries were not specified.
- The prompt jumped to a solution without requiring evidence of the underlying mechanism.
- Untrusted retrieved text was promoted to an instruction source.
Explanation
Correct Answer
B:The remedy should therefore be: Express positive deliverables and explicit limits: patch and tests only; no production rollout steps.
Incorrect Answers
A:The task contract was too vague even for a zero-shot request. The allowed output and action boundaries were not specified.
C:The prompt jumped to a solution without requiring evidence of the underlying mechanism. The missing change involves the allowed output and action boundaries were not specified.
D:Untrusted retrieved text was promoted to an instruction source. The allowed output and action boundaries were not specified.
Question 343
The current design is: Express positive deliverables and explicit limits: patch and tests only; no production rollout steps. The prior failure was: The answer mixes suggested production migrations into an unapproved code review. Which ONE ongoing control best protects against recurrence of that specific failure?
- Add parameter and return examples when a concise zero-shot prompt fails.
- Keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
- Use diagnosis-first prompting for complex defects and verify with tools.
- Separate trusted prompts from lower-trust issue, log and documentation content.
Explanation
Correct Answer
B:The allowed output and action boundaries were not specified. Keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch. Preventing this failure involves keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
Incorrect Answers
A:Add parameter and return examples when a concise zero-shot prompt fails. Preventing this failure involves keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
C:Use diagnosis-first prompting for complex defects and verify with tools. Preventing this failure involves keep final code-review and deployment authorization separate; require human approval for any operational release outside the requested patch.
D:Separate trusted prompts from lower-trust issue, log and documentation content. It would leave tested AI-assisted changes that preserve stated requirements without the specified safeguard.
Question 344
A team reports: A developer asks Copilot for a fix based on a two-month-old chat that contains an obsolete SQL schema. They observe: The generated SQL queries a table that no longer exists. Which ONE technical decision most directly corrects the cause?
- Start a fresh focused conversation or correct the prior context with the current migration and schema.
- Include the required CSV dialect, escaping rules and example input-output records in the prompt.
- Include the exact compiler diagnostic, affected file, minimal relevant context and expected behavior.
- State the expected JSON schema and forbid extraneous Markdown in the requested output.
Explanation
Correct Answer
A:Outdated conversation context overrode the current repository state.
Incorrect Answers
B:Including the required CSV dialect, escaping rules and example input-output records in the prompt would not address the need for start a fresh focused conversation or correct the prior context with the current migration and schema.
C:Including the exact compiler diagnostic, affected file, minimal relevant context and expected behavior would not address the need for start a fresh focused conversation or correct the prior context with the current migration and schema.
D:State the expected JSON schema and forbid extraneous Markdown in the requested output would not address the need for start a fresh focused conversation or correct the prior context with the current migration and schema.
Question 345
A team has implemented the following change: Start a fresh focused conversation or correct the prior context with the current migration and schema. The original requirement was: A developer asks Copilot for a fix based on a two-month-old chat that contains an obsolete SQL schema. Which ONE validation test best demonstrates the intended behavior?
- Ask for a query using the new column names and compile it against the live schema fixture.
- Parse the result as JSON and validate required keys and types.
- Test a sample containing embedded commas, doubled quotes and line breaks.
- Rerun the compiler and confirm the specific diagnostic is gone without new warnings.
Explanation
Correct Answer
A:Ask for a query using the new column names and compile it against the live schema fixture.
Incorrect Answers
B:Schema-driven tests enforce the expected wire-format contract across generated serialization code.
C:Generated code requires independently defined acceptance tests and review against the real program contract. Verification of this result involves ask for a query using the new column names and compile it against the live schema fixture.
D:Rerun the compiler and confirm the specific diagnostic is gone without new warnings. Verification of this result involves ask for a query using the new column names and compile it against the live schema fixture.
Question 346
During troubleshooting, investigators observe: The generated SQL queries a table that no longer exists. The system context is: A developer asks Copilot for a fix based on a two-month-old chat that contains an obsolete SQL schema. Which ONE cause most directly explains the observed failure?
- The output format was not specified as a machine contract.
- Outdated conversation context overrode the current repository state.
- The necessary failure evidence was missing from the prompt.
- Ambiguous format requirements left the model to invent unsupported assumptions.
Explanation
Correct Answer
B:The remedy should therefore be: Start a fresh focused conversation or correct the prior context with the current migration and schema.
Incorrect Answers
A:The output format was not specified as a machine contract. Outdated conversation context overrode the current repository state.
C:The necessary failure evidence was missing from the prompt. Outdated conversation context overrode the current repository state.
D:Ambiguous format requirements left the model to invent unsupported assumptions. Outdated conversation context overrode the current repository state.
Question 347
The current design is: Start a fresh focused conversation or correct the prior context with the current migration and schema. The prior failure was: The generated SQL queries a table that no longer exists. Which ONE ongoing control best protects against recurrence of that specific failure?
- Include error text and reproducible commands when requesting repairs.
- Use schema validation even when the prompt asks for JSON only.
- Maintain contract examples for every nontrivial data-format request.
- Reset stale sessions and reference current schema when starting a new change.
Explanation
Correct Answer
D:Outdated conversation context overrode the current repository state. Reset stale sessions and reference current schema when starting a new change.
Incorrect Answers
A:Shell commands from AI tools must be inspected for resolved paths and side effects before destructive execution. It would leave conformance to the documented serialized payload format without the specified safeguard.
B:Schema-driven tests enforce the expected wire-format contract across generated serialization code. Preventing this failure involves reset stale sessions and reference current schema when starting a new change.
C:Maintain contract examples for every nontrivial data-format request. It would leave conformance to the documented serialized payload format without the specified safeguard.
Question 348
A team reports: An engineer wants assistance writing an idempotent webhook handler but prompts only "retry failed deliveries". They observe: The generated handler charges the same customer on every retry. Which ONE technical decision most directly corrects the cause?
- Include the exact compiler diagnostic, affected file, minimal relevant context and expected behavior.
- Provide two short representative input-output pairs followed by the new task as few-shot context.
- Specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates.
- Save a scoped prompt template in `.github/prompts/review-risk.prompt.md` and invoke it for each request in supported tools.
Explanation
Correct Answer
C:The prompt omitted idempotency and concurrency invariants.
Incorrect Answers
A:Including the exact compiler diagnostic, affected file, minimal relevant context and expected behavior would not specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates.
B:Providing two short representative input-output pairs followed by the new task as few-shot context would not specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates.
D:Task-specific guidance was not captured in reusable prompt files. That does not establish specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates.
Question 349
A team has implemented the following change: Specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates. The original requirement was: An engineer wants assistance writing an idempotent webhook handler but prompts only "retry failed deliveries". Which ONE validation test best demonstrates the intended behavior?
- Send the same event three times and ensure the side effect occurs once.
- Ask for a third error example and compare the field names, tone and structure to the references.
- Run it on two different pull requests and check that the required risk headings appear.
- Rerun the compiler and confirm the specific diagnostic is gone without new warnings.
Explanation
Correct Answer
A:Send the same event three times and ensure the side effect occurs once.
Incorrect Answers
B:Ask for a third error example and compare the field names, tone and structure to the references. That check cannot demonstrate send the same event three times and ensure the side effect occurs once.
C:Run it on two different pull requests and check that the required risk headings appear. That check cannot demonstrate send the same event three times and ensure the side effect occurs once.
D:Rerun the compiler and confirm the specific diagnostic is gone without new warnings. Verification of this result involves send the same event three times and ensure the side effect occurs once.
Question 350
During troubleshooting, investigators observe: The generated handler charges the same customer on every retry. The system context is: An engineer wants assistance writing an idempotent webhook handler but prompts only "retry failed deliveries". Which ONE cause most directly explains the observed failure?
- The necessary failure evidence was missing from the prompt.
- The organization-specific target pattern was not demonstrated in the prompt.
- Task-specific guidance was not captured in reusable prompt files.
- The prompt omitted idempotency and concurrency invariants.
Explanation
Correct Answer
D:The remedy should therefore be: Specify at-least-once delivery, unique event IDs, concurrency and the need to suppress duplicates.
Incorrect Answers
A:The necessary failure evidence was missing from the prompt. The prompt omitted idempotency and concurrency invariants.
B:The organization-specific target pattern was not demonstrated in the prompt. The missing change involves the prompt omitted idempotency and concurrency invariants.
C:Task-specific guidance was not captured in reusable prompt files. The prompt omitted idempotency and concurrency invariants.
GitHub Copilot (GH-300) Practice Tests