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 1551–1575 of 3281

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How do you debug a detached HEAD issue?

Short answer: A detached HEAD means Git’s HEAD points to a specific commit instead of a branch — commits made now won’t belong to any branch. To fix it: Check what commit you’re on: git status Real-world example (ShopNes…

Version Control Read answer
Mid PDF
Merge or push this branch back to restore the lost history.?

Short answer: Example: If your teammate accidentally ran git push origin main --force, you can still restore your lost commits using your local reflog if you had pulled the branch before the overwrite. Real-world example…

Version Control Read answer
Mid PDF
Optionally, trigger CI/CD checks automatically via GitHub Actions.?

Short answer: Example: Before approving a PR for a new payment API, I check: Code readability and naming consistency Proper test coverage Security considerations (e.g., no API keys in code) Bonus: I sometimes use Suggest…

Version Control Read answer
Mid PDF
How do you resolve conflicts in a pull request?

Short answer: When GitHub reports conflicts in a PR: Fetch and switch to your branch locally: git fetch origin git checkout feature/new-ui Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi…

Version Control Read answer
Mid PDF
Add comments or suggestions.?

Short answer: Add comments or suggestions.? 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…

Version Control Read answer
Mid PDF
Creates a merge commit if necessary (to record the combination).?

Short answer: Example: If you merge feature/login into main, Git finds the last point they shared code, applies your login branch changes, and creates a new commit that connects both histories. Intermediate / Advanced Gi…

Version Control Read answer
Mid PDF
Real-world example:?

Short answer: If two developers change the same line in index.html (e.g., one changes the header text, another changes the same header), Git won’t know which to keep — you decide manually. Say this in the interview Defin…

Version Control Read answer
Mid PDF
What are the pros and cons of rebasing vs merging?

Short answer: Aspect Merging Rebasing History Keeps all commits, including merge commits Creates a linear, cleaner history Safety Safe for shared/public branches Risky for shared branches (rewrites history) Use Case When…

Version Control Read answer
Mid PDF
Git commit?

Short answer: A snapshot of your project at a specific point in time, including changes and a message. Real-world example (ShopNest) Prefer clear commits: fix(cart): prevent negative quantities instead of update . Say th…

Version Control Read answer
Mid PDF
How do you ensure secure handling of access tokens in GitHub

Short answer: ctions? Security in CI/CD pipelines is crucial — you never want secrets hard-coded in code or workflows. Best practices: Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI che…

Version Control Read answer
Mid PDF
How do you ensure secure handling of access tokens in GitHub Actions?

Short answer: Security in CI/CD pipelines is crucial — you never want secrets hard-coded in code or workflows. Best practices: Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so b…

Version Control Read answer
Mid PDF
How would you handle diverged branches with conflicting changes?

Short answer: When branches diverge, Git can’t automatically merge them — it needs your help. Steps: Pull the latest changes and rebase or merge: git fetch origin git merge origin/main or git rebase origin/main Real-worl…

Version Control Read answer
Mid PDF
Force-push cleaned history:?

Short answer: git push origin --force 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 Define — one cle…

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

Git & GitHub Developer Essentials · Version Control

Short answer: A detached HEAD means Git’s HEAD points to a specific commit instead of a branch — commits made now won’t belong to any branch. To fix it: Check what commit you’re on: git status

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: Example: If your teammate accidentally ran git push origin main --force, you can still restore your lost commits using your local reflog if you had pulled the branch before the overwrite.

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: Before approving a PR for a new payment API, I check: Code readability and naming consistency Proper test coverage Security considerations (e.g., no API keys in code) Bonus: I sometimes use Suggested Changes in GitHub comments to make small fixes easier for contributors.

Example code

Before approving a PR for a new payment API, I check: Code readability and naming consistency Proper test coverage Security considerations (e.g., no API keys in code) Bonus: I sometimes use Suggested Changes in GitHub comments to make small fixes easier for contributors.

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 GitHub reports conflicts in a PR: Fetch and switch to your branch locally: git fetch origin git checkout feature/new-ui

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: Add comments or suggestions.? 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: Example: If you merge feature/login into main, Git finds the last point they shared code, applies your login branch changes, and creates a new commit that connects both histories. Intermediate / Advanced Git Concepts

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: If two developers change the same line in index.html (e.g., one changes the header text, another changes the same header), Git won’t know which to keep — you decide manually.

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 Merging Rebasing History Keeps all commits, including merge commits Creates a linear, cleaner history Safety Safe for shared/public branches Risky for shared branches (rewrites history) Use Case When collaboration is ongoing When you want a clean, linear history before merging Real-world example: Before merging a feature into main, many teams rebase it to make the commit history cleaner.

Explain a bit more

But during teamwork, merging is safer because it doesn’t rewrite other people’s 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: A snapshot of your project at a specific point in time, including changes and a message.

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: ctions? Security in CI/CD pipelines is crucial — you never want secrets hard-coded in code or workflows. Best practices:

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: Security in CI/CD pipelines is crucial — you never want secrets hard-coded in code or workflows. Best practices:

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: When branches diverge, Git can’t automatically merge them — it needs your help. Steps: Pull the latest changes and rebase or merge: git fetch origin git merge origin/main or git rebase origin/main

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 push origin --force

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