Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 2126–2150 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How can you enforce code review policies on GitHub?

Short answer: You can enforce reviews and branch protection rules in repository settings under Settings → Branches → Branch protection rules. You can require: Pull requests before merging At least one approval Passing CI…

Version Control Read answer
Mid PDF
How can you view the difference between two commits?

Short answer: Use git diff with two commit hashes: git diff <commit1> <commit2> This shows line-by-line changes between the two commits. Example: If you want to compare how your project changed between versio…

Version Control Read answer
Mid PDF
How do you delete a branch locally and remotely?

Short answer: Locally: git branch -d feature/old-branch (-D for force delete if it’s not merged) Remotely: git push origin --delete feature/old-branch Real-world example: After merging your feature branch into main, you…

Version Control Read answer
Mid PDF
How do you clone an existing repository?

Short answer: To clone an existing repository, you use the git clone command followed by the URL of the remote repository: git clone This command creates a copy of the repository on your local machine, including all its…

Version Control Read answer
Junior PDF
What is a branch?

Short answer: A lightweight, movable pointer to a commit, allowing for parallel development. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resolve conflic…

Version Control Read answer
Mid PDF
Explain the difference between git add and git commit.

Short answer: git add: This command stages changes, telling Git which modifications you want to include in the next commit. Explain a bit more It doesn't save the changes to the repository yet, just prepares them. git co…

Version Control Read answer
Mid PDF
Switch branch?

Short answer: <branch-name> - moves your HEAD pointer to another branch. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to main ; resolve conflicts before merg…

Version Control Read answer
Mid PDF
How do you reduce repository size in GitHub?

Short answer: To slim down a bloated repository: Remove large unnecessary files: git filter-repo --path path/to/largefile --invert-paths Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI c…

Version Control Read answer
Mid PDF
How do you handle versioning and tagging in CI/CD pipelines?

