interview.practice
Git and Collaborative Development interview questions
Answer aloud before opening each explanation. Focus on the reasoning, not memorized wording.
0/8 saved answers | 8 questions shown
01What does a commit store?CommitsBeginner
Model answer
A snapshot plus metadata and parent history.
Why
Git history is a graph of immutable commit objects.
02Why does Git have a staging area?StagingBeginner
Model answer
To select the exact content of the next commit.
Why
Staging separates current working changes from the proposed snapshot.
03When is revert safer than reset?UndoIntermediate
Model answer
When the commit has already been shared.
Why
Revert preserves public history by adding an inverse commit.
04What is a Git branch?BranchesIntermediate
Model answer
A movable reference to a commit.
Why
Branches name current lines of development.
05How do fetch and pull differ?RemotesIntermediate
Model answer
Fetch downloads references; pull also integrates them.
Why
Fetch allows inspection before changing the current branch.
06What causes a merge conflict?ConflictsIntermediate
Model answer
Git cannot automatically reconcile overlapping incompatible changes.
Why
A developer must understand both intentions and create the final content.
07When is interactive rebase appropriate?HistoryAdvanced
Model answer
For cleaning local, unshared history.
Why
Rebase rewrites commits and should be coordinated carefully for shared branches.
08What should a pull request optimize for?WorkflowAdvanced
Model answer
A focused, reviewable change with evidence from tests.
Why
Small coherent reviews reduce risk and improve feedback.