Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
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…
Short answer: Feature EF6 EF Core Platform .NET Framework only Cross-platform (.NET Core) Performance Slower Faster and more optimized LINQ support Limited Enhanced Change tracking Basic More efficient Migrations Availab…
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…
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…
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…
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…
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 ser…
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 exa…
Short answer: column. EF Core uses conventions or Fluent API to configure the mappings. Real-world example (ShopNest) ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() ca…
Short answer: I use a combination of: Simple examples showing before/after code refactoring. Explain a bit more Pair programming sessions to explain thought processes. Encouraging reading and discussing classic books lik…
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…
Short answer: Decorator adds additional responsibilities to objects dynamically without altering their interface. It wraps the original object to extend behavior. Proxy controls access to an object, possibly adding lazy…
Short answer: Adapter converts the interface of a class into another interface clients expect, allowing incompatible interfaces to work together. It promotes Open/Closed Principle (OCP) by enabling new integrations witho…
Short answer: Use the Proxy or Virtual Proxy pattern where a placeholder object controls access to the real object and defers its creation until needed. In .NET, Lazy<T> provides built-in lazy loading. Real-world e…
Short answer: Service Locator anti-pattern: Hides dependencies instead of injecting them explicitly. Overusing Singleton: Leads to hidden global state and testing difficulties. Improper Singleton thread safety: Causes ra…
Short answer: Template Method defines the skeleton of an algorithm in a base class, deferring some steps to subclasses. It allows subclasses to redefine parts of the algorithm without changing its structure. It supports…
Short answer: SOLID promotes small, single-responsibility services (SRP), clear interfaces (ISP), loose coupling (DIP), and extendable design (OCP). This aligns well with microservices by encouraging modular, maintainabl…
Short answer: The Command Pattern encapsulates requests as objects, allowing operations to be stored, undone, or redone by maintaining command history. Real-world example (ShopNest) Patterns in ShopNest should solve a re…
Short answer: Use interfaces and abstractions (DIP). Apply Dependency Injection. Modularize code into bounded contexts or separate projects. Use events or messaging for decoupled communication. Avoid static state and glo…
Short answer: Encapsulates a request as an object with methods to execute and possibly undo the operation. The invoker calls commands without knowing the action details, supporting decoupling and flexible request handlin…
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…
Short answer: Use API contracts and versioning. Employ service discovery and load balancing. Prefer asynchronous messaging/event-driven architecture to reduce tight coupling. Apply circuit breakers and retries for fault…
Short answer: Interfaces define contracts with no implementation, supporting ISP and DIP by allowing flexible implementations. Abstract classes provide a base implementation and shared code, useful for Template Method pa…
Short answer: Builder separates complex object construction from its representation. For example, building an HttpRequest with optional headers, query params, and body: public class HttpRequestBuilder Example code { priv…
Short answer: Observer supports SRP by separating notification logic from core business logic and DIP by depending on abstractions (observers). It fits DI because observers can be injected, allowing flexible runtime subs…
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.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: Feature EF6 EF Core Platform .NET Framework only Cross-platform (.NET Core) Performance Slower Faster and more optimized LINQ support Limited Enhanced Change tracking Basic More efficient Migrations Available Improved and CLI-friendly Extensibility Limited Highly extensible
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
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.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
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.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: 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 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
ShopNest registers AppDbContext as scoped. One HTTP request = one context. Never inject it as a singleton.
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
ShopNest registers AppDbContext as scoped. One HTTP request = one context. Never inject it as a singleton.
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.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
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.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: column. EF Core uses conventions or Fluent API to configure the mappings.
ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: I use a combination of: Simple examples showing before/after code refactoring.
Pair programming sessions to explain thought processes. Encouraging reading and discussing classic books like “Clean Code” and “Design Patterns”. Practical coding exercises and code reviews focused on SOLID principles. Showing real project scenarios where principles improved code quality and maintainability. Promoting a culture of continuous learning and curiosity. Bonus / Miscellaneous
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.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Decorator adds additional responsibilities to objects dynamically without altering their interface. It wraps the original object to extend behavior. Proxy controls access to an object, possibly adding lazy initialization, access control, or logging, without changing its interface.
ShopNest payment fees use Strategy: IFeeCalculator with UPI/Card implementations chosen at runtime.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Adapter converts the interface of a class into another interface clients expect, allowing incompatible interfaces to work together. It promotes Open/Closed Principle (OCP) by enabling new integrations without modifying existing code.
ShopNest payment fees use Strategy: IFeeCalculator with UPI/Card implementations chosen at runtime.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Use the Proxy or Virtual Proxy pattern where a placeholder object controls access to the real object and defers its creation until needed. In .NET, Lazy<T> provides built-in lazy loading.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Service Locator anti-pattern: Hides dependencies instead of injecting them explicitly. Overusing Singleton: Leads to hidden global state and testing difficulties. Improper Singleton thread safety: Causes race conditions. Injecting concrete implementations: Violates DIP.
ShopNest payment fees use Strategy: IFeeCalculator with UPI/Card implementations chosen at runtime.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Template Method defines the skeleton of an algorithm in a base class, deferring some steps to subclasses. It allows subclasses to redefine parts of the algorithm without changing its structure. It supports OCP by enabling extensions through inheritance.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: SOLID promotes small, single-responsibility services (SRP), clear interfaces (ISP), loose coupling (DIP), and extendable design (OCP). This aligns well with microservices by encouraging modular, maintainable, and testable service boundaries.
Open/Closed in ShopNest: add a new payment method by adding a class, not by editing a giant switch in CheckoutService.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: The Command Pattern encapsulates requests as objects, allowing operations to be stored, undone, or redone by maintaining command history.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Use interfaces and abstractions (DIP). Apply Dependency Injection. Modularize code into bounded contexts or separate projects. Use events or messaging for decoupled communication. Avoid static state and global variables.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Encapsulates a request as an object with methods to execute and possibly undo the operation. The invoker calls commands without knowing the action details, supporting decoupling and flexible request handling.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
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.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Use API contracts and versioning. Employ service discovery and load balancing. Prefer asynchronous messaging/event-driven architecture to reduce tight coupling. Apply circuit breakers and retries for fault tolerance.
Patterns in ShopNest should solve a real pain (swappable payments, test seams)—not be added for decoration.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Interfaces define contracts with no implementation, supporting ISP and DIP by allowing flexible implementations. Abstract classes provide a base implementation and shared code, useful for Template Method pattern and partial abstraction.
Interfaces define contracts with no implementation, supporting ISP and DIP by allowing flexible implementations. Abstract classes provide a base implementation and shared code, useful for Template Method pattern and partial abstraction.
Open/Closed in ShopNest: add a new payment method by adding a class, not by editing a giant switch in CheckoutService.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Builder separates complex object construction from its representation. For example, building an HttpRequest with optional headers, query params, and body: public class HttpRequestBuilder
{
private HttpRequestMessage _request = new HttpRequestMessage();
public HttpRequestBuilder SetMethod(HttpMethod method)
{
_request.Method = method;
return this;
}
public HttpRequestBuilder AddHeader(string key, string value)
{ _request.Headers.Add(key, value); return this;
}
public HttpRequestMessage Build() => _request;
} Allows building requests step-by-step fluently.
Design Patterns & SOLID Design Patterns in C# · SOLID
Short answer: Observer supports SRP by separating notification logic from core business logic and DIP by depending on abstractions (observers). It fits DI because observers can be injected, allowing flexible runtime subscriptions and loose coupling.
ShopNest payment fees use Strategy: IFeeCalculator with UPI/Card implementations chosen at runtime.