Trunk-Based Development vs Long-Lived Branches
Go deep on Trunk-Based Development vs Long-Lived Branches: edge cases, scalability limits, and how you'd evolve the solution over 2 years.
Answers use simple, clear English.
Audio N/AQuick interview answer
Short-lived branches merge to main frequently; feature flags hide incomplete work. Long-lived release branches increase merge pain and drift.
Detailed answer
Short-lived branches merge to main frequently; feature flags hide incomplete work. Long-lived release branches increase merge pain and drift. Scale limits often appear in: Needs solid CI and flag discipline.. Evolution levers: Required checks; small PRs; flags for incomplete features.. Anchor example: Team merges daily to main; dark-launches checkout redesign behind flag. Core: Short-lived branches merge to main frequently; feature flags hide incomplete work. Long-lived release branches increase merge pain and drift. Real-time example: Team merges daily to main; dark-launches checkout redesign behind flag. Pros: Smaller PRs; continuous integration truly continuous. Cons: Needs solid CI and flag discipline. Common mistakes: Week-long feature branches without syncing main. Best practices: Required checks; small PRs; flags for incomplete features. Audience level: Fresher.
Full explanation
Short-lived branches merge to main frequently; feature flags hide incomplete work. Long-lived release branches increase merge pain and drift.
Real example & use case
Team merges daily to main; dark-launches checkout redesign behind flag.
Pros & cons
Pros: Smaller PRs; continuous integration truly continuous. Cons: Needs solid CI and flag discipline.
Common mistakes
Week-long feature branches without syncing main.
Best practices
Required checks; small PRs; flags for incomplete features.
Follow-up questions
Open one as its own read / solve / listen card