AZ400-Q: Resolving a merge conflict
Q: Two developers (A and B) each branched from
main. Both edited line 10 ofconfig.json. Developer A’s PR merges first. When developer B’s PR is reviewed, what happens, and what must the team do?
- A) Git auto-merges because the two branches both came from
main - B) A merge conflict occurs — B must rebase onto the updated
main, resolve the overlapping change, and re-test ✓ - C) The PR is automatically rejected by the policy
- D) Git silently keeps B’s version of the line
Answer: B. Because both changes modified the same line(s), Git cannot auto-merge and raises a merge conflict. The developer must pull/rebase the updated main, resolve the conflicting region (keeping the intended content), run tests, and re-push. Merge conflicts are normal — the goal is a fast, correct resolution with code review, not avoiding them entirely.
Why it helps
Merge conflict handling is core Git/AZ-400 source-control knowledge — knowing why a conflict happens and the resolve-rebase-test loop is frequently tested.