Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: When two branches modify the same part of a file, Git can’t automatically decide which version to keep — this creates a conflict. Git will: Real-world example (ShopNest) Feature work for “UPI payment” lives…
Short answer: git cherry-pick lets you apply a specific commit from one branch to another, without merging the entire branch. Explain a bit more Example: Imagine you fixed a typo in the develop branch but need that same…
Short answer: Key practices I Branch-per-feature model – Each developer works on isolated branches. Explain a bit more Pull Requests (PRs) for merging into main. Code reviews + CI tests required before merging. Protected…
Short answer: A protected branch (like main) restricts direct commits or merges unless specific rules are met. You can configure: Require pull request reviews Require status checks (tests) to pass Restrict who can push P…
Short answer: git cherry-pick lets you apply a specific commit from one branch to another, without merging the entire branch. Explain a bit more Example: Imagine you fixed a typo in the develop branch but need that same…
Short answer: git merge <branch-name> - combines changes from one branch into another. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resolve conflic…
Short answer: (e.g., git rebase -i) You can interactively rebase to edit, squash, or reorder commits using: git rebase -i HEAD~3 This opens an editor showing the last 3 commits: pick 1a2b3c Fix typo in footer pick 4d5e6f…
Short answer: I treat Git as the single source of truth for builds and deployments. Explain a bit more My approach: Each merge to main triggers CI/CD pipelines (GitHub Actions, Jenkins, or GitLab CI). Pipelines: Run test…
Short answer: I believe in a clean, meaningful Git history that tells the story of the project clearly. Explain a bit more Here’s how I maintain it: Use atomic commits (each commit = one logical change) Write clear commi…
Short answer: Squashing combines multiple small commits into one clean commit before merging — keeping history tidy. Explain a bit more Options: On GitHub: When merging a PR, select “Squash and merge.” On local machine:…
Short answer: You can interactively rebase to edit, squash, or reorder commits using: git rebase -i HEAD~3 This opens an editor showing the last 3 commits: pick 1a2b3c Fix typo in footer pick 4d5e6f Add login API pick 7g…
Short answer: When you run a merge, Git: Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resolve conflicts before merge. Say this in the interview Define —…
Short answer: You can view the commit history by using the command: git log This shows a list of commits, with each commit’s hash, author, date, and message. Real-World Example: Imagine you're trying to figure out when a…
Short answer: Manually editing files to combine conflicting changes, then staging and committing them. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resol…
Short answer: base commit, creating a linear history. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resolve conflicts before merge. Say this in the interv…
Short answer: Rewrites commit history by moving a sequence of commits to a new base commit, creating a linear history. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR…
Short answer: local repository, but doesn't merge them. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed. Say this in the intervie…
Short answer: Downloads commits, files, and refs from a remote repository into your local repository, but doesn't merge them. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so br…
Short answer: git remote add <name> <url> - links a local repository to a remote one (e.g., GitHub). Say this in the interview Define — one clear sentence (the short answer above). Example — relate it to a pr…
Short answer: git clone <url> - creates a local copy of a remote repository. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnotice…
Short answer: intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. i…
Short answer: A file (.gitignore) that tells Git which files or directories to intentionally ignore from being tracked. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken b…
Short answer: git status (summary), git diff (detailed changes). Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed. Say this in the…
Short answer: git reset HEAD <file> (unstage). Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed. Say this in the interview D…
Short answer: git restore <file> (unstage/discard working dir changes), git reset HEAD <file> (unstage). Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken buil…
Git & GitHub Developer Essentials · Version Control
Short answer: When two branches modify the same part of a file, Git can’t automatically decide which version to keep — this creates a conflict. Git will:
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: git cherry-pick lets you apply a specific commit from one branch to another, without merging the entire branch.
Example: Imagine you fixed a typo in the develop branch but need that same fix in main immediately. Instead of merging all of develop, you can just cherry-pick that commit: git cherry-pick 1a2b3c4 Real-world use case: Useful when you want to apply a hotfix or small bug fix without merging unrelated feature work.
Git & GitHub Developer Essentials · Version Control
Short answer: Key practices I Branch-per-feature model – Each developer works on isolated branches.
Pull Requests (PRs) for merging into main. Code reviews + CI tests required before merging. Protected branches prevent direct commits. Communication – Sync via Slack, GitHub Discussions, or standups to avoid conflicts. Example: At a fintech startup, 8 engineers worked on a single monorepo. We used short-lived branches and daily merges, with GitHub Actions running automatic tests for every PR — this reduced integration headaches.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: A protected branch (like main) restricts direct commits or merges unless specific rules are met. You can configure: Require pull request reviews Require status checks (tests) to pass Restrict who can push Prevent force pushes or deletions Example: You protect the main branch to ensure developers can only merge code through PRs that have passed CI checks and received approval — preventing accidental overwrites.
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: git cherry-pick lets you apply a specific commit from one branch to another, without merging the entire branch.
Example: Imagine you fixed a typo in the develop branch but need that same fix in main immediately. Instead of merging all of develop, you can just cherry-pick that commit: git cherry-pick 1a2b3c4 Real-world use case: Useful when you want to apply a hotfix or small bug fix without merging unrelated feature work.
Git & GitHub Developer Essentials · Version Control
Short answer: git merge <branch-name> - combines changes from one branch into another.
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: (e.g., git rebase -i) You can interactively rebase to edit, squash, or reorder commits using: git rebase -i HEAD~3 This opens an editor showing the last 3 commits: pick 1a2b3c Fix typo in footer pick 4d5e6f Add login API pick 7g8h9i Update UI color scheme You can change: pick → edit to modify a commit pick → squash to combine commits pick → reword to change the message Real-world example: Before merging your feature…
branch, you may use git rebase -i to combine small “fix typo” or “debug print” commits into a clean, single commit. ⚠ Don’t rewrite history on shared branches that others are using — it can cause conflicts and confusion. GitHub & Remote Repository Management
Git & GitHub Developer Essentials · Version Control
Short answer: I treat Git as the single source of truth for builds and deployments.
My approach: Each merge to main triggers CI/CD pipelines (GitHub Actions, Jenkins, or GitLab CI). Pipelines: Run tests, lint, and security scans. Tag builds automatically (e.g., v1.2.3). Deploy to staging/production environments. Best practices: Use semantic versioning in tags (v1.0.0). Store environment configs securely (never in Git). Require PR reviews and passing checks before merge. Deploy directly from tagged commits, not branches. Example: In a microservices project, each push to main triggered automated Docker builds. Tagging a commit with v2.3.1 automatically deployed that version to production — ensuring traceability and rollback capability. ✅ In summary: The key to mastering Git isn’t just knowing commands — it’s knowing how to recover, clean, and automate safely. Bonus / DevOps Integration
Git & GitHub Developer Essentials · Version Control
Short answer: I believe in a clean, meaningful Git history that tells the story of the project clearly.
Here’s how I maintain it: Use atomic commits (each commit = one logical change) Write clear commit messages: feat: add user profile API fix: correct typo in dashboard title chore: update dependencies ● Use rebase before merge to remove noisy commits (fix typo, debug print) Squash commits in PRs before merging Avoid committing generated or temporary files (use .gitignore) Tag meaningful releases (v1.0.0, v1.1.0-beta)
When reviewing history later, I can quickly find “where” and “why” a change was made — no messy “temp commit” or “final fix” messages. ✅ In short: A healthy Git workflow = clear branches, clean commits, automated checks, and collaborative reviews. Real-World & Troubleshooting Scenarios
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: Squashing combines multiple small commits into one clean commit before merging — keeping history tidy.
Options: On GitHub: When merging a PR, select “Squash and merge.” On local machine: git rebase -i HEAD~3 Change extra commits from pick → squash and then push with: git push -f Real-world example: If your PR has 10 commits like “fix typo,” “oops forgot semicolon,” and “final fix,” you squash them into one commit: 👉 Add responsive navbar component ✅ Pro Tip: A clean workflow often looks like this:
Git & GitHub Developer Essentials · Version Control
Short answer: You can interactively rebase to edit, squash, or reorder commits using: git rebase -i HEAD~3 This opens an editor showing the last 3 commits: pick 1a2b3c Fix typo in footer pick 4d5e6f Add login API pick 7g8h9i Update UI color scheme You can change: pick → edit to modify a commit pick → squash to combine commits pick → reword to change the… message……… Real-world example: Before merging your feature branch, you may…
use git rebase -i to combine small “fix typo” or “debug print” commits into a clean, single commit. ⚠ Don’t rewrite history on shared branches that others are using — it can cause conflicts and confusion. GitHub & Remote Repository Management
Git & GitHub Developer Essentials · Version Control
Short answer: When you run a merge, Git:
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: You can view the commit history by using the command: git log This shows a list of commits, with each commit’s hash, author, date, and message. Real-World Example: Imagine you're trying to figure out when a bug was introduced to your code. By running git log, you can see all previous commits, helping you pinpoint the changes that might have caused the issue. Branching & Merging
Git & GitHub Developer Essentials · Version Control
Short answer: Manually editing files to combine conflicting changes, then staging and committing them.
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: base commit, creating a linear history.
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: Rewrites commit history by moving a sequence of commits to a new base commit, creating a linear history.
Feature work for “UPI payment” lives on feature/upi-payment. Open a PR to main; resolve conflicts before merge.
Git & GitHub Developer Essentials · Version Control
Short answer: local repository, but doesn't merge them.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: Downloads commits, files, and refs from a remote repository into your local repository, but doesn't merge them.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: git remote add <name> <url> - links a local repository to a remote one (e.g., GitHub).
Git & GitHub Developer Essentials · Version Control
Short answer: git clone <url> - creates a local copy of a remote repository.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked.
intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked. intentionally ignore from being tracked.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: A file (.gitignore) that tells Git which files or directories to intentionally ignore from being tracked.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: git status (summary), git diff (detailed changes).
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: git reset HEAD <file> (unstage).
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Git & GitHub Developer Essentials · Version Control
Short answer: git restore <file> (unstage/discard working dir changes), git reset HEAD <file> (unstage).
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Install Toolliyo like an app Free
Home-screen access to tutorials, coding practice & career tools — no app store needed.
On iPhone/iPad: tap Share then Add to Home Screen.