Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: parameter to facilitate the state change. Explain a bit more public interface ITrafficLightState { void Change(TrafficLight light); } Each concrete state class (Red, Green, Yellow) will implement this inter…
Short answer: n update. public interface INewsPublisher { void Subscribe(IObserver observer); void Unsubscribe(IObserver observer); void Notify(string news); } n update. public interface INewsPublisher { void Subscribe(I…
Short answer: And Description() that every coffee component will implement. Explain a bit more public interface ICoffee { double Cost(); string Description(); } nd Description() that every coffee component will implement…
Short answer: When & how to use it? Explicit loading means loading related data manually, after the main entity is loaded. Use when: You need full control over what and when to load You don’t want automatic lazy load…
Short answer: The N+1 problem occurs when: 1 query loads N parent entities N additional queries load related entities (1 per parent) Example (lazy loading): foreach (var blog in context.Blogs) { Console.WriteLine(blog.Ow…
Short answer: How can lazy loading lead to it? The N+1 problem occurs when: 1 query loads N parent entities N additional queries load related entities (1 per parent) Example (lazy loading): foreach (var blog in context.B…
Short answer: By default, EF Core uses no automatic loading — it doesn’t lazy-load or eager-load relationships unless you: Use .Include() for eager loading Enable lazy loading proxies Use .Load() for explicit loading Thi…
Short answer: Projection transforms entities into custom shapes, e.g., DTOs. var projected = context.Products Example code .Select(p => new { p.Name, p.Price }); Useful for: Reducing data load. Returning only needed f…
Short answer: pplication. Pros: Decouples data access logic from business logic. Easier to mock/test. Encapsulates queries in a single place. Cons: EF Core’s DbContext already acts like a repository and unit of work. Can…
Short answer: Why use it with EF Core (pros and cons)? Repository Pattern abstracts data access logic, exposing CRUD methods to the application. Pros: Decouples data access logic from business logic. Easier to mock/test.…
Short answer: Unit of Work maintains a list of operations to be committed as a single transaction. EF Core’s DbContext implements Unit of Work, tracking changes and coordinating commits (SaveChanges()). Real-world exampl…
Short answer: A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning. Real-world example (ShopNest) ShopNest’s order service uses…
Short answer: When/why to use it? A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning. Real-world example (ShopNest) ShopNest’…
Short answer: EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead. Real-world example (ShopNest) ShopNest’s order service uses EF Core to s…
Short answer: How does EF Core handle batch operations? EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead. Real-world example (ShopNest)…
Short answer: Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records. Real-world example (ShopNest) ShopNest’s order service uses…
Short answer: Implementation strategies in EF Core? Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records. Real-world example (S…
Short answer: Assumes conflicts are rare; detects conflicts when saving. Uses concurrency tokens (e.g., timestamp or row version) to detect if data was changed by another process. Say this in the interview Define — one c…
Short answer: How to implement it? Assumes conflicts are rare; detects conflicts when saving. Uses concurrency tokens (e.g., timestamp or row version) to detect if data was changed by another process. EF Core throws DbUp…
Short answer: EF Core creates a dynamic proxy subclass of your entity at runtime. Proxy overrides virtual navigation properties to load related data on-demand. Requires navigation properties to be virtual and package Mic…
Short answer: How does the dynamic proxy work under the hood? EF Core creates a dynamic proxy subclass of your entity at runtime. Proxy overrides virtual navigation properties to load related data on-demand. Requires nav…
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps…
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps…
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps…
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps…
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: parameter to facilitate the state change.
public interface ITrafficLightState { void Change(TrafficLight light); } Each concrete state class (Red, Green, Yellow) will implement this interface, defining the specific behavior of the traffic light for that state. parameter to facilitate the state change. public interface ITrafficLightState { void Change(TrafficLight light); } Each concrete state class (Red, Green, Yellow) will implement this interface, defining the specific behavior of the traffic light for that state.
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: n update. public interface INewsPublisher { void Subscribe(IObserver observer); void Unsubscribe(IObserver observer); void Notify(string news); } n update. public interface INewsPublisher { void Subscribe(IObserver observer); void Unsubscribe(IObserver observer); void Notify(string news); } n update. public interface INewsPublisher { void… Subscribe(IObserver observer); void Unsubscribe(IObserver observer); void…
Notify(string news); } n update. public interface INewsPublisher { void Subscribe(IObserver observer); void Unsubscribe(IObserver observer); void Notify(string news); }
When order status changes, observers update email, SMS, and analytics without the Order class knowing each one.
Gang of Four Patterns Design Patterns in C# · GoF Patterns
Short answer: And Description() that every coffee component will implement.
public interface ICoffee { double Cost(); string Description(); } nd Description() that every coffee component will implement. public interface ICoffee { double Cost(); string Description(); } And Description() that every coffee component will implement. public interface ICoffee { double Cost(); string Description(); } nd Description() that every coffee component will implement. public interface ICoffee { double Cost(); string Description(); }
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: When & how to use it? Explicit loading means loading related data manually, after the main entity is loaded. Use when: You need full control over what and when to load You don’t want automatic lazy loading
var blog = context.Blogs.First(); context.Entry(blog) .Collection(b => b.Posts) .Load(); context.Entry(blog) .Reference(b => b.Owner) .Load(); ✅ Use .Reference().Load() for single navigation ✅ Use .Collection().Load() for collections
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: The N+1 problem occurs when: 1 query loads N parent entities N additional queries load related entities (1 per parent) Example (lazy loading): foreach (var blog in context.Blogs) { Console.WriteLine(blog.Owner.Name); // triggers a query for each blog } This causes N+1 queries, which can hurt performance significantly.
✅ Solution: Use eager loading with .Include() to fetch everything in one query. The N+1 problem occurs when: 1 query loads N parent entities N additional queries load related entities (1 per parent) Example (lazy loading): foreach (var blog in context.Blogs) { Console.WriteLine(blog.Owner.Name); // triggers a query for each blog } This causes N+1 queries, which can hurt performance significantly. ✅ Solution: Use eager loading with .Include() to fetch everything in one query.
Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: How can lazy loading lead to it? The N+1 problem occurs when: 1 query loads N parent entities N additional queries load related entities (1 per parent) Example (lazy loading): foreach (var blog in context.Blogs) { Console.WriteLine(blog.Owner.Name); // triggers a query for each blog } This causes N+1 queries, which can hurt performance significantly. ✅ Solution: Use eager loading with .Include() to fetch everything…
Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: By default, EF Core uses no automatic loading — it doesn’t lazy-load or eager-load relationships unless you: Use .Include() for eager loading Enable lazy loading proxies Use .Load() for explicit loading This default avoids unintended queries and promotes performance control. EF Core LINQ Queries & Querying
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: Projection transforms entities into custom shapes, e.g., DTOs. var projected = context.Products
.Select(p => new { p.Name, p.Price }); Useful for: Reducing data load. Returning only needed fields. Mapping to custom types.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: pplication. Pros: Decouples data access logic from business logic. Easier to mock/test. Encapsulates queries in a single place. Cons: EF Core’s DbContext already acts like a repository and unit of work. Can add unnecessary abstraction and boilerplate. May limit EF Core’s powerful querying features.
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: Why use it with EF Core (pros and cons)? Repository Pattern abstracts data access logic, exposing CRUD methods to the application. Pros: Decouples data access logic from business logic. Easier to mock/test. Encapsulates queries in a single place. Cons: EF Core’s DbContext already acts like a repository and unit of work. Can add unnecessary abstraction and boilerplate. May limit EF Core’s powerful querying features.
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: Unit of Work maintains a list of operations to be committed as a single transaction. EF Core’s DbContext implements Unit of Work, tracking changes and coordinating commits (SaveChanges()).
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: A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning.
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: When/why to use it? A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning.
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: EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead.
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 handle batch operations? EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead.
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: Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records.
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: Implementation strategies in EF Core? Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records.
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: Assumes conflicts are rare; detects conflicts when saving. Uses concurrency tokens (e.g., timestamp or row version) to detect if data was changed by another process.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: How to implement it? Assumes conflicts are rare; detects conflicts when saving. Uses concurrency tokens (e.g., timestamp or row version) to detect if data was changed by another process. EF Core throws DbUpdateConcurrencyException if a conflict occurs.
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: EF Core creates a dynamic proxy subclass of your entity at runtime. Proxy overrides virtual navigation properties to load related data on-demand. Requires navigation properties to be virtual and package Microsoft.EntityFrameworkCore.Proxies. Proxy intercepts access and triggers loading when property is accessed.
Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).
Entity Framework Core Entity Framework Core Tutorial · EF Core
Short answer: How does the dynamic proxy work under the hood? EF Core creates a dynamic proxy subclass of your entity at runtime. Proxy overrides virtual navigation properties to load related data on-demand. Requires navigation properties to be virtual and package Microsoft.EntityFrameworkCore.Proxies. Proxy intercepts access and triggers loading when property is accessed.
Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).
Freelancing Career & HR Interview Guide · Freelancing
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps you attract better clients and reduce income volatility.
Priya was working at TCS and needed to handle this situation: how to start freelancing. She prepared a clear plan with timelines, ownership, and expected outcomes before speaking to HR and her manager. Rahul, who had recently moved to Razorpay, reviewed her approach and helped her tighten the messaging with measurable results. Within a few weeks, Priya achieved a better career outcome while preserving strong professional relationships.
Capture major decisions in writing to avoid confusion and future disputes.
Freelancing Career & HR Interview Guide · Freelancing
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps you attract better clients and reduce income volatility.
Karan was working at Razorpay and needed to handle this situation: how to write a project proposal. She prepared a clear plan with timelines, ownership, and expected outcomes before speaking to HR and her manager. Isha, who had recently moved to PhonePe, reviewed her approach and helped her tighten the messaging with measurable results. Within a few weeks, Karan achieved a better career outcome while preserving strong professional relationships.
Capture major decisions in writing to avoid confusion and future disputes.
Freelancing Career & HR Interview Guide · Freelancing
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps you attract better clients and reduce income volatility.
Ananya was working at PhonePe and needed to handle this situation: how to create a freelance portfolio. She prepared a clear plan with timelines, ownership, and expected outcomes before speaking to HR and her manager. Vikram, who had recently moved to Infosys, reviewed her approach and helped her tighten the messaging with measurable results. Within a few weeks, Ananya achieved a better career outcome while preserving strong professional relationships.
Capture major decisions in writing to avoid confusion and future disputes.
Freelancing Career & HR Interview Guide · Freelancing
Short answer: Freelancing success depends on niche clarity, pricing discipline, and reliable delivery. Position yourself around outcomes instead of tasks, and build repeatable systems for sales and execution. This helps you attract better clients and reduce income volatility.
Meera was working at Infosys and needed to handle this situation: how to scale a freelancing business. She prepared a clear plan with timelines, ownership, and expected outcomes before speaking to HR and her manager. Rohit, who had recently moved to Freshworks, reviewed her approach and helped her tighten the messaging with measurable results. Within a few weeks, Meera achieved a better career outcome while preserving strong professional relationships.
Capture major decisions in writing to avoid confusion and future disputes.