Question 240
Two Claude Code tasks need to edit overlapping files on different branches at the same time. Which setup best reduces working-directory interference?
- Require both tasks to modify the same temporary copy without version control.
- Have each task force-reset the other's branch before saving.
- Create two different conversation sessions in the same checkout and assume their different session identifiers also isolate branch files on disk.
- Give each task a separate worktree or checkout and integrate the resulting changes deliberately.
- Create two branches but have both sessions switch and edit them in the same working directory concurrently.
Explanation
Correct Answer
D:Separate working directories isolate branch edits while preserving a clear integration step. A worktree separates checked-out files and branch state, but related changes still need review during integration. Isolation prevents concurrent overwrites; it does not prove semantic compatibility.
Incorrect Answers
A:A shared unversioned copy retains the same conflict risk and loses useful change history.
B:Repeated resets destroy concurrent work rather than safely isolate it.
C:Conversation separation does not provide filesystem isolation. Both sessions can still overwrite the same working-tree content.
E:Branch names do not create separate files on disk. Concurrent switches and edits can still interfere until the tasks have isolated worktrees or checkouts.
Question 241
A merge contains conflicting changes to a validation function. Both branches added different required checks. What is the correct resolution approach?
- Keep the entire theirs version automatically.
- Delete the function so no conflict remains.
- Keep the entire ours version automatically.
- Merge both required behaviors and test their interaction.
Explanation
Correct Answer
D:Removing conflict markers only restores valid syntax. Resolve the competing changes according to both requirements, then verify that the combined function preserves the required checks.
Incorrect Answers
A:Selecting the other side wholesale can lose the current branch's required validation.
B:Eliminating the implementation removes the required behavior instead of resolving the competing edits.
C:One-sided resolution may discard a requirement implemented by the other branch.
Question 242
A project generates API clients from a committed schema. The user asks to add a field. What should Claude Code normally modify?
- The authoritative schema, then regenerate the client using the project's documented process.
- Every dependency's source code in the package cache.
- Only the generated client, leaving the schema unchanged.
- The generated file's timestamp without changing content.
Explanation
Correct Answer
A:Changing the source of generation makes the field reproducible and keeps generated outputs consistent. Generated artifacts are outputs of a repeatable build process. Editing only the client can produce a temporary patch that disappears during the next regeneration.
Incorrect Answers
B:Editing cached dependencies is unrelated to the project schema and will not reliably persist.
C:The next regeneration would erase a change that is absent from the authoritative input.
D:A timestamp change does not implement the requested API field.
Question 243
Claude Code adds a dependency through a project manifest but leaves the lockfile unchanged. What should the reviewer request?
- Delete the lockfile permanently so CI can choose arbitrary versions.
- Handwrite a plausible checksum into the lockfile.
- Commit only the manifest and report deterministic installation.
- Run the approved package-manager workflow and inspect the resulting lockfile changes.
Explanation
Correct Answer
D:The package manager can resolve the dependency consistently and record verifiable installation metadata. The resulting diff should be checked for unexpected dependency upgrades beyond the requested addition. A synchronized manifest and lockfile support repeatable CI installation.
Incorrect Answers
A:Removing reproducibility is not an appropriate fix for an incomplete dependency update.
B:Invented metadata can make installation fail and does not represent a resolved dependency.
C:The unresolved lockfile mismatch does not support that reproducibility claim.
Question 244
The requested fix changes one error message, but the final diff reformats 2,000 unrelated lines. What should Claude Code do before handing it over?
- Commit the formatting and message fix together, then ask the reviewer to ignore whitespace in every file.
- Keep the formatting because the formatter is approved, without checking whether repository-wide formatting was requested.
- Remove unrelated formatting changes while preserving the intended message fix.
- Revert the entire patch without restoring the requested error-message correction.
Explanation
Correct Answer
C:A focused diff makes the requested behavior easier to review and reduces incidental merge conflicts. Unrelated formatting can overwhelm the signal of a one-line behavior change. Removing that churn also makes later merges less likely to conflict on untouched logic.
Incorrect Answers
A:A viewing filter can hide whitespace effects but does not remove unrelated changes from the patch. The submitted scope would still exceed the requested message fix.
B:An approved tool can still produce changes outside the task. Tool choice does not determine the authorized scope of the final diff.
D:This removes the formatting noise but also loses the actual fix. The cleanup should preserve the targeted change while discarding unrelated edits.
Question 245
A one-line edit appears as a whole-file replacement because line endings changed. What is the best next action?
- Treat every replaced line as a separate feature implementation.
- Delete the original file history to reduce the diff.
- Restore the repository's expected line endings and recheck the focused diff.
- Accept the replacement without checking repository conventions.
Explanation
Correct Answer
C:Consistent line endings reveal the actual content change and avoid unrelated churn. A line-ending conversion can make unchanged content appear deleted and re-added. Restoring the expected convention separates representation noise from the actual message correction.
Incorrect Answers
A:Formatting changes do not represent newly implemented behavior.
B:History removal is unnecessary and does not fix the changed line endings.
D:Unexplained file-wide changes make it harder to verify the intended one-line edit.
Question 246
A user asks Claude Code to implement and locally test a fix. The code is ready. What action remains outside that request unless separately authorized?
- Reading the edited function to verify the patch.
- Summarizing the changed behavior and test result.
- Running the project's relevant local tests.
- Publishing a production release of the changed application.
Explanation
Correct Answer
D:Local implementation and testing do not by themselves authorize production publication. A production release changes the external environment and its users, beyond the local work requested. The ready patch and test evidence can be reported without performing that additional action.
Incorrect Answers
A:Inspecting the changed code is a normal part of completing the requested local fix.
B:A completion summary reports the requested work and does not publish the application.
C:Relevant local validation falls within the explicitly requested testing work.
Question 247
A user rejects one hunk of the agent's patch but wants the rest kept. What is the appropriate revision?
- Revert the entire file even though it also contains accepted hunks.
- Leave the rejected code in place but add a comment explaining the user's objection.
- Revert or revise the identified hunk and revalidate the affected behavior.
- Reset the entire repository to its remote branch.
Explanation
Correct Answer
C:A targeted revision respects the user's selection while preserving the accepted portion of the patch. The agent should avoid blanket resets because they can remove accepted or unrelated work. Relevant verification then confirms that the revised patch still behaves as intended.
Incorrect Answers
A:File-wide restoration would discard changes the user explicitly wants to keep. The requested revision applies to the rejected hunk and its necessary consequences.
B:A comment records disagreement without making the requested behavioral revision. The rejected portion still needs to be removed or corrected.
D:A wholesale reset would discard accepted changes and potentially unrelated developer work.
Question 248
A bug report describes an input that crashes a parser. What is the most informative initial validation step?
- Change unrelated parser options until the crash disappears.
- Replace the complete parser before inspecting the failing path.
- Assume the report is false if the default example works.
- Reproduce the crash with a minimal input and record the expected behavior.
Explanation
Correct Answer
D:A focused reproduction establishes the defect and creates a meaningful way to verify the eventual fix. The failing input anchors the diagnosis to an observable condition. After the patch, the same case should stop failing for the intended reason rather than because the test was weakened.
Incorrect Answers
A:Uncontrolled changes obscure which condition causes the reported failure.
B:A broad rewrite is premature when a narrow reproduction can identify the defect.
C:Passing a different input does not disprove a failure on the reported case.
Question 249
A patch fixes an off-by-one error. Which regression test is most useful?
- A test that duplicates the patched arithmetic expression and compares it with itself.
- A test that asserts the helper function contains a particular variable name.
- A test that passes whenever the source file exists.
- A boundary-input test with independently specified expected output.
Explanation
Correct Answer
D:An externally defined boundary expectation detects the defect even if the implementation is later refactored. A boundary assertion describes what the parser must do, independent of helper names or internal arithmetic. That makes the regression test useful after future implementation changes.
Incorrect Answers
A:Repeating the implementation can reproduce the same error without detecting incorrect output.
B:A variable-name assertion is tied to implementation style rather than the corrected behavior.
C:File existence does not exercise the off-by-one behavior.
Question 250
The relevant test fails both before and after a proposed change with the same missing-fixture error. What should the report state?
- That the patch is fully verified because the failure was pre-existing.
- That the patch introduced the missing fixture without further evidence.
- The observed baseline failure and the fact that this test has not validated the patch.
- That the failed test can be silently removed from the suite.
Explanation
Correct Answer
C:Comparing baseline and final runs separates existing breakage from evidence about the new change. The identical fixture error is evidence of a baseline problem, not proof that the patch is good or bad. Any other completed checks should be reported separately from this blocked validation.
Incorrect Answers
A:An existing failure still prevents this test from providing a passing validation signal.
B:An unchanged baseline failure does not establish that the new code caused it.
D:Deleting a test would conceal the unresolved validation condition.