Microsoft GH-300 Practice Test 41
Question 400
A numeric conversion helper overflows on large values. What tests should be generated?
- Include explicit empty-file and missing-header outcomes with expected errors.
- Exercise maximum supported ranges and assert overflow handling.
- Compare case variants and confirm the intended normalization rule.
- Add negative tests for wrong credentials, expired sessions, and unauthorized resources.
Explanation
Correct Answer
B:Extreme values reveal safety behavior absent from typical examples.
Incorrect Answers
A:Input boundaries frequently expose parsing defects. What tests should be generated. Extreme values reveal safety behavior absent from typical examples.
C:Case-folding is a functional contract that simple examples may miss. extreme values reveal safety behavior absent from typical examples.
D:Security-sensitive behavior is often defined by the denial paths. Extreme values reveal safety behavior absent from typical examples.
Question 401
A generated client passes unit tests but sends the wrong HTTP header to a payment API. What test is needed?
- Run consumer-driven contract tests and compatibility checks.
- Add an integration or contract test for method, headers, payload, and response handling.
- Test timeouts, rate limiting, transient failures, and error-body parsing.
- Exercise duplicate requests with idempotency keys and confirm exactly-once business effects.
Explanation
Correct Answer
B:Correct local logic does not establish remote API compatibility.
Incorrect Answers
A:Producers and consumers can fail even when both compile independently. What test is needed. Correct local logic does not establish remote API compatibility.
C:Robust integrations handle more than a happy-path mock. correct local logic does not establish remote API compatibility.
D:Network retries may repeat messages and require application-level deduplication. correct local logic does not establish remote API compatibility.
Question 402
A service writes to a database and publishes an event. What failure scenario should tests cover?
- Verify behavior when the database commits but event publication fails.
- Exercise duplicate requests with idempotency keys and confirm exactly-once business effects.
- Add an integration or contract test for method, headers, payload, and response handling.
- Run consumer-driven contract tests and compatibility checks.
Explanation
Correct Answer
A:Partial distributed operations need explicit consistency or retry strategies.
Incorrect Answers
B:Network retries may repeat messages and require application-level deduplication. partial distributed operations need explicit consistency or retry strategies.
C:Correct local logic does not establish remote API compatibility. Partial distributed operations need explicit consistency or retry strategies.
D:Producers and consumers can fail even when both compile independently. What failure scenario should tests cover. Partial distributed operations need explicit consistency or retry strategies.
Question 403
Copilot creates a mock always returning successful API responses. What should be added?
- Test timeouts, rate limiting, transient failures, and error-body parsing.
- Verify behavior when the database commits but event publication fails.
- Exercise duplicate requests with idempotency keys and confirm exactly-once business effects.
- Add an integration or contract test for method, headers, payload, and response handling.
Explanation
Correct Answer
A:Robust integrations handle more than a happy-path mock.
Incorrect Answers
B:Partial distributed operations need explicit consistency or retry strategies. robust integrations handle more than a happy-path mock.
C:Network retries may repeat messages and require application-level deduplication. robust integrations handle more than a happy-path mock.
D:Correct local logic does not establish remote API compatibility. Robust integrations handle more than a happy-path mock.
Question 404
A schema change is applied to one service while consumers use the prior format. What should be validated?
- Add an integration or contract test for method, headers, payload, and response handling.
- Run consumer-driven contract tests and compatibility checks.
- Verify behavior when the database commits but event publication fails.
- Test timeouts, rate limiting, transient failures, and error-body parsing.
Explanation
Correct Answer
B:Producers and consumers can fail even when both compile independently.
Incorrect Answers
A:Correct local logic does not establish remote API compatibility. Producers and consumers can fail even when both compile independently.
C:Partial distributed operations need explicit consistency or retry strategies. producers and consumers can fail even when both compile independently.
D:Robust integrations handle more than a happy-path mock. What should be validated. Producers and consumers can fail even when both compile independently.
Question 405
A payment service uses retries and asynchronous event publication. Which TWO integration tests are especially important? (Select TWO.)
- Simulate a database commit followed by failed event publication.
- Remove error-body handling to simplify the client.
- Verify duplicate retries cannot create duplicate payment effects.
- Assume local unit tests prove remote API contract compatibility.
- Test only a successful response from an always-successful mock.
Explanation
Correct Answers
A:Partial failure can create inconsistent distributed state.
C:Idempotency protects business state when network requests repeat.
Incorrect Answers
B:Error contracts are part of integration correctness.
D:Real network boundaries may differ from mocks.
E:Happy paths cannot validate failure recovery.
Question 406
A generated sorting function appears correct for a simple list. What edge case should be included?
- Use property-based or fuzz testing with invariant assertions.
- Test empty, duplicate-key, already sorted, and reverse-sorted inputs.
- Probe memory, runtime growth, and algorithmic limits on scaled inputs.
- Test timezone transitions and ambiguous or nonexistent local times.
Explanation
Correct Answer
B:Ordering bugs often surface at boundaries and ties.
Incorrect Answers
A:Broad generated inputs explore unexpected cases beyond handpicked examples. What edge case should be included. Ordering bugs often surface at boundaries and ties.
C:Correct small-input results do not establish scalability. Ordering bugs often surface at boundaries and ties.
D:Clock rules create boundary conditions that simple timestamps miss. ordering bugs often surface at boundaries and ties.
Question 407
A validator handles ASCII letters but not emojis or combining marks. What should be tested?
- Probe memory, runtime growth, and algorithmic limits on scaled inputs.
- Test empty, duplicate-key, already sorted, and reverse-sorted inputs.
- Include Unicode normalization and multicodepoint grapheme inputs.
- Test timezone transitions and ambiguous or nonexistent local times.
Explanation
Correct Answer
C:Text length and character classes vary beyond ASCII.
Incorrect Answers
A:Correct small-input results do not establish scalability. Text length and character classes vary beyond ASCII.
B:Ordering bugs often surface at boundaries and ties. text length and character classes vary beyond ASCII.
D:Clock rules create boundary conditions that simple timestamps miss. text length and character classes vary beyond ASCII.
Question 408
A parser claims it never crashes on any string. What verification technique can help?
- Use property-based or fuzz testing with invariant assertions.
- Include Unicode normalization and multicodepoint grapheme inputs.
- Test empty, duplicate-key, already sorted, and reverse-sorted inputs.
- Probe memory, runtime growth, and algorithmic limits on scaled inputs.
Explanation
Correct Answer
A:Broad generated inputs explore unexpected cases beyond handpicked examples.
Incorrect Answers
B:Text length and character classes vary beyond ASCII. What verification technique can help. Broad generated inputs explore unexpected cases beyond handpicked examples.
C:Ordering bugs often surface at boundaries and ties. broad generated inputs explore unexpected cases beyond handpicked examples.
D:Correct small-input results do not establish scalability. Broad generated inputs explore unexpected cases beyond handpicked examples.
Question 409
A date formatter works near noon but fails at daylight-saving transitions. What should be added?
- Use property-based or fuzz testing with invariant assertions.
- Include Unicode normalization and multicodepoint grapheme inputs.
- Test timezone transitions and ambiguous or nonexistent local times.
- Test empty, duplicate-key, already sorted, and reverse-sorted inputs.
Explanation
Correct Answer
C:Clock rules create boundary conditions that simple timestamps miss.
Incorrect Answers
A:Broad generated inputs explore unexpected cases beyond handpicked examples. clock rules create boundary conditions that simple timestamps miss.
B:Text length and character classes vary beyond ASCII. What should be added. Clock rules create boundary conditions that simple timestamps miss.
D:Ordering bugs often surface at boundaries and ties. clock rules create boundary conditions that simple timestamps miss.
Question 410
A sequence algorithm fails on extremely large lists. What should the test plan examine?
- Use property-based or fuzz testing with invariant assertions.
- Include Unicode normalization and multicodepoint grapheme inputs.
- Probe memory, runtime growth, and algorithmic limits on scaled inputs.
- Test timezone transitions and ambiguous or nonexistent local times.
Explanation
Correct Answer
C:Correct small-input results do not establish scalability.
Incorrect Answers
A:Broad generated inputs explore unexpected cases beyond handpicked examples. correct small-input results do not establish scalability.
B:Text length and character classes vary beyond ASCII. What should the test plan examine. Correct small-input results do not establish scalability.
D:Clock rules create boundary conditions that simple timestamps miss. Correct small-input results do not establish scalability.