Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4616 total questions 4516 technical 100 career & HR 4346 from PDF library

Showing 1–25 of 101

Popular tracks

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

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…

Testing Read answer
Mid PDF
What are the characteristics of a good unit test?

A good unit test is: Isolated: Tests one unit without external dependencies. Repeatable: Produces the same results every run. Fast: Executes quickly to allow frequent runs. Automated: Runs without manual intervention. Cl…

Testing Read answer
Mid PDF
How do you decide what to test in your application?

Answer: Focus on testing: Critical business logic. Edge cases and boundary conditions. Public methods and APIs. Error handling and exception paths. Code that is prone to bugs or complex. What interviewers expect A clear…

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

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. Wh…

Testing Read answer
Mid PDF
What are the challenges of writing unit tests?

Challenges include: Managing external dependencies and state. Writing tests for legacy or tightly coupled code. Maintaining tests as code evolves. Ensuring tests are meaningful and not brittle. Balancing test coverage an…

Testing Read answer
Mid PDF
How do you handle dependencies in unit testing?

Answer: Use mocking or stubbing frameworks (e.g., Moq, NSubstitute) to replace real dependencies with controlled test doubles, allowing tests to focus on the unit under test. What interviewers expect A clear definition t…

Testing Read answer
Mid PDF
What are the benefits of automated unit testing?

Answer: Fast feedback on code changes. Detect regressions early. Supports continuous integration and delivery. Improves code quality and confidence. Enables safer refactoring. What interviewers expect A clear definition…

Testing Read answer
Mid PDF
How do you run unit tests in Visual Studio?

Answer: Use Test Explorer to discover and run tests. Tests can be run individually or in bulk. Use keyboard shortcuts (e.g., Ctrl+R, A to run all tests). Integrate with CI pipelines for automated test runs. What intervie…

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

Answer: Assertions verify that the actual outcome of a test matches the expected result, determining if a test passes or fails. What interviewers expect A clear definition tied to Testing in Unit Testing projects Trade-o…

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

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. x…

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

xUnit is a free, open-source unit testing framework for .NET, designed by the original uthors of NUnit. It’s popular because it supports modern testing practices, is lightweight, extensible, integrates well with .NET Cor…

Testing Read answer
Mid PDF
How does xUnit differ from NUnit and MSTest?

