How does your branching strategy affect continuous delivery? Trunk-based versus long-lived branches.
What they are really testing: Whether you know trunk-based development (short-lived branches, frequent merges, flags) enables CD, while long-lived branches (GitFlow) batch changes into big risky merges that slow delivery.
A real interview question
How does your branching strategy affect continuous delivery? Trunk-based versus long-lived branches.
What most people say
drag me
“I would use GitFlow with feature, develop, and release branches to keep things organized.”
GitFlow batches changes into long-lived branches and big merges, which works against continuous delivery. For frequent, low-risk deploys you want trunk-based development with short-lived branches and flags. The answer should weigh that.
The follow-ups they ask next
How do you merge unfinished work to main without breaking things in trunk-based development?
Hide it behind a feature flag turned off, or build it in a backward-compatible, dormant way (branch by abstraction). The code integrates continuously but is not exposed until the flag is enabled.
When is GitFlow still a reasonable choice?
For versioned/released software (libraries, packaged products) where you maintain multiple supported versions and need release branches. For a continuously-deployed service, it adds batching and merge pain that work against CD.
What the interviewer is listening for
- Trunk-based = frequent small merges + flags
- Knows it keeps main always releasable (enables CD)
- Knows GitFlow batches/big merges + when it fits
What sinks the answer
- Defaults to GitFlow for a CD service
- No link between branching and integration risk
- Unaware of trunk-based + flags
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“Trunk-based development [integrates to main frequently via short-lived branches, daily merges, unfinished work behind flags], which [keeps integration continuous and main always releasable, the precondition for CD]. Long-lived branches/GitFlow [batch changes into big risky infrequent merges, delaying integration]. Trunk-based is [the norm for frequent low-risk delivery]; GitFlow fits [versioned/released software with multiple supported versions].”
Keep going with deployment
Foundation
What do CI and CD actually mean, and what is the difference between continuous delivery and continuous deployment?
Foundation
Why should you build an artifact once and promote the same one through environments?
Junior
What stages should a good CI/CD pipeline have?
Junior
A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
Junior
What are feature flags, and how do they decouple deployment from release?
Mid
Compare blue-green and canary deployments. When would you reach for each?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free