Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: A Git tag marks specific points in a repository’s history — usually to label release versions (like v1.0, v2.1, etc.). Explain a bit more It’s like a snapshot that says, “this commit is stable and ready to…
Short answer: A branch in Git is like a separate line of development — a parallel universe for your code. It allows you to work on new features, bug fixes, or experiments without affecting the main codebase (usually call…
Short answer: Git is a distributed version control system (VCS) that allows multiple developers to work on a project without overwriting each other's work. Explain a bit more It's designed to be fast, flexible, and scala…
Short answer: A distributed version control system (DVCS) for tracking changes in source code during software development. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broke…
Short answer: Subclasses, like PastaRecipe, implement the GatherIngredients, Prepare, and CookMethod methods. These methods contain the specific details of the recipe, such as the ingredients, preparation steps, and cook…
Short answer: s a Build() method to return the fully constructed pizza. public interface IPizzaBuilder { void SetDough(string dough); void SetSauce(string sauce); void AddTopping(string topping); Pizza Build(); } s a Bui…
Short answer: Comman Description Safe for shared repos? git revert Creates a new commit that undoes changes from a previous commit ✅ Yes git reset Moves the branch pointer back to a previous commit, potentially removing…
Short answer: A Pull Request is a request to merge your changes from one branch or fork into another repository or branch — typically to propose new code, bug fixes, or improvements. Example: You fixed a typo or added a…
Short answer: A commit in Git is a snapshot of your project at a specific point in time. Explain a bit more It records all the changes you've made to the files and saves them to the repository. Every commit has a unique…
Short answer: git stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a pr…
Short answer: git stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a pr…
Short answer: git fetch: It retrieves changes from a remote repository but does not apply them to your working directory. Explain a bit more You can think of it as checking for updates without actually installing them. g…
Short answer: 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 Define — one clear sentence (t…
Short answer: (Duplicate of #4) 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…
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…
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…
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…
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…
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…
Short answer: to build, test, and deploy code directly from GitHub. 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…
Short answer: The default name for the remote repository from which a project was originally cloned. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach p…
Short answer: A pointer to the current commit you are on in your local 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: A configuration file that stores user-specific Git settings (e.g., username, email, aliases). Say this in the interview Define — one clear sentence (the short answer above). Example — relate it to a project…
Short answer: Shows changes between the staging area and the last commit. Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed. Say th…
Short answer: Displays the commit history of the current branch. 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…
Git & GitHub Developer Essentials · Version Control
Short answer: A Git tag marks specific points in a repository’s history — usually to label release versions (like v1.0, v2.1, etc.).
It’s like a snapshot that says, “this commit is stable and ready to release.” Types of tags: Lightweight tag: just a name for a commit. Annotated tag: includes metadata like the tagger’s name, date, and message. Commands: git tag -a v1.0 -m "Version 1.0 release" git push origin v1.0 Real-world example: After testing your project, you tag the commit representing your first release with v1.0. This helps other developers or CI/CD pipelines identify which version is live.
Git & GitHub Developer Essentials · Version Control
Short answer: A branch in Git is like a separate line of development — a parallel universe for your code. It allows you to work on new features, bug fixes, or experiments without affecting the main codebase (usually called the main or master branch). Why branches are useful: They make collaboration easier by keeping each developer’s work isolated until it’s ready to be merged back. Real-world
Imagine your company website is live, but you need to add a “dark mode” feature. Instead of editing the main code directly (which might break the live site), you create a new branch called feature/dark-mode to work independently. Once it’s done and tested, you merge it back into main.
Git & GitHub Developer Essentials · Version Control
Short answer: Git is a distributed version control system (VCS) that allows multiple developers to work on a project without overwriting each other's work.
It's designed to be fast, flexible, and scalable, allowing developers to track changes in code and collaborate with ease. In contrast, SVN (Subversion) is a centralized version control system. This means that SVN has one central repository, and developers check out code to work locally. Git, on the other hand, allows every developer to have their own full local repository, including the project’s history. This makes Git faster and more reliable, especially in distributed teams. Real-World Example: If you were working on a website project with a team, using Git allows each developer to clone the repository, make changes locally, and push their changes without disrupting others. In SVN, the code is pulled from the central server, and only one developer can commit changes at a time.
Git & GitHub Developer Essentials · Version Control
Short answer: A distributed version control system (DVCS) for tracking changes in source code during software development.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: Subclasses, like PastaRecipe, implement the GatherIngredients, Prepare, and CookMethod methods. These methods contain the specific details of the recipe, such as the ingredients, preparation steps, and cooking process.
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: s a Build() method to return the fully constructed pizza. public interface IPizzaBuilder { void SetDough(string dough); void SetSauce(string sauce); void AddTopping(string topping); Pizza Build(); } s a Build() method to return the fully constructed pizza.
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.
Git & GitHub Developer Essentials · Version Control
Short answer: Comman Description Safe for shared repos? git revert Creates a new commit that undoes changes from a previous commit ✅ Yes git reset Moves the branch pointer back to a previous commit, potentially removing commits ❌ No (rewrites history)
If you realize a commit caused an error: git revert will make a new commit that undoes it. git reset will erase it as if it never happened (good for local cleanup).
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 Pull Request is a request to merge your changes from one branch or fork into another repository or branch — typically to propose new code, bug fixes, or improvements. Example: You fixed a typo or added a feature in your fork of a project. You create a PR asking the original maintainers to “pull” your changes into their main branch. PRs enable: Code review Automated testing Discussion before merging
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 commit in Git is a snapshot of your project at a specific point in time.
It records all the changes you've made to the files and saves them to the repository. Every commit has a unique ID, and it's like a save point in a video game—if something breaks, you can go back to any commit. Real-World Example: Let’s say you fixed a bug on the homepage of your app. After completing the fix, you commit the changes to the repository. Later, if the fix causes an issue, you can roll back to the previous commit.
Git & GitHub Developer Essentials · Version Control
Short answer: git stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a production issue. Instead of committing half-done code, you run: git stash git checkout main Later, you can come back and reapply your stashed work.
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 stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a production issue. Instead of committing half-done code, you run: git stash git checkout main Later, you can come back and reapply your stashed work.
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 fetch: It retrieves changes from a remote repository but does not apply them to your working directory.
You can think of it as checking for updates without actually installing them. git pull: This does two things: it fetches the latest changes and then merges them into your current branch. It's like fetching updates and immediately applying them. Real-World Example: If you're working on a project with teammates, git fetch allows you to see what changes have been made without affecting your code. git pull, on the other hand, will update your local copy and merge those changes with your work, which can sometimes result in merge conflicts.
Git & GitHub Developer Essentials · Version Control
Short answer: time, including changes and a message.
Prefer clear commits: fix(cart): prevent negative quantities instead of update.
Git & GitHub Developer Essentials · Version Control
Short answer: (Duplicate of #4) A snapshot of your project at a specific point in time, including changes and a message.
Prefer clear commits: fix(cart): prevent negative quantities instead of update.
Git & GitHub Developer Essentials · Version Control
Short answer: A lightweight, movable pointer to a commit, allowing for parallel development.
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: 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…
GitHub Flow → Used by startups deploying updates daily. Git Flow → Used by large software teams (e.g., enterprise apps) with versioned releases.
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.
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.
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 detached HEAD occurs when Git’s HEAD (which points to your current branch) points to a specific commit instead of a branch.
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
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: The .gitignore file tells Git which files or directories it should ignore when tracking changes.
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.
Git & GitHub Developer Essentials · Version Control
Short answer: to build, test, and deploy code directly from GitHub.
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: The default name for the remote repository from which a project was originally cloned.
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 pointer to the current commit you are on in your local 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: A configuration file that stores user-specific Git settings (e.g., username, email, aliases).
Git & GitHub Developer Essentials · Version Control
Short answer: Shows changes between the staging area and the last commit.
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: Displays the commit history of the current branch.
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.