xUnit encourages constructor injection for setup instead of [SetUp] methods. It uses [Fact] and [Theory] attributes for test methods, while NUnit/MSTest use [Test] and [TestMethod]. xUnit does not use [TestInitialize]/[T…

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

Answer: public class CalculatorTests { [Fact] public void Add_ReturnsSum() { var calculator = new Calculator(); var result = calculator.Add(2, 3); ssert.Equal(5, result); } } What interviewers expect A clear definition t…

Testing Read answer
Mid PDF
What are [Fact] and [Theory] attributes in xUnit?

Answer: [Fact]: Defines a parameterless test method representing a single test case. [Theory]: Defines a parameterized test that runs multiple times with different data inputs, provided by [InlineData] or other data sour…

Testing Read answer
Mid PDF
How do you pass parameters to tests in xUnit?

Using [Theory] and data attributes like [InlineData]: [Theory] [InlineData(2, 3, 5)] [InlineData(10, 20, 30)] public void Add_ReturnsSum(int a, int b, int expected) { var calculator = new Calculator(); var result = calcu…

Testing Read answer
Mid PDF
How do you handle setup and teardown in xUnit tests?

Use the constructor for setup code. Implement IDisposable interface for teardown (cleanup) code. Example: public class DatabaseTests : IDisposable { public DatabaseTests() { // Setup } [Fact] public void TestMethod() { }…

Testing Read answer
Mid PDF
How do you skip or ignore tests in xUnit?

Answer: Use the Skip property on [Fact] or [Theory]: [Fact(Skip = "Reason for skipping")] public void SkippedTest() { } What interviewers expect A clear definition tied to Testing in Unit Testing projects Trade-offs (per…

Testing Read answer
Mid PDF
How do you organize test classes and test collections in xUnit?

Group related tests in the same class. Use Collection attribute to group classes that share setup/teardown or should not run in parallel. [Collection("Database collection")] public class TestClass1 { } [Collection("Datab…

Testing Read answer
Mid PDF
Can you explain the concept of test fixtures in xUnit?

Test fixtures provide a way to share setup and cleanup code between tests. xUnit supports: Class Fixtures: Shared across all tests in a class. Collection Fixtures: Shared across multiple test classes. They are implemente…

Testing Read answer
Mid PDF
How do you run xUnit tests from the command line?

Answer: Use the dotnet test CLI command: dotnet test YourTestProject.csproj This runs all tests in the project and outputs results in the console. Additional options allow filtering and outputting reports. NUnit Framewor…

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

NUnit is a popular open-source unit testing framework for .NET. It allows developers to write nd run automated tests by marking test methods with attributes. NUnit discovers and executes these tests, verifying that the c…

Testing Read answer
Mid PDF
How do NUnit test attributes differ from xUnit’s?

NUnit uses [Test] for test methods, whereas xUnit uses [Fact]. NUnit uses [SetUp] and [TearDown] for setup and cleanup, while xUnit uses constructors and IDisposable. NUnit supports [TestCase] for parameterized tests, xU…

Testing Read answer
Mid PDF
How do you write parameterized tests in NUnit?

Answer: [TestCase(2, 3, 5)] [TestCase(10, 20, 30)] public void Add_ReturnsSum(int a, int b, int expected) { var calculator = new Calculator(); var result = calculator.Add(a, b); ssert.AreEqual(expected, result); } What i…

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

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. What interviewers expect A clear definition tied to Testing in Uni…

Testing Read answer
Mid PDF
How do you assert exceptions in NUnit?

Answer: [Test] public void Divide_ByZero_ThrowsException() { var calculator = new Calculator(); ssert.Throws<DivideByZeroException>(() => calculator.Divide(10, 0)); } What interviewers expect A clear…

Testing Read answer

Unit Testing C# Programming Tutorial · Testing

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.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

A good unit test is:

  • Isolated: Tests one unit without external dependencies.
  • Repeatable: Produces the same results every run.
  • Fast: Executes quickly to allow frequent runs.
  • Automated: Runs without manual intervention.
  • Clear: Easy to understand and maintain.
  • Independent: Does not depend on other tests.
Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Focus on testing: Critical business logic. Edge cases and boundary conditions. Public methods and APIs. Error handling and exception paths. Code that is prone to bugs or complex.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

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.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Challenges include:

  • Managing external dependencies and state.
  • Writing tests for legacy or tightly coupled code.
  • Maintaining tests as code evolves.
  • Ensuring tests are meaningful and not brittle.
  • Balancing test coverage and development speed.
Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Use mocking or stubbing frameworks (e.g., Moq, NSubstitute) to replace real dependencies with controlled test doubles, allowing tests to focus on the unit under test.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Fast feedback on code changes. Detect regressions early. Supports continuous integration and delivery. Improves code quality and confidence. Enables safer refactoring.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Use Test Explorer to discover and run tests. Tests can be run individually or in bulk. Use keyboard shortcuts (e.g., Ctrl+R, A to run all tests). Integrate with CI pipelines for automated test runs.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

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

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

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

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

xUnit is a free, open-source unit testing framework for .NET, designed by the original

uthors 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.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

  • xUnit encourages constructor injection for setup instead of [SetUp] methods.
  • It uses [Fact] and [Theory] attributes for test methods, while NUnit/MSTest use

[Test] and [TestMethod].

  • xUnit does not use [TestInitialize]/[TestCleanup] but favors class fixtures

nd constructor/dispose patterns.

  • xUnit is better integrated with .NET Core and supports parallel test execution by

default.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

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

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: [Fact]: Defines a parameterless test method representing a single test case. [Theory]: Defines a parameterized test that runs multiple times with different data inputs, provided by [InlineData] or other data sources.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Using [Theory] and data attributes like [InlineData]:

[Theory]

[InlineData(2, 3, 5)]

[InlineData(10, 20, 30)]

public void Add_ReturnsSum(int a, int b, int expected)
{
var calculator = new Calculator();
var result = calculator.Add(a, b);

ssert.Equal(expected, result);

}
Permalink & share

Unit Testing C# Programming Tutorial · Testing

  • Use the constructor for setup code.
  • Implement IDisposable interface for teardown (cleanup) code.

Example:

public class DatabaseTests : IDisposable
{
public DatabaseTests()
{

// Setup

}

[Fact]

public void TestMethod() { }
public void Dispose()
{

// Cleanup

}
}
For shared context across multiple tests, use class fixtures or collection fixtures.
Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Use the Skip property on [Fact] or [Theory]: [Fact(Skip = "Reason for skipping")] public void SkippedTest() { }

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

  • Group related tests in the same class.
  • Use Collection attribute to group classes that share setup/teardown or should not

run in parallel.

[Collection("Database collection")]

public class TestClass1 { }

[Collection("Database collection")]

public class TestClass2 { }
Permalink & share

Unit Testing C# Programming Tutorial · Testing

Test fixtures provide a way to share setup and cleanup code between tests. xUnit supports:

  • Class Fixtures: Shared across all tests in a class.
  • Collection Fixtures: Shared across multiple test classes.

They are implemented by creating a fixture class and injecting it into test classes via

constructor.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: Use the dotnet test CLI command: dotnet test YourTestProject.csproj This runs all tests in the project and outputs results in the console. Additional options allow filtering and outputting reports. NUnit Framework

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

NUnit is a popular open-source unit testing framework for .NET. It allows developers to write

nd run automated tests by marking test methods with attributes. NUnit discovers and

executes these tests, verifying that the code behaves as expected.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

  • NUnit uses [Test] for test methods, whereas xUnit uses [Fact].
  • NUnit uses [SetUp] and [TearDown] for setup and cleanup, while xUnit uses

constructors and IDisposable.

  • NUnit supports [TestCase] for parameterized tests, xUnit uses [Theory] with

[InlineData].

  • NUnit has more built-in attributes like [Category] for grouping tests.
Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: [TestCase(2, 3, 5)] [TestCase(10, 20, 30)] public void Add_ReturnsSum(int a, int b, int expected) { var calculator = new Calculator(); var result = calculator.Add(a, b); ssert.AreEqual(expected, result); }

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

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.

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

Unit Testing C# Programming Tutorial · Testing

Answer: [Test] public void Divide_ByZero_ThrowsException() { var calculator = new Calculator(); ssert.Throws<DivideByZeroException>(() => calculator.Divide(10, 0)); }

What interviewers expect

  • A clear definition tied to Testing in Unit Testing projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production Unit Testing application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in Unit Testing architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

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