InterviewDB Question

Merge Diff: Implement a Three-Way Merge Algorithm for Text Files

Question Details

Problem Implement a three-way merge: given a base version and two branches (ours and theirs), produce a merged result. If both branches changed the same lines differently, mark as a conflict. Changes to non-overlapping lines are merged automatically. Example Follow-ups What diff algorithm do you use as the foundation (LCS, Myers diff)? How do you handle moves (a block deleted in one place and inserted elsewhere)? How does this extend to structured formats like JSON or XML where line-level diffs…

Full Details

🔒

Unlock all Jane Street questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a jane street interview during the onsite round.

It covers the following topics: Coding, Onsite .