Compare trunk-based development with GitFlow. Which would you choose for a team that deploys several times a day, and why?
What the interviewer wants to hear
- Trunk-based uses short-lived branches merged to main at least daily
- GitFlow uses long-lived develop, release and hotfix branches
- Frequent deploys favour trunk-based with feature flags
- Branch protection, required reviews and CI checks on main
- GitFlow can suit versioned products with scheduled releases
Model answer
Trunk-based development means everyone works on small, short-lived branches and merges into main at least once a day, so integration happens continuously and merge conflicts stay small. Unfinished work is merged behind feature flags. GitFlow adds long-lived develop and release branches plus hotfix branches, which gives structure for products that ship numbered releases on a schedule, but it delays integration and makes merges bigger. For a team deploying several times a day I would choose trunk-based development. Main is protected: changes come through pull requests with review and required CI checks, and every merge to main produces a deployable artifact. Feature flags separate deploying code from releasing a feature, so we can turn things off without a rollback. If we support old versions for customers, I would add short-lived release branches cut from main only for those versions.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy DevOps Engineer questions
- What does DevOps mean to you, and how is it different from a traditional operations team?
- Walk me through the stages of a typical CI/CD pipeline you would build for a web service.
- How is a container different from a virtual machine? When would you choose one over the other?
- What is Infrastructure as Code and why is it better than creating resources by clicking in the cloud console?
- Explain how a Deployment, a Service and an Ingress work together to expose a web app in Kubernetes.
- Walk me through what happens when you run docker run -p 8080:80 nginx:1.27 on a fresh machine.
- What is the difference between monitoring and observability, and what are the main signals you would collect for a web service?
- How does a load balancer use health checks, and what makes a good health check endpoint?
- Terraform and Ansible are both called infrastructure as code. How do they differ, and when would you use each?