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 1–24 of 24

Popular tracks

Junior PDF
What is unit testing and why is it important?

Short answer: Unit testing involves testing the smallest parts of an application (units) independently to ensure they work correctly. It is important because it helps detect bugs early, improves code quality, supports re…

Testing Read answer
Junior PDF
What is the difference between unit testing, integration testing, and functional testing?

Short answer: Unit Testing: Tests individual units in isolation. Integration Testing: Tests interaction between multiple components or systems. Functional Testing: Tests end-to-end functionality from the user's perspecti…

Testing Read answer
Junior PDF
What is the role of assertions in unit testing?

Short answer: Assertions verify that the actual outcome of a test matches the expected result, determining if a test passes or fails. Real-world example (ShopNest) Arrange a cart with 2 items → Act Checkout() → Assert to…

Testing Read answer
Junior PDF
What is code coverage and how useful is it?

Short answer: Code coverage measures the percentage of code executed by tests. It helps identify untested parts but doesn’t guarantee test quality. High coverage with meaningful tests improves confidence in code correctn…

Testing Read answer
Junior PDF
What is xUnit and why is it popular in .NET testing?

Short answer: xUnit is a free, open-source unit testing framework for .NET, designed by the original authors of NUnit. It’s popular because it supports modern testing practices, is lightweight, extensible, integrates wel…

Testing Read answer
Junior PDF
How do you write a basic test case using xUnit?

Short answer: public class CalculatorTests { [Fact] public void Add_ReturnsSum() { var calculator = new Calculator(); var result = calculator.Add(2, 3); Assert.Equal(5, result); } } Example code public class CalculatorTe…

Testing Read answer
Junior PDF
What is NUnit and how does it work in .NET testing?

Short answer: NUnit is a popular open-source unit testing framework for .NET. It allows developers to write and run automated tests by marking test methods with attributes. NUnit discovers and executes these tests, verif…

Testing Read answer
Junior PDF
What is the purpose of the [SetUp] and [TearDown] attributes?

Short answer: [SetUp] runs code before each test method to prepare test environment. [TearDown] runs code after each test to clean up resources or reset state. Real-world example (ShopNest) ShopNest unit tests cover pric…

Testing Read answer
Junior PDF
What is the difference between [Test] and [TestCase] in NUnit?

Short answer: [Test] marks a standard test method without parameters. [TestCase] provides inline parameter values to run the test multiple times with different inputs. Real-world example (ShopNest) ShopNest unit tests co…

Testing Read answer
Junior PDF
What is MSTest and when should you use it?

Short answer: MSTest is Microsoft's official unit testing framework for .NET. It’s tightly integrated with Visual Studio and is a good choice for teams using Microsoft tooling and wanting a straightforward, supported tes…

Testing Read answer
Junior PDF
What is mocking and why is it important in unit testing?

Short answer: Mocking is creating fake objects that simulate the behavior of real dependencies. It’s important because it isolates the unit under test, avoids reliance on external systems, improves test speed, and allows…

Testing Read answer
Junior PDF
What is the Moq framework and how is it used in .NET?

Short answer: Moq is a popular, open-source mocking library for .NET that enables developers to create mock objects, set expectations, and verify interactions in unit tests, helping isolate dependencies easily. Real-worl…

Testing Read answer
Junior PDF
What is Test Driven Development (TDD)?

Short answer: TDD is a software development approach where you write tests before writing the actual code. It follows a short, repetitive cycle of writing a failing test, implementing code to pass the test, and then refa…

Testing Read answer
Junior PDF
What is the difference between TDD and traditional testing?

Short answer: TDD writes tests before code, driving design and implementation. Traditional testing usually happens after coding, as a verification step. TDD promotes continuous testing and refactoring, while traditional…

Testing Read answer
Junior PDF
What is integration testing and how is it different from unit testing?

Short answer: Integration testing verifies that multiple components or systems work together correctly, unlike unit testing which tests individual units in isolation. It focuses on interactions between modules, databases…

Testing Read answer
Junior PDF
What is mocking/stubbing in the context of integration testing?

Short answer: Mocking/stubbing replaces external dependencies like web services or message queues with controlled test doubles to isolate the parts under test and control external behavior without invoking real services.…

Testing Read answer
Junior PDF
What is the role of in-memory databases like InMemory EF Core for integration testing?

