A branch is a parallel line of development. The default branch is usually main or master. Branches allow isolated work without affecting the main codebase.
Scenario Questions
0-2 years experience
1We need a new feature branch off develop. Walk me through the exact git commands you’d run and why.
2If you accidentally commit directly to main, how would you move that commit onto a new feature branch without losing history?
3After finishing a feature, what steps do you take to merge it back while keeping the main branch stable?
2-5 years experience
1Our team follows GitFlow, but a critical hotfix is required now. Explain how you’d use branches to deliver the hotfix without blocking ongoing feature work.
2During a merge of a feature branch into develop you hit a conflict in a shared config file. How do you resolve it and prevent similar conflicts later?
3A merge of a long‑lived feature branch caused the CI pipeline to fail. How would you investigate whether the problem is the merge strategy or branch divergence?
5-8 years experience
1The monorepo has dozens of active branches and CI is slowing down. How would you redesign the branching strategy to improve throughput while preserving stability?
2Compare short‑lived feature branches with frequent rebases versus long‑lived branches with merge commits. What are the trade‑offs for code review, CI load, and history readability?
3Someone rebased a shared branch and force‑pushed, breaking downstream builds. How do you recover the branch and put safeguards in place?
8+ years experience
1We’re migrating from SVN to Git across multiple product lines and want to keep the existing branching model. How would you plan the migration to map SVN branches, preserve history, and minimize disruption?
2Multiple autonomous squads share a core library but have independent release cadences. How would you structure branching and releases to enable independent delivery while avoiding integration hell?
3Discuss the long‑term maintenance implications of moving from a GitFlow model to trunk‑based development as the organization scales from 50 to 500 engineers.
Follow-up Questions
Why would you prefer rebasing over merging in that scenario?
What impact does that choice have on the CI pipeline?
How would you communicate the branching decision to the rest of the team?
Sharethis question
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.