Free AI interview assistant

Undetectable AI Interview Assistant

Invisible During Screen Sharing for Live Calls

Cluegent gives real-time interview answers, coding help, screenshot-aware context, and meeting support from a private Windows and macOS desktop overlay for Zoom, Meet, Teams, and technical calls.

Try for free
Get for Windows

Used by 4,000+ people

Live desktop AI copilot
Resume-aware answers Screenshot coding help Zoom · Meet · Teams

Interview questions and worked practice

Git Interview Questions: Branches, Conflicts, and Recovery

Git interview questions are easier when you distinguish the working files, staging area, commit history, and shared branch. Explain the intended result before choosing a command.

What is the difference between a working tree and a commit?

The working tree contains the files you are editing. The index records what is staged for the next commit. A commit records a snapshot with history information. Editing a file after staging it can leave one version staged and a newer version in the working tree.

Our exercise changes a configuration value, stages it, then edits a comment in the same file. Explain why the next commit may omit that comment. Review the staged difference when describing exactly what a commit will contain.

When would you merge rather than rebase?

A merge combines histories while retaining the existing commits. Rebasing replays changes onto another base and creates new commit identities. The practical decision depends on whether others already depend on the branch and on the team's collaboration convention.

Imagine a feature branch used by three developers. Rewriting it without coordination can leave collaborators working from different histories. Explain how you would update your branch and resolve conflicts while preserving their work. There is no universally best history shape for every team.

How does revert help undo a shared change?

Git revert records a new commit that reverses the effect of an earlier change. It is useful when the original commit is already part of shared history. Reverting code does not automatically reverse a database migration, an external payment, or another side effect produced by a deployment.

In an interview, describe both repository recovery and application recovery. If the commit removed a field that a newer release already relies on, a blind revert may create another incompatibility. Inspect dependent changes and define the behavior you want restored.

How do you resolve a conflict correctly?

Read both changes and the surrounding behavior, then decide what the final program should do. Accepting one side mechanically can discard a valid fix from the other side. Resolve the file, inspect the resulting difference, and run the relevant checks.

Suppose one branch renames a function while another adds validation inside it. The correct resolution may combine the new name with the validation. Explain why removing conflict markers proves only that the file is syntactically merged, not that the intended behavior survived.

Practice exercise

Draw a shared main branch with commits A, B, and C. B introduces a bug; C adds a useful feature that depends on part of B. Describe a recovery that keeps C working, and explain what you would verify before publishing it.

Repeat with an uncommitted local edit present. Identify what must be preserved before any history operation. The strongest answer separates recovering code, coordinating with teammates, and verifying the deployed behavior.

Rehearse this answer with Cluegent

Ask Cluegent to challenge your recovery plan with a dependent commit or an uncommitted file. Practise explaining the consequences of each operation before suggesting commands.

Try Cluegent for your practice session, then repeat the explanation without suggestions. Judge your answer by its accuracy, evidence, and response to follow-up questions.

Sources checked

These official references support the guide. Product details and technical documentation can change; check the linked source for current information.

Where Cluegent helps

Cluegent supports permitted live workflows with transcript context, typed prompts, screenshot-aware answers, resume context, custom response behavior, quick action buttons, and a private desktop overlay. It is most useful when you already understand the subject and need help staying structured under pressure.

Frequently asked questions

How should I practise this topic?

Draw a shared main branch with commits A, B, and C. B introduces a bug; C adds a useful feature that depends on part of B. Describe a recovery that keeps C working, and explain what you would verify before publishing it.

How can Cluegent help with preparation?

Ask Cluegent to challenge your recovery plan with a dependent commit or an uncommitted file. Practise explaining the consequences of each operation before suggesting commands.