In trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?
IntermediateScenarioBranching Strategies and Releases
Answer
Situation read → Branch lifetime must stay short, but the feature is not ready for users.
What I'd do →
- Slice the work into small mergeable steps (schema, backend, API, UI).
- Wrap user-visible paths in a feature flag, default off.
- Merge each slice behind the flag; test both flag states in CI.
- Turn the flag on for staff, then a percentage, then everyone; remove the flag afterwards.
Why → Deployment and release become separate decisions, and rollback is a flag flip.
Interview tip → Mention flag clean-up as a real task, or flags rot into complexity.
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateWhen would you choose GitFlow over trunk-based development?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?IntermediateProduction has a bug, but `main` already contains unreleased features. How do you ship a hotfix?Intermediate