CS FundamentalsVery hardGATE CS · Product-company placement

A three-way merge compares five separate regions of a file. Base / ours / theirs: R1 a / a / a; R2 b / B1 / b; R3 c / c / C2; R4 d / D1 / D2; R5 e / E1 / E1. How many regions end in a merge conflict?

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

Correct answer: D. 1

A region changed on only one side takes that side (R2 → B1, R3 → C2), and the identical change on both sides merges cleanly (R5). Only R4, changed differently on both sides, conflicts. Comparing ours with theirs directly (without the base) would wrongly flag R2, R3 and R4.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic