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 376–400 of 963

Career & HR topics

By tech stack

Popular tracks

Junior PDF
What is Entity Framework Core?

Short answer: Entity Framework Core (EF Core) is a modern, lightweight, cross-platform, open-source ORM (Object-Relational Mapper) for .NET. It allows developers to interact with databases using C# objects rather than SQ…

EF Core Read answer
Junior PDF
What is ORM (Object-Relational Mapping)?

Short answer: ORM is a technique that maps objects in code to relational database tables. EF Core implements ORM by mapping .NET classes (entities) to database tables using DbContext, DbSet, and conventions or Fluent API…

EF Core Read answer
Junior PDF
What is ORM (Object-Relational Mapping)?

Short answer: How does EF Core implement it? ORM is a technique that maps objects in code to relational database tables. EF Core implements ORM by mapping .NET classes (entities) to database tables using DbContext, DbSet…

EF Core Read answer
Junior PDF
What is a DbContext?

Short answer: DbContext is the primary class for interacting with the database in EF Core. Explain a bit more It: Manages database connections Tracks changes to entities Provides methods for querying and saving data Conf…

EF Core Read answer
Junior PDF
What is a DbContext?

Short answer: What responsibilities does it have? DbContext is the primary class for interacting with the database in EF Core. It: Manages database connections Tracks changes to entities Provides methods for querying and…

EF Core Read answer
Junior PDF
What is DbSet<T>?

Short answer: DbSet&lt;T&gt; represents a collection of entities of type T in the context. Each DbSet maps to a table in the database, where T is the type of the entity. Real-world example (ShopNest) ShopNest’s order ser…

EF Core Read answer
Junior PDF
What is DbSet<T>?

Short answer: How does it map to database tables? DbSet&lt;T&gt; represents a collection of entities of type T in the context. Each DbSet maps to a table in the database, where T is the type of the entity. Real-world exa…

EF Core Read answer
Junior PDF
What is a POCO class?

Short answer: POCO (Plain Old CLR Object) is a simple class without any dependency on EF Core or any base class. EF Core uses POCOs as entities for data modeling. Real-world example (ShopNest) ShopNest’s order service us…

EF Core Read answer
Junior PDF
What is a navigation property?

