#4 most askedVery commonEasyBranching & PRs
Resolving a merge conflict
New to Branching & PRs? Learn it from scratch firstBranches, Pull Requests & Code Review โ
๐ข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.You pull and Git reports a conflict in pricing.ts. Walk through resolving it safely.
๐ค Answer it out loud, then check yourself
Say your answer as if the interviewer is listening (30โ90 seconds). Then reveal what a strong answer covers and tick what you said.
const conflicted = [
"<<<<<<< HEAD",
"const MONTHLY = 5;",
"=======",
"const MONTHLY = 6;",
"const YEARLY = 39;",
">>>>>>> main",
].join("\n");
const ours = conflicted.split("=======")[0].split("\n").slice(1).join("\n");
const theirs = conflicted.split("=======")[1].split(">>>>>>>")[0].trim();
console.log("OURS:\n" + ours.trim() + "\n\nTHEIRS:\n" + theirs);
console.log("\nResolved (decided with the team): const MONTHLY = 5; const YEARLY = 39;");
Answer out loud first, then compare.
Want to rehearse it?Answer this to the AI interviewer and get a verdict โ