Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Design a branch strategy, including trunk-based, feature branch, and release branch

A worked example

Single answer

Your team uses a trunk-based strategy based on the Microsoft release flow. Developers work in short-lived topic branches that merge into main. At the end of each three-week sprint, a release branch is created from main and deployed to production. A new feature will take about six weeks to finish.

Requirements:

  • Work on the feature must be merged into main every few days to avoid merge debt.
  • Users must not see the feature until it is complete, even though sprint releases will contain its code.

How should the team develop the feature?

Choose one answer
Why

The Microsoft release flow combines frequent integration through short-lived topic branches with feature flags for longer development efforts. Unfinished functionality can be merged into main provided the product still builds and deploys. Keeping the feature hidden behind a flag allows its code to ship in sprint releases without exposing it to users before completion.

  • Not correct: Merge short-lived branches into main every few days and expose the feature as each part is merged. This meets the integration requirement but explicitly exposes unfinished functionality. The source describes using feature flags to separate code deployment from feature exposure.
  • Correct: Merge short-lived branches into main every few days and hide the feature behind a feature flag. The release flow avoids long-running feature branches by using feature flags. Code merges into main often and deploys, while the flag hides the feature from users until it is complete.
  • Not correct: Build the feature in one branch for six weeks and merge it into main when it is complete. This is the long-running feature branch the release flow avoids. Work stays out of main for six weeks and builds merge debt.
  • Not correct: Commit the feature work to each sprint's release branch and port it to main at the end. Waiting until the end to port the feature violates the requirement to integrate into main every few days. The source describes integrating topic branches into main and creating sprint release branches from main.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free