CS FundamentalsVery hardProduct-company placement · Git interview

How many of these situations can produce a merge conflict when merging branch B into A from their common ancestor O? 1. A and B changed the same line differently. 2. A deleted a file that B modified. 3. A and B added different files with the same path and different contents. 4. A changed line 10 and B changed line 200 of the same file. 5. A and B made the identical change to the same line.

  1. A. 4
  2. B. 2
  3. C. 3
  4. D. 1

Correct answer: C. 3

1, 2 (modify/delete) and 3 (add/add) conflict. Changes to distant lines merge cleanly, and identical changes on both sides are taken once without a conflict.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic