Interview Preparation
Consolidate Git and GitHub fundamentals with targeted interview questions across concepts, commands, workflows, and troubleshooting.
Simple Explanation (ELI5)
Interviews check if you can work safely with a team, not just memorize commands. You need to explain what you do when things go wrong and why your workflow avoids risk.
Technical Explanation
Strong candidates demonstrate command fluency, branching strategy rationale, PR and review discipline, CI awareness, and recovery techniques for merge/conflict/history mistakes.
Rapid Revision Sheet
Core ideas: - Git = local distributed VCS - GitHub = remote collaboration platform - Branch strategy = main + short-lived feature branches - PRs = review, checks, controlled merge - Merge conflicts = overlapping edits resolved manually - CI checks = quality gates before merge Essential commands: - git status, git add, git commit, git log - git checkout -b, git branch -d - git fetch, git pull --rebase, git push - git rebase, git revert, git restore - git reflog, git cherry-pick
Mock Practical Round
- Create a feature branch, commit two changes, and open a PR-ready branch.
- Resolve a simulated merge conflict and explain your decision.
- Recover a lost commit using reflog.
- Write a basic GitHub Actions workflow for PR checks.
- Explain how you would rollback a bad merge in production.
Interview Questions
Beginner
It tracks file changes over time, enabling collaboration, history, and rollback for safe development.
Git is the underlying VCS tool; GitHub is a hosted collaboration platform around Git repositories.
An isolated line of development that allows safe work without affecting main.
A merge proposal with review and automated checks before integration.
A conflict when Git cannot auto-merge overlapping changes in same file sections.
Intermediate
Rebase to keep feature branch history linear and current with main before PR merge.
They require checks/reviews and block risky direct pushes to critical branches.
It force-pushes only if remote hasn’t changed unexpectedly, reducing accidental overwrite.
Clear purpose, linked issue, test evidence, risk notes, and scoped diff.
It runs CI checks automatically and acts as merge gate via required status checks.
Scenario-based
Identify bad merge, revert quickly, restore green CI, then apply corrected fix via new branch.
Fetch latest, rebase onto updated target, clean commits, then push with force-with-lease.
Rotate secrets immediately, rewrite history, run secret scanning, and document incident.
Prioritize one fix path, merge it first, then rebase the second and retest.
Trace release window commits, inspect PR discussions and CI logs, identify root commit and merge context.
Debugging Scenarios
- Command confusion in interview: Explain intent first, then command sequence.
- Asked about unknown edge case: State safe diagnostic flow (
status → log → diff → fix). - Whiteboard merge conflict question: Show conflict markers and resolution strategy clearly.
- CI pipeline question: Walk through trigger, job, step, and required checks lifecycle.
Real-world Use Case
A candidate shared a concrete story: resolved a high-pressure merge conflict during a release incident, reverted safely, and restored service in minutes. This practical narrative carried more weight than memorized definitions.
Summary
Interview strength comes from combining concepts with operational judgment. Show that you can collaborate safely, troubleshoot quickly, and keep delivery reliable under pressure.