Short answer: In CI/CD, I automate version tagging to keep releases consistent and traceable. Example pipeline step (GitHub Actions): name: Tag release run: | VERSION=$(node -p "require('./package.json').version&quo…

Version Control Read answer
Junior PDF
What is GitHub Flow vs Git Flow?

Short answer: Aspect GitHub Flow Git Flow Purpose Simple branching model for continuous delivery Structured model for release management Branche Only main and short-lived feature branches Multiple: main, develop, feature…

Version Control Read answer
Junior PDF
What is a “detached HEAD” and how can you recover from it?

Short answer: A detached HEAD happens when Git’s HEAD (your current position) points to a specific commit instead of a branch. Explain a bit more If you make new commits in this state, they won’t belong to any branch — y…

Version Control Read answer
Junior PDF
What is a detached HEAD state in Git?

Short answer: A detached HEAD occurs when Git’s HEAD (which points to your current branch) points to a specific commit instead of a branch. Explain a bit more This means you’re not working on any branch — any new commits…

Version Control Read answer
Mid PDF
Switch branch?

Short answer: git checkout <branch-name> or git switch <branch-name> - moves your HEAD pointer to another branch. Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Op…

Version Control Read answer
Mid PDF
Explain how you’d migrate from SVN or Mercurial to Git.

Short answer: Migrating involves preserving history, branches, and tags. Steps (SVN example): Install Git SVN: git svn clone -trunk=trunk -branches=branches --tags=tags Real-world example (ShopNest) ShopNest’s team uses…

Version Control Read answer
Mid PDF
How do you handle protected branches?

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…

Version Control Read answer
Mid PDF
Explain how Git handles conflicts during merges or rebases.

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…

Version Control Read answer
Mid PDF
When would you use git cherry-pick?

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…

Version Control Read answer
Mid PDF
How do you manage multiple contributors working on the same codebase?

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…

Version Control Read answer
Mid PDF
How do you handle protected branches? Follow:

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…

Version Control Read answer
Mid PDF
When would you use git cherry-pick? Follow:

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…

Version Control Read answer
Junior PDF
What is .gitignore and how is it used?

Short answer: The .gitignore file tells Git which files or directories it should ignore when tracking changes. Explain a bit more This is useful for files that aren’t necessary in the repository, like log files, compiled…

Version Control Read answer
Mid PDF
Merge branches?

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…

Version Control Read answer
Mid PDF
How do you rewrite commit history?

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…

Version Control Read answer
Mid PDF
How do you ensure code versioning integrates well with CI/CD and deployment processes?

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…

Version Control Read answer
Mid PDF
What’s your approach to keeping a Git history clean and readable?

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…

Version Control Read answer

Git & GitHub Developer Essentials · Version Control

Short answer: You can enforce reviews and branch protection rules in repository settings under Settings → Branches → Branch protection rules. You can require: Pull requests before merging At least one approval Passing CI checks (e.g., GitHub Actions) No direct pushes to main Example: Your team sets a rule that all PRs must be reviewed by at least one other developer and must pass automated tests before merging.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: Use git diff with two commit hashes: git diff <commit1> <commit2> This shows line-by-line changes between the two commits. Example: If you want to compare how your project changed between version 1.0 and version 1.1: git diff v1.0 v1.1 You’ll see added, removed, and modified lines across files.

Real-world example (ShopNest)

Prefer clear commits: fix(cart): prevent negative quantities instead of update.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: Locally: git branch -d feature/old-branch (-D for force delete if it’s not merged) Remotely: git push origin --delete feature/old-branch Real-world example: After merging your feature branch into main, you can safely delete it to keep your repository clean.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: To clone an existing repository, you use the git clone command followed by the URL of the remote repository: git clone This command creates a copy of the repository on your local machine, including all its files and history.

Explain a bit more

Real-World Example: If you're joining an open-source project on GitHub, you can clone the repository to your machine by running the git clone command. This gives you access to the full codebase to start contributing.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: A lightweight, movable pointer to a commit, allowing for parallel development.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: git add: This command stages changes, telling Git which modifications you want to include in the next commit.

Explain a bit more

It doesn't save the changes to the repository yet, just prepares them. git commit: This actually saves the changes to the repository, creating a new entry in your project’s history. Real-World Example: You’ve edited a few files in your project. First, you use git add . to stage all changes, and then you use git commit -m "Fixed bug in homepage" to save those changes to the repository.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: <branch-name> - moves your HEAD pointer to another branch.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: To slim down a bloated repository: Remove large unnecessary files: git filter-repo --path path/to/largefile --invert-paths

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: In CI/CD, I automate version tagging to keep releases consistent and traceable. Example pipeline step (GitHub Actions): name: Tag release run: | VERSION=$(node -p "require('./package.json').version") git tag -a "v$VERSION" -m "Release version $VERSION" git push origin "v$VERSION" Versioning style: I use Semantic Versioning (SemVer) → MAJOR.MINOR.PATCH

Example code

v2.1.4 Major = breaking changes Minor = new features Patch = bug fixes This helps CI/CD pipelines automatically trigger deployments for new versions.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: Aspect GitHub Flow Git Flow Purpose Simple branching model for continuous delivery Structured model for release management Branche Only main and short-lived feature branches Multiple: main, develop, feature, release, hotfix Workflow Create branch → Commit → Pull Request → Merge → Deploy Feature branches merge into develop, then release/hotfix merges into main Use Case SaaS projects, frequent deploys Complex products…

Example code

GitHub Flow → Used by startups deploying updates daily. Git Flow → Used by large software teams (e.g., enterprise apps) with versioned releases.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: A detached HEAD happens when Git’s HEAD (your current position) points to a specific commit instead of a branch.

Explain a bit more

If you make new commits in this state, they won’t belong to any branch — you could lose them if you switch branches. How to fix it: If you accidentally commit in a detached HEAD state: git switch -c temp-branch This creates a new branch from your current state so your commits aren’t lost. Example: You checked out an old commit to test something: git checkout a1b2c3d If you make changes, create a branch to save them before switching back.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: A detached HEAD occurs when Git’s HEAD (which points to your current branch) points to a specific commit instead of a branch.

Explain a bit more

This means you’re not working on any branch — any new commits made in this state are “orphaned” unless you create a branch from them. Example: If you check out an old commit directly: git checkout a1b2c3d You’re in a detached HEAD state. If you make changes here and don’t create a new branch, you could lose them later. Fix: Create a new branch to save your work: git checkout -b hotfix/rollback-test

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: git checkout <branch-name> or git switch <branch-name> - moves your HEAD pointer to another branch.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: Migrating involves preserving history, branches, and tags. Steps (SVN example): Install Git SVN: git svn clone -trunk=trunk -branches=branches --tags=tags

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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:

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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.

Explain a bit more

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.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

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 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.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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.

Explain a bit more

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.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

Short answer: The .gitignore file tells Git which files or directories it should ignore when tracking changes.

Explain a bit more

This is useful for files that aren’t necessary in the repository, like log files, compiled binaries, or local configuration files. Real-World Example: If you're working on a Node.js project, you likely don’t want to track the node_modules/ directory, since it can be recreated by running npm install. You can add node_modules/ to your .gitignore file to ensure that Git doesn't track those files.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

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 conflicts before merge.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

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…

Explain a bit more

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

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

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 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

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Git & GitHub Developer Essentials · Version Control

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 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)

Example code

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

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details