Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: ccess them in workflows: env: WS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach product…
Short answer: <<<<<<< HEAD your code ======= incoming code >>>>>>> branch Real-world example (ShopNest) Feature work for “UPI payment” lives on feature/upi-payment . Open a PR to…
Short answer: My preferred strategy depends on the project type and team size: For large enterprise projects with planned releases → I prefer Git Flow. Explain a bit more Branches: main, develop, feature/*, release/*, ho…
Short answer: Store tokens (like AWS_ACCESS_KEY, DOCKER_TOKEN) in → Settings > Secrets and variables > Actions Access them in workflows: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} Real-world example (…
Short answer: git config --global user.signingkey <key-id> git config --global commit.gpgsign true Real-world example (ShopNest) ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never rea…
Short answer: Integration means connecting your Git repository to your CI/CD system so every push, pull request, or tag triggers an automated build, test, and deploy pipeline. Explain a bit more ✅ Jenkins Integration Ins…
Short answer: git cherry-pick <commit-hash> Real-world example (ShopNest) Prefer clear commits: fix(cart): prevent negative quantities instead of update . Say this in the interview Define — one clear sentence (the…
Short answer: git switch -c hotfix/save-work 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 —…
Short answer: The MilkDecorator and SugarDecorator classes extend the CoffeeDecorator class and override the Cost() and Description() methods to add specific behavior (like adding the price of milk or sugar). MilkDecorat…
Short answer: The TextEditor class is the invoker that invokes commands. It holds a stack of commands (_commandHistory) and is responsible for executing and undoing commands. When a command is executed, it’s pushed onto…
Short answer: The PizzaDirector class orchestrates the pizza building process. It uses a builder to construct a specific type of pizza (like Margherita) by calling the appropriate methods on the builder. It then returns…
Short answer: The Circle class is a refined abstraction that extends the Shape class and provides the implementation for the Draw() method. It uses the passed IDrawingAPI to draw the circle. public class Circle : Shape E…
Short answer: WindowsButton, MacButton, WindowsCheckbox, and MacCheckbox are concrete implementations of the IButton and ICheckbox interfaces. Each one provides a platform-specific rendering logic. public class WindowsBu…
Short answer: lice received: Hi Alice! How It Works: Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview. Sa…
Short answer: daptee.SpecificRequest(), thus enabling compatibility between incompatible systems. Key Benefits of the Adapter Pattern: Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes dupl…
Short answer: How It Works: Follow: Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview. Say this in the int…
Short answer: And pass it to a PizzaDirector. The director uses the builder to construct a Margherita pizza and then prints the result. class Program { static void Main() { IPizzaBuilder builder = new MargheritaPizzaBuil…
Short answer: PIs (DrawingAPI1 and DrawingAPI2). The client code can easily switch between different rendering styles without changing the shape itself. PIs (DrawingAPI1 and DrawingAPI2). The client code can easily switc…
Short answer: The ProductCollection class is a concrete aggregate that implements the IAggregate<Product> interface. It maintains a list of Product objects and provides an Add() method to add products. It also impl…
Short answer: The client code uses the factory to create a logger without needing to know which type of logger is being instantiated. Based on the factory used (FileLoggerFactory or ConsoleLoggerFactory), the correspondi…
Short answer: The Application class accepts an IUIFactory in its constructor. This means the client code can choose which concrete factory (Windows or Mac) to use without changing the Application class itself. public cla…
Short answer: ctual construction steps can differ based on the type of pizza (e.g., Margherita vs. Pepperoni). Key Benefits of the Builder Pattern: Say this in the interview Define — one clear sentence (the short answer…
Short answer: PIs (e.g., DrawingAPI3, DrawingAPI4) without needing to modify the existing code. Each concrete drawing API (DrawingAPI1, DrawingAPI2) provides its own implementation of the DrawCircle method, enabling the…
Short answer: pplication app = new Application(factory); pp.Render(); } } pplication app = new Application(factory); pp.Render(); } } pplication app = new Application(factory); pp.Render(); } } pplication app = new Appli…
Short answer: Product 1 Product 2 Product 3 How It Works: Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the intervie…
Git & GitHub Developer Essentials · Version Control
Short answer: ccess them in workflows: env: WS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
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: <<<<<<< HEAD your code ======= incoming code >>>>>>> branch
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: My preferred strategy depends on the project type and team size: For large enterprise projects with planned releases → I prefer Git Flow.
Branches: main, develop, feature/*, release/*, hotfix/* Benefits: Organized release management, clear isolation of features and fixes. For agile teams or startups deploying multiple times a day → I prefer Trunk-Based Development. Developers work on short-lived feature branches and merge into main frequently (often daily). CI/CD pipelines ensure code is always deployable. Real-world example: At my last company, we used Trunk-Based Development for a SaaS platform — it reduced merge conflicts and allowed fast continuous deployment.
Git & GitHub Developer Essentials · Version Control
Short answer: Store tokens (like AWS_ACCESS_KEY, DOCKER_TOKEN) in → Settings > Secrets and variables > Actions Access them in workflows: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
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 config --global user.signingkey <key-id> git config --global commit.gpgsign true
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: Integration means connecting your Git repository to your CI/CD system so every push, pull request, or tag triggers an automated build, test, and deploy pipeline.
✅ Jenkins Integration Install the Git plugin in Jenkins. Create a new pipeline job and link it to your Git repository: pipeline { agent any stages { stage('Checkout') { steps { git branch: 'main', url: } } stage('Build') { steps { sh 'npm install' sh 'npm test' }
}
}
} ● Jenkins polls Git or listens for webhooks to trigger builds automatically. ✅ GitLab CI/CD GitLab CI is built-in — simply create .gitlab-ci.yml: stages: test deploy test: script: npm install npm test deploy: script: ./deploy.sh only: main Every push triggers this pipeline automatically. ✅ GitHub Actions GitHub has its own YAML-based workflows: name: Node CI on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: uses: actions/checkout@v4 run: npm ci run: npm test It runs directly in GitHub without needing extra setup. Real-world example: Your team pushes code to GitHub → GitHub Actions automatically runs tests → Jenkins (or GitLab CI) deploys to a staging environment → Approval required for production deploy.
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 cherry-pick <commit-hash>
Prefer clear commits: fix(cart): prevent negative quantities instead of update.
Git & GitHub Developer Essentials · Version Control
Short answer: git switch -c hotfix/save-work
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: The MilkDecorator and SugarDecorator classes extend the CoffeeDecorator class and override the Cost() and Description() methods to add specific behavior (like adding the price of milk or sugar). MilkDecorator: public class MilkDecorator : CoffeeDecorator
{
public MilkDecorator(ICoffee coffee) : base(coffee) { }
public override double Cost() => base.Cost() + 0.50; // Add cost of milk public override string Description() => base.Description() + ", Milk"; // Add milk to description } SugarDecorator: public class SugarDecorator : CoffeeDecorator
{
public SugarDecorator(ICoffee coffee) : base(coffee) { }
public override double Cost() => base.Cost() + 0.25; // Add cost of sugar public override string Description() => base.Description() + ", Sugar"; // Add sugar to description }
Logging and caching decorators wrap IProductRepository so core SQL code stays clean.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: The TextEditor class is the invoker that invokes commands. It holds a stack of commands (_commandHistory) and is responsible for executing and undoing commands. When a command is executed, it’s pushed onto the stack. The Undo() method pops the last executed command and undoes its action. public class TextEditor
{
private readonly Stack<ICommand> _commandHistory = new Stack<ICommand>(); public void ExecuteCommand(ICommand command)
{ command.Execute(); _commandHistory.Push(command); }
public void Undo()
{
if (_commandHistory.Count > 0)
{
var command = _commandHistory.Pop(); command.Undo(); }
}
}
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: The PizzaDirector class orchestrates the pizza building process. It uses a builder to construct a specific type of pizza (like Margherita) by calling the appropriate methods on the builder. It then returns the final product. public class PizzaDirector
{
private readonly IPizzaBuilder _builder;
public PizzaDirector(IPizzaBuilder builder) => _builder = builder; public Pizza ConstructMargheritaPizza()
{ _builder.SetDough("Thin Crust"); _builder.SetSauce("Tomato"); _builder.AddTopping("Mozzarella"); return _builder.Build();
}
}
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: The Circle class is a refined abstraction that extends the Shape class and provides the implementation for the Draw() method. It uses the passed IDrawingAPI to draw the circle. public class Circle : Shape
{
private double _x, _y, _radius;
public Circle(double x, double y, double radius, IDrawingAPI drawingAPI) : base(drawingAPI) {
_x = x;
_y = y;
_radius = radius;
}
public override void Draw() => _drawingAPI.DrawCircle(_x, _y, _radius); }
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: WindowsButton, MacButton, WindowsCheckbox, and MacCheckbox are concrete implementations of the IButton and ICheckbox interfaces. Each one provides a platform-specific rendering logic. public class WindowsButton : IButton
{
public void Render() => Console.WriteLine("Rendering Windows Button."); }
public class MacButton : IButton
{
public void Render() => Console.WriteLine("Rendering Mac Button."); }
public class WindowsCheckbox : ICheckbox
{
public void Render() => Console.WriteLine("Rendering Windows Checkbox."); }
public class MacCheckbox : ICheckbox
{
public void Render() => Console.WriteLine("Rendering Mac Checkbox."); }
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: lice received: Hi Alice! How It Works:
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: daptee.SpecificRequest(), thus enabling compatibility between incompatible systems. Key Benefits of the Adapter Pattern:
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: How It Works: Follow:
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: And pass it to a PizzaDirector. The director uses the builder to construct a Margherita pizza and then prints the result. class Program { static void Main() { IPizzaBuilder builder = new MargheritaPizzaBuilder(); PizzaDirector director = new PizzaDirector(builder); Pizza pizza = director.ConstructMargheritaPizza(); Console.WriteLine(pizza); } } And pass it… to a PizzaDirector. The director uses the builder to…
construct a Margherita pizza and then prints the result. class Program { static void Main() { IPizzaBuilder builder = new MargheritaPizzaBuilder(); PizzaDirector director = new PizzaDirector(builder); Pizza pizza = director.ConstructMargheritaPizza(); Console.WriteLine(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.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: PIs (DrawingAPI1 and DrawingAPI2). The client code can easily switch between different rendering styles without changing the shape itself. PIs (DrawingAPI1 and DrawingAPI2). The client code can easily switch between different rendering styles without changing the shape itself. class Program { static void Main() { Shape circle1 = new Circle(5, 10, 2, new…… DrawingAPI1()); Shape circle2 = new Circle(5, 10, 2, new…
DrawingAPI2()); circle1.Draw(); // Outputs: Drawing Circle at (5, 10) with radius 2 using API 1.
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: The ProductCollection class is a concrete aggregate that implements the IAggregate<Product> interface. It maintains a list of Product objects and provides an Add() method to add products. It also implements CreateIterator() to return an instance of ProductIterator, enabling iteration over the collection. public class ProductCollection : IAggregate<Product>
{
private readonly List<Product> _products = new List<Product>();
public void Add(Product product) => _products.Add(product);
public int Count => _products.Count;
public Product this[int index] => _products[index];
public IIterator<Product> CreateIterator() => new ProductIterator(this); }
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: The client code uses the factory to create a logger without needing to know which type of logger is being instantiated. Based on the factory used (FileLoggerFactory or ConsoleLoggerFactory), the corresponding logger is created. class Program { static void Main() {
LoggerFactory factory = new ConsoleLoggerFactory();
ILogger logger = factory.CreateLogger(); logger.Log("This is a log message."); }
}
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: The Application class accepts an IUIFactory in its constructor. This means the client code can choose which concrete factory (Windows or Mac) to use without changing the Application class itself. public class Application
{
private readonly IButton _button;
private readonly ICheckbox _checkbox;
public Application(IUIFactory factory)
{
_button = factory.CreateButton();
_checkbox = factory.CreateCheckbox();
}
public void Render()
{ _button.Render(); _checkbox.Render(); }
}
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: ctual construction steps can differ based on the type of pizza (e.g., Margherita vs. Pepperoni). Key Benefits of the Builder Pattern:
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: PIs (e.g., DrawingAPI3, DrawingAPI4) without needing to modify the existing code. Each concrete drawing API (DrawingAPI1, DrawingAPI2) provides its own implementation of the DrawCircle method, enabling the flexibility to draw in different styles or using different libraries. Key Benefits of the Bridge Pattern:
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: pplication app = new Application(factory); pp.Render(); } } pplication app = new Application(factory); pp.Render(); } } pplication app = new Application(factory); pp.Render(); } } pplication app = new Application(factory); pp.Render(); } }
ShopNest’s NotificationFactory creates Email or SMS senders based on user preference.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: Product 1 Product 2 Product 3 How It Works:
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.