01 / 09

What is Git?

Difficulty: 3/10
version control, branching, collaboration

Git is a distributed version control system (DVCS) used to track changes in source code during software development. It allows multiple developers to collaborate, maintain version history, and manage code efficiently.

Scenario Questions

0-2 years experience

  1. 1You need to add a new feature and want to keep your work isolated. How would you use Git to start that work?
  2. 2If you accidentally modify a file and haven't committed yet, what Git command would you use to discard those changes?
  3. 3When you run `git status` and see 'untracked files', what does that mean and what would you do next?

2-5 years experience

  1. 1During a sprint, a teammate's merge caused a conflict in `config.yml`. Walk me through how you'd resolve it and ensure the merge stays clean.
  2. 2You notice that after pulling the latest changes, your local tests are failing. How would you investigate whether the issue is due to a recent commit or a merge problem?
  3. 3Our CI pipeline is failing because the repository's history has grown large. What Git strategies could you employ to reduce repo size without losing history?

5-8 years experience

  1. 1Our monorepo now contains several hundred microservices, and developers complain about long clone times. How would you redesign the Git workflow or repository layout to improve scalability?
  2. 2We need to enforce a policy that only signed commits are allowed on the main branch. Describe how you'd implement this at the repository level and what tooling you'd use.
  3. 3A release branch has diverged significantly from `main` over months. What steps would you take to safely integrate critical fixes from `main` into the release branch while preserving release history?

8+ years experience

  1. 1Our organization is migrating from a legacy Perforce system to Git across dozens of teams with different workflows. What high‑level migration plan would you propose, and how would you address cross‑team coordination, history preservation, and tooling adoption?
  2. 2We want to adopt a trunk‑based development model but have many existing long‑living feature branches. How would you transition the codebase and culture, and what Git features would you leverage to minimize disruption?
  3. 3Given the need for auditability and compliance, how would you design a Git‑centric architecture that supports immutable release artifacts, signed tags, and integrates with our CI/CD pipeline at scale?

Follow-up Questions

  • Why would you choose a rebase over a merge in that scenario?
  • Can you walk me through the exact commands you’d run to fix the conflict?
  • What trade‑offs did you consider when proposing that repository layout?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.