Git & GitHub Module 13
Teamwork and open source interview questions
Interview questions on teamwork and open source: short warm-ups, then what each harder question tests, the first step of a good answer and its follow-ups.
Warm-up questions
Short questions with short answers, each answered in full.
-
Fresher
What is the difference between GitHub flow and Git flow?
Answered in the lesson Team workflows: GitHub flow, trunk-based, Git flow
-
Fresher
What is the difference between a ruleset and a branch protection rule on GitHub?
Answered in the lesson Set up a repository for collaborators
Questions with model answers
What each question tests, the first step of a good answer and the follow-ups to expect.
-
Mid to senior
Your product has a cloud version that deploys from main several times a day and a self-hosted server that customers install. A new self-hosted version ships every two weeks, and customers expect security fixes for a year. Design the branches, say where each fix lands first, and keep the number of supported branches manageable.
- What it tests
- Release branches for installed versions, the direction of backports, a support policy that bounds the branch count, and the automation that keeps fixes from being forgotten.
- First step
- Count first: a release every two weeks supported for a year means 26 live branches, which nobody can test. So the first decision is a support policy, such as long-term releases, and only then the branch layout: main for the cloud, one release branch per supported version, fixes on main first.
- Follow-ups
-
- A fix does not apply to a two-year-old release branch. What do you do?
- How do you make sure no supported branch misses a security fix?
- When is a release branch deleted, and what must exist before that?
From the lesson Team workflows: GitHub flow, trunk-based, Git flow
Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.Opening the model answers with your pass…
Model answers open with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; nothing renews unless you choose to. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so the model answers can’t be opened at the moment. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
Your team runs a web app with one production version on Git flow. Releases are cut every two weeks, a finished feature waits about six days to reach users, and every release takes an afternoon of merging. You propose trunk-based development. What do you change, in what order, and what could go wrong?
- What it tests
- Measuring lead time, a staged migration through GitHub flow, the prerequisites of trunk-based development (fast checks, flags, small changes) and the risks of moving too fast.
- First step
- Measure before changing anything: lead time from merge to production, how long branches live, how often a release or hotfix merge conflicts. Then move in steps. Retire develop by making main the integration branch with the same protections, keep short feature branches with pull requests, and only then shrink them towards daily integration.
- Follow-ups
-
- Unfinished features would now reach production. How do you stop that?
- The test suite takes 40 minutes. Does trunk-based development still work?
- What replaces the hotfix branch?
From the lesson Team workflows: GitHub flow, trunk-based, Git flow
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Fresher to mid
You become admin of your college club's public repository. All twelve members can push to main, the build broke three times last week, and nobody knows who reviews what. You have one afternoon. What do you set up, in what order, and what do you deliberately leave for later?
- What it tests
- Prioritising protections by risk, least-privilege roles, required checks that can actually report, code owners, and not burying a small team in process.
- First step
- Stop the damage first: a ruleset on main that blocks force pushes and deletions and requires a pull request with one approval and the test check, after confirming that the check runs on every pull request. Then fix access: move members to the lowest role that fits, and only after that add code owners and templates.
- Follow-ups
-
- Two members complain that one approval slows them down. What do you answer?
- Which rules would you leave off for a club of twelve, and why?
- How do you check that the setup works before you announce it?
From the lesson Set up a repository for collaborators
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
Your CODEOWNERS file names one senior developer as owner of src/, and main's ruleset requires a code owner's approval. Pull requests now wait three days on average, most of them for her. How do you remove the bottleneck without losing the protection the rule was meant to give?
- What it tests
- How code-owner review works, ownership by teams and narrower paths, review load balancing, and measuring wait times instead of guessing.
- First step
- Measure where the wait is: time from opening to first review, per owner and per path. Then spread the ownership: make a team the owner instead of a person, split src/ into the areas people really know, and keep the single owner only for the files where her judgement is the protection.
- Follow-ups
-
- The team has only two people who know the payment code. What do you do there?
- Would lowering the required approvals to zero for small changes be safe?
- How do you stop CODEOWNERS from going stale as people join and leave?
From the lesson Set up a repository for collaborators
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
All Git & GitHub interview questions · The Git & GitHub track