Short answer: In-memory databases allow fast, isolated testing of data access code without a real database, making integration tests easier to run and maintain, but may lack certain behaviors of real databases (like rela…

Testing Read answer
Junior PDF
What is dependency injection and how does it facilitate testing?

Short answer: Dependency Injection (DI) is a design pattern where dependencies are provided rather than created inside a class. DI makes testing easier by allowing tests to inject mock or fake implementations of dependen…

Testing Read answer
Junior PDF
What is the difference between mocks, stubs, and fakes?

Short answer: Stub: Provides predefined data to the test. Mock: Verifies that certain interactions happened. Fake: Has a working implementation, often simpler than production. Real-world example (ShopNest) When testing S…

Testing Read answer
Junior PDF
What is the hardest bug you caught through testing?

Short answer: A concurrency issue that only appeared under load was caught by a combination of unit and integration tests with parallel execution. It was tricky to reproduce but testing helped identify race conditions. R…

Testing Read answer
Junior PDF
What is your experience with test automation in .NET projects?

Short answer: I have implemented CI/CD pipelines integrating xUnit tests, automated database resets, and used mocking extensively to achieve reliable, fast test runs that provide immediate feedback. Real-world example (S…

Testing Read answer
Junior PDF
What is the purpose of the Assert class in unit testing?

Short answer: The Assert class provides methods to verify conditions in tests, such as equality, truth, exceptions, or null values. It determines whether a test passes or fails based on these validations. Real-world exam…

Testing Read answer
Junior PDF
What is mocking vs spying in unit testing?

Short answer: Mocking involves creating objects that simulate behavior and expectations to verify interactions. Spying records information about how real or partial objects are used, focusing on what happened rather than…

Testing Read answer
Junior PDF
What is code coverage threshold you follow in your projects?

Short answer: Typically, I aim for at least 80% coverage on critical code paths, but focus more on meaningful coverage rather than just numbers. Coverage alone doesn’t guarantee quality. Real-world example (ShopNest) Sho…

Testing Read answer

Unit Testing C# Programming Tutorial · Testing

Short answer: Unit testing involves testing the smallest parts of an application (units) independently to ensure they work correctly. It is important because it helps detect bugs early, improves code quality, supports refactoring, and provides documentation for expected behavior.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Unit Testing: Tests individual units in isolation. Integration Testing: Tests interaction between multiple components or systems. Functional Testing: Tests end-to-end functionality from the user's perspective.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Assertions verify that the actual outcome of a test matches the expected result, determining if a test passes or fails.

Real-world example (ShopNest)

Arrange a cart with 2 items → Act Checkout() → Assert total and that payment was called once.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Code coverage measures the percentage of code executed by tests. It helps identify untested parts but doesn’t guarantee test quality. High coverage with meaningful tests improves confidence in code correctness. xUnit Framework

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: xUnit is a free, open-source unit testing framework for .NET, designed by the original authors of NUnit. It’s popular because it supports modern testing practices, is lightweight, extensible, integrates well with .NET Core and Visual Studio, and encourages clean, maintainable test code.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: public class CalculatorTests { [Fact] public void Add_ReturnsSum() { var calculator = new Calculator(); var result = calculator.Add(2, 3); Assert.Equal(5, result); } }

Example code

public class CalculatorTests
{ [Fact] public void Add_ReturnsSum()
{
var calculator = new Calculator();
var result = calculator.Add(2, 3); Assert.Equal(5, result); }
}

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: NUnit is a popular open-source unit testing framework for .NET. It allows developers to write and run automated tests by marking test methods with attributes. NUnit discovers and executes these tests, verifying that the code behaves as expected.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: [SetUp] runs code before each test method to prepare test environment. [TearDown] runs code after each test to clean up resources or reset state.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: [Test] marks a standard test method without parameters. [TestCase] provides inline parameter values to run the test multiple times with different inputs.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: MSTest is Microsoft's official unit testing framework for .NET. It’s tightly integrated with Visual Studio and is a good choice for teams using Microsoft tooling and wanting a straightforward, supported testing solution without external dependencies.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Mocking is creating fake objects that simulate the behavior of real dependencies. It’s important because it isolates the unit under test, avoids reliance on external systems, improves test speed, and allows testing specific scenarios and edge cases.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Moq is a popular, open-source mocking library for .NET that enables developers to create mock objects, set expectations, and verify interactions in unit tests, helping isolate dependencies easily.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: TDD is a software development approach where you write tests before writing the actual code. It follows a short, repetitive cycle of writing a failing test, implementing code to pass the test, and then refactoring.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: TDD writes tests before code, driving design and implementation. Traditional testing usually happens after coding, as a verification step. TDD promotes continuous testing and refactoring, while traditional testing may be more manual or batch-driven. Integration Testing

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Integration testing verifies that multiple components or systems work together correctly, unlike unit testing which tests individual units in isolation. It focuses on interactions between modules, databases, APIs, or external services.

Example code

Integration testing verifies that multiple components or systems work together correctly, unlike unit testing which tests individual units in isolation. It focuses on interactions between modules, databases, APIs, or external services.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Mocking/stubbing replaces external dependencies like web services or message queues with controlled test doubles to isolate the parts under test and control external behavior without invoking real services.

Real-world example (ShopNest)

When testing ShopNest’s order service, mock IPaymentGateway so tests do not call Razorpay.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: In-memory databases allow fast, isolated testing of data access code without a real database, making integration tests easier to run and maintain, but may lack certain behaviors of real databases (like relational constraints). Practical & Advanced Topics

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Dependency Injection (DI) is a design pattern where dependencies are provided rather than created inside a class. DI makes testing easier by allowing tests to inject mock or fake implementations of dependencies, isolating the unit under test.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Stub: Provides predefined data to the test. Mock: Verifies that certain interactions happened. Fake: Has a working implementation, often simpler than production.

Real-world example (ShopNest)

When testing ShopNest’s order service, mock IPaymentGateway so tests do not call Razorpay.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: A concurrency issue that only appeared under load was caught by a combination of unit and integration tests with parallel execution. It was tricky to reproduce but testing helped identify race conditions.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: I have implemented CI/CD pipelines integrating xUnit tests, automated database resets, and used mocking extensively to achieve reliable, fast test runs that provide immediate feedback.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: The Assert class provides methods to verify conditions in tests, such as equality, truth, exceptions, or null values. It determines whether a test passes or fails based on these validations.

Real-world example (ShopNest)

Arrange a cart with 2 items → Act Checkout() → Assert total and that payment was called once.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Mocking involves creating objects that simulate behavior and expectations to verify interactions. Spying records information about how real or partial objects are used, focusing on what happened rather than controlling behavior.

Real-world example (ShopNest)

When testing ShopNest’s order service, mock IPaymentGateway so tests do not call Razorpay.

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

Unit Testing C# Programming Tutorial · Testing

Short answer: Typically, I aim for at least 80% coverage on critical code paths, but focus more on meaningful coverage rather than just numbers. Coverage alone doesn’t guarantee quality.

Real-world example (ShopNest)

ShopNest unit tests cover pricing and discount rules so a bad coupon change fails in CI before customers see it.

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