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 126–150 of 288

Career & HR topics

By tech stack

Mid PDF
How do you perform a code review using GitHub tools?

Short answer: How do you perform a code review using GitHub tools? is a common interview topic in Git & GitHub. Give a clear definition, then one concrete example. Real-world example (ShopNest) ShopNest’s team uses G…

Version Control Read answer
Mid PDF
Choose to Approve, Request changes, or Comment.?

Short answer: Real-world example: If you’re a team lead, you review a PR for a new feature, check coding standards, ensure tests pass, and approve it before merging into main. Say this in the interview Define — one clear…

Version Control Read answer
Mid PDF
How do you review and approve a Pull Request?

Short answer: How do you review and approve a Pull Request? is a common interview topic in Git & GitHub. Give a clear definition, then one concrete example. Real-world example (ShopNest) ShopNest’s team uses GitHub P…

Version Control Read answer
Mid PDF
Initialize a repo?

Short answer: git init - creates a new Git repository in the current directory. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.…

Version Control Read answer
Mid PDF
What are hooks in Git?

Short answer: Can you give examples? Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Common examples: pre-commit: Run linting or uni…

Version Control Read answer
Mid PDF
How do you move commits from one branch to another?

Short answer: If you accidentally committed to the wrong branch, you can move those commits cleanly. Steps: Switch to the correct branch: git checkout correct-branch Real-world example (ShopNest) Feature work for “UPI pa…

Version Control Read answer
Mid PDF
What are hooks in Git? Can you give examples?

Short answer: Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). Explain a bit more They live inside .git/hooks/. Git hooks are scripts that run automatically when s…

Version Control Read answer
Mid PDF
What are GitHub Actions and how do they help in CI/CD?

Short answer: GitHub Actions is GitHub’s built-in Continuous Integration/Continuous Deployment (CI/CD) platform. Explain a bit more It lets you automate tasks — like running tests, building code, or deploying apps — ever…

Version Control Read answer
Mid PDF
How do you apply stashed changes?

Short answer: To bring back your stashed work: git stash apply # reapplies the most recent stash git stash pop # reapplies AND deletes the stash git stash list # shows all stashes git stash show -p # shows what changes a…

Version Control Read answer
Mid PDF
How do you resolve merge conflicts in Git?

Short answer: Merge conflicts occur when two branches modify the same part of a file differently. To resolve: Run the merge command: git merge feature/contact-form Real-world example (ShopNest) Feature work for “UPI paym…

Version Control Read answer
Mid PDF
How do you create a new Git repository?

Short answer: To create a new Git repository, navigate to your project directory and use the command: git init This initializes an empty Git repository in that directory. Explain a bit more Now you can start tracking cha…

Version Control Read answer
Mid PDF
How do you clean up old branches automatically?

Short answer: Old branches can clutter your repo. You can clean them locally and remotely. Commands: To delete merged branches locally: git branch --merged main | grep -v "main" | xargs git branch -d To prune d…

Version Control Read answer
Mid PDF
Warn your team and tell them to re-clone the repo (to avoid old secrets locally).?

Short answer: Example: You pushed .env with a production API key. Even after deletion, it’s still in the Git history — so you must clean and rotate keys right away. Real-world example (ShopNest) ShopNest’s team uses GitH…

Version Control Read answer
Mid PDF
How would you roll back a production release using Git?

Short answer: There are several safe rollback methods: Option 1 — Revert to a previous tag (recommended): git revert <commit-hash> git push origin main This creates a new commit that undoes the bad release. Option…

Version Control Read answer
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
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
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

Git & GitHub Developer Essentials · Version Control

Short answer: How do you perform a code review using GitHub tools? is a common interview topic in Git & GitHub. Give a clear definition, then one concrete example.

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: Real-world example: If you’re a team lead, you review a PR for a new feature, check coding standards, ensure tests pass, and approve it before merging into main.

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: How do you review and approve a Pull Request? is a common interview topic in Git & GitHub. Give a clear definition, then one concrete example.

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 init - creates a new Git repository in the current directory.

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: Can you give examples? Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Common examples: pre-commit: Run linting or unit tests before a commit # .git/hooks/pre-commit npm run lint || exit 1 pre-push: Prevent pushes to main if [ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]; then echo "You can't push directly to main!" exit 1 fi…

Explain a bit more

Example: In a team, we set a pre-commit hook to check code formatting with ESLint before any commit — ensuring consistency across all contributors.

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: If you accidentally committed to the wrong branch, you can move those commits cleanly. Steps: Switch to the correct branch: git checkout correct-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: Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing).

Explain a bit more

They live inside .git/hooks/. Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Common examples: pre-commit: Run linting or unit tests before a commit # .git/hooks/pre-commit npm run lint || exit 1 pre-push: Prevent pushes to main if [ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]; then echo "You can't push directly to main!" exit 1 fi In a team, we set a pre-commit hook to check code formatting with ESLint before any commit — ensuring consistency across all contributors. Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside… Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Git hooks are scripts that run automatically when specific Git events…

Example code

In a team, we set a pre-commit hook to check code formatting with ESLint before any commit — ensuring consistency across all contributors. Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Common examples: pre-commit: Run linting or unit tests before a commit # .git/hooks/pre-commit npm run lint || exit 1 pre-push: Prevent pushes to main if [ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]; then echo "You can't push directly to main!" exit 1 fi Example: In a team, we set a pre-commit hook to check code formatting with ESLint before any commit — ensuring consistency across all contributors.

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: GitHub Actions is GitHub’s built-in Continuous Integration/Continuous Deployment (CI/CD) platform.

Explain a bit more

It lets you automate tasks — like running tests, building code, or deploying apps — every time code is pushed or a PR is opened. Example: You can create a workflow file .github/workflows/test.yml: name: Run Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: uses: actions/checkout@v4 name: Install dependencies run: npm install name: Run tests run: npm test Whenever code is pushed, GitHub automatically runs your tests — ensuring quality before merging.

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: To bring back your stashed work: git stash apply # reapplies the most recent stash git stash pop # reapplies AND deletes the stash git stash list # shows all stashes git stash show -p # shows what changes are in a stash Real-world example: After resolving the production issue, you return to your feature branch and restore your previous changes with git stash pop.

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: Merge conflicts occur when two branches modify the same part of a file differently. To resolve: Run the merge command: git merge feature/contact-form

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 create a new Git repository, navigate to your project directory and use the command: git init This initializes an empty Git repository in that directory.

Explain a bit more

Now you can start tracking changes in your project. Real-World Example: Imagine you're starting a new website project on your computer. You open your terminal, go to your project folder, and type git init. This sets up the Git repository, and you can start tracking your changes immediately.

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: Old branches can clutter your repo. You can clean them locally and remotely. Commands: To delete merged branches locally: git branch --merged main | grep -v "main" | xargs git branch -d To prune deleted remote branches: git fetch --prune Example: After several months, your repo has 50 old feature branches. You can prune them automatically in CI or periodically with these commands.

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: Example: You pushed .env with a production API key. Even after deletion, it’s still in the Git history — so you must clean and rotate keys right away.

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: There are several safe rollback methods: Option 1 — Revert to a previous tag (recommended): git revert <commit-hash> git push origin main This creates a new commit that undoes the bad release. Option 2 — Deploy a stable tag: git checkout v1.2.3 git push origin main --force

Example code

If version v2.0 introduced a bug in the payment flow, I revert to v1.9.1 (the last stable tag) and redeploy while investigating the issue. In CI/CD pipelines: We often have a ROLLBACK_TAG variable that can deploy a known safe version automatically.

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