Short answer: Navigation properties allow navigation from one entity to related entities. They define relationships (one-to-one, one-to-many, many-to-many). Example: public class Order Example code { public int Id { get;…

EF Core Read answer
Junior PDF
What is LINQ?

Short answer: LINQ (Language Integrated Query) lets you query collections using C# syntax. LINQ to Entities is LINQ querying against the EF Core model, translated to SQL and executed in the database. Real-world example (…

EF Core Read answer
Junior PDF
What is LINQ?

Short answer: What is “LINQ to Entities”? LINQ (Language Integrated Query) lets you query collections using C# syntax. LINQ to Entities is LINQ querying against the EF Core model, translated to SQL and executed in the da…

EF Core Read answer
Junior PDF
What is the Repository pattern and why is it important in .NET applications?

Short answer: The Repository pattern abstracts the data access layer from the business logic by providing a collection-like interface to access domain objects. It helps keep data access logic centralized and makes the co…

SOLID Read answer
Junior PDF
What is the Unit of Work pattern?

Short answer: The Unit of Work pattern is a design pattern used to maintain a list of operations to be performed within a single transaction. It ensures that all operations either succeed or fail together, providing cons…

SOLID Read answer
Junior PDF
What is Dependency Injection and why is it useful?

Short answer: Dependency Injection (DI) is a design pattern that allows an object to receive its dependencies from an external source rather than creating them itself. This promotes loose coupling, enhances testability,…

SOLID Read answer
Junior PDF
What is the difference between Scoped, Singleton, and Transient lifetimes?

Short answer: Transient: A new instance is created every time it is requested. Scoped: A single instance is created per request/HTTP request. Singleton: A single instance is created and shared across the application life…

SOLID Read answer
Junior PDF
What is the Single Responsibility Principle?

Short answer: The Single Responsibility Principle (SRP) states that a class should have only one reason to change. In other words, it should have only one responsibility or job. Each class should do one thing, and do it…

SOLID Read answer
Junior PDF
What is an example where OCP is violated?

Short answer: Before (OCP Violation): public class DiscountCalculator If you need to support a new customer type, you must modify this method — violating OCP. After (OCP Compliant): public interface IDiscountStrategy Exa…

SOLID Read answer
Junior PDF
What is Liskov Substitution Principle?

Short answer: The Liskov Substitution Principle (LSP) states that: Subtypes must be substitutable for their base types without altering the correctness of the program. In other words, if class S is a subclass of class T,…

SOLID Read answer
Junior PDF
What is an example of violating LSP in .NET code?

Short answer: Example (Violation of LSP): public class Rectangle Example code { public virtual int Width { get; set; } public virtual int Height { get; set; } public int Area() =&gt; Width * Height; } public class Square…

SOLID Read answer
Junior PDF
What is Interface Segregation Principle?

Short answer: The Interface Segregation Principle (ISP) states that: Clients should not be forced to depend on interfaces they do not use. This means that interfaces should be small and focused, containing only the metho…

SOLID Read answer
Junior PDF
What is Dependency Inversion Principle?

Short answer: The Dependency Inversion Principle (DIP) states that: High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should…

SOLID Read answer
Junior PDF
What is the difference between Repository and DAO patterns?

Short answer: DAO (Data Access Object) focuses on low-level database operations and CRUD, typically mapping tables to objects. Repository abstracts data access at the domain level, working with aggregates/entities and en…

SOLID Read answer
Junior PDF
What is the role of IServiceCollection and IServiceProvider in DI?

Short answer: IServiceCollection: A container used during app startup to register services and their lifetimes (Scoped, Transient, Singleton). It acts as a service registry. IServiceProvider: The built container that res…

SOLID Read answer
Junior PDF
What is the difference between Composition and Inheritance?

Short answer: Inheritance creates an “is-a” relationship, where a subclass inherits behavior and properties from a parent class. It can lead to tight coupling and fragile hierarchies if overused. Composition creates a “h…

SOLID Read answer
Junior PDF
What is the difference between Cohesion and Coupling?

Short answer: Cohesion: Degree to which elements of a module belong together. High cohesion means focused, well-defined responsibilities. Coupling: Degree of interdependence between modules. Low coupling means modules ar…

SOLID Read answer

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Entity Framework Core (EF Core) is a modern, lightweight, cross-platform, open-source ORM (Object-Relational Mapper) for .NET. It allows developers to interact with databases using C# objects rather than SQL queries.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: ORM is a technique that maps objects in code to relational database tables. EF Core implements ORM by mapping .NET classes (entities) to database tables using DbContext, DbSet, and conventions or Fluent API.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: How does EF Core implement it? ORM is a technique that maps objects in code to relational database tables. EF Core implements ORM by mapping .NET classes (entities) to database tables using DbContext, DbSet, and conventions or Fluent API.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: DbContext is the primary class for interacting with the database in EF Core.

Explain a bit more

It: Manages database connections Tracks changes to entities Provides methods for querying and saving data Configures models and relationships DbContext is the primary class for interacting with the database in EF Core. It: Manages database connections Tracks changes to entities Provides methods for querying and saving data Configures models and relationships

Real-world example (ShopNest)

ShopNest registers AppDbContext as scoped. One HTTP request = one context. Never inject it as a singleton.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: What responsibilities does it have? DbContext is the primary class for interacting with the database in EF Core. It: Manages database connections Tracks changes to entities Provides methods for querying and saving data Configures models and relationships

Real-world example (ShopNest)

ShopNest registers AppDbContext as scoped. One HTTP request = one context. Never inject it as a singleton.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: DbSet<T> represents a collection of entities of type T in the context. Each DbSet maps to a table in the database, where T is the type of the entity.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: How does it map to database tables? DbSet<T> represents a collection of entities of type T in the context. Each DbSet maps to a table in the database, where T is the type of the entity.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: POCO (Plain Old CLR Object) is a simple class without any dependency on EF Core or any base class. EF Core uses POCOs as entities for data modeling.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Navigation properties allow navigation from one entity to related entities. They define relationships (one-to-one, one-to-many, many-to-many). Example: public class Order

Example code

{
public int Id { get; set; }
public Customer Customer { get; set; } // Navigation property
}

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: LINQ (Language Integrated Query) lets you query collections using C# syntax. LINQ to Entities is LINQ querying against the EF Core model, translated to SQL and executed in the database.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: What is “LINQ to Entities”? LINQ (Language Integrated Query) lets you query collections using C# syntax. LINQ to Entities is LINQ querying against the EF Core model, translated to SQL and executed in the database.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Repository pattern abstracts the data access layer from the business logic by providing a collection-like interface to access domain objects. It helps keep data access logic centralized and makes the codebase easier to maintain, test, and swap out data sources (e.g., switching from EF Core to Dapper or an API).

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Unit of Work pattern is a design pattern used to maintain a list of operations to be performed within a single transaction. It ensures that all operations either succeed or fail together, providing consistency and managing changes to multiple business objects during a transaction. It coordinates the writing out of changes and resolves potential concurrency issues.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Dependency Injection (DI) is a design pattern that allows an object to receive its dependencies from an external source rather than creating them itself. This promotes loose coupling, enhances testability, and simplifies code maintenance. Benefits: Improves modularity Enables easier unit testing (via mock dependencies) Promotes adherence to SOLID principles (especially the Dependency Inversion Principle)

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Transient: A new instance is created every time it is requested. Scoped: A single instance is created per request/HTTP request. Singleton: A single instance is created and shared across the application lifetime. Lifetime Created Per Use Case Transient Every injection Lightweight, stateless services Scoped HTTP Request Web services handling per-request data Singleton App lifetime Logging, configuration, cache

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Single Responsibility Principle (SRP) states that a class should have only one reason to change. In other words, it should have only one responsibility or job. Each class should do one thing, and do it well. For example, a class that handles user authentication should not also be responsible for logging or sending emails.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Before (OCP Violation): public class DiscountCalculator If you need to support a new customer type, you must modify this method — violating OCP. After (OCP Compliant): public interface IDiscountStrategy

Example code

{
public decimal CalculateDiscount(string customerType)
{
if (customerType == "Regular") return 10;
if (customerType == "Premium") return 20;
if (customerType == "VIP") return 30;
return 0;
}
}
{ decimal GetDiscount(); }
public class RegularCustomerDiscount : IDiscountStrategy
{
public decimal GetDiscount() => 10;
}
public class PremiumCustomerDiscount : IDiscountStrategy
{
public decimal GetDiscount() => 20;
}
public class VipCustomerDiscount : IDiscountStrategy
{
public decimal GetDiscount() => 30;
} Now you can add new customer types without modifying existing code — just create a new strategy.

Real-world example (ShopNest)

Open/Closed in ShopNest: add a new payment method by adding a class, not by editing a giant switch in CheckoutService.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Liskov Substitution Principle (LSP) states that: Subtypes must be substitutable for their base types without altering the correctness of the program. In other words, if class S is a subclass of class T, then objects of type T should be replaceable with objects of type S without breaking the application. This ensures that inheritance models is-a relationships correctly.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Example (Violation of LSP): public class Rectangle

Example code

{
public virtual int Width { get; set; }
public virtual int Height { get; set; }
public int Area() => Width * Height;
}
public class Square : Rectangle
{
public override int Width
{
set { base.Width = base.Height = value; }
}
public override int Height
{
set { base.Width = base.Height = value; }
}
} Now if you substitute Rectangle with Square: Rectangle rect = new Square();
rect.Width = 5;
rect.Height = 10; Console.WriteLine(rect.Area()); // Outputs 100, but logically expected 50 ❌ The behavior is incorrect — this is a violation of LSP.

Real-world example (ShopNest)

Open/Closed in ShopNest: add a new payment method by adding a class, not by editing a giant switch in CheckoutService.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Interface Segregation Principle (ISP) states that: Clients should not be forced to depend on interfaces they do not use. This means that interfaces should be small and focused, containing only the methods that are relevant to the implementing class. It prevents "fat" or "bloated" interfaces.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: The Dependency Inversion Principle (DIP) states that: High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. In other words: High-level business logic shouldn't depend on concrete implementations. Instead, both high- and low-level components should depend on interfaces or abstract classes.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: DAO (Data Access Object) focuses on low-level database operations and CRUD, typically mapping tables to objects. Repository abstracts data access at the domain level, working with aggregates/entities and encapsulating business logic. Repository often uses DAO internally but is more aligned with domain-driven design.

Real-world example (ShopNest)

ShopNest payment fees use Strategy: IFeeCalculator with UPI/Card implementations chosen at runtime.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: IServiceCollection: A container used during app startup to register services and their lifetimes (Scoped, Transient, Singleton). It acts as a service registry. IServiceProvider: The built container that resolves and provides instances of registered services at runtime. It uses the registrations to create and inject dependencies.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Inheritance creates an “is-a” relationship, where a subclass inherits behavior and properties from a parent class. It can lead to tight coupling and fragile hierarchies if overused. Composition creates a “has-a” relationship, where a class contains instances of other classes and delegates behavior to them. It’s more flexible and promotes loose coupling.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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

Design Patterns & SOLID Design Patterns in C# · SOLID

Short answer: Cohesion: Degree to which elements of a module belong together. High cohesion means focused, well-defined responsibilities. Coupling: Degree of interdependence between modules. Low coupling means modules are independent and changes in one don’t affect others.

Real-world example (ShopNest)

Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.

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