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 26–50 of 53

Career & HR topics

By tech stack

Junior PDF
How is concurrency handled? What is optimistic concurrency vs pessimistic concurrency?

Optimistic concurrency: Assumes that conflicts are rare. EF checks for changes before saving using concurrency tokens. Pessimistic concurrency: Locks records in the DB to prevent other updates (not supported out-of-the-b…

EF Core Read answer
Junior PDF
What is a concurrency token / [Timestamp] attribute?

concurrency token is a property used to detect concurrency conflicts. Example with [Timestamp]: [Timestamp] public byte[] RowVersion { get; set; } EF Core includes this column in the WHERE clause of updates. If the row h…

EF Core Read answer
Junior PDF
What are foreign keys and primary keys? How to define them via

nnotations & Fluent API? Primary Key (PK): Unique identifier of a record. Foreign Key (FK): A field that references a PK in another table. Data Annotations: [Key] public int Id { get; set; } [ForeignKey("Blog")] publ…

EF Core Read answer
Junior PDF
What is a composite key? How to define composite keys in EF Core?

Answer: composite key is a primary key made of multiple columns. EF Core does not support composite keys via data annotations, so you must use Fluent PI: modelBuilder.Entity<OrderDetail>() .HasKey(od =&…

EF Core Read answer
Junior PDF
What is cascade delete, and how can it be configured?

Cascade delete ensures that related entities are deleted when the parent entity is deleted. Configure with Fluent API: modelBuilder.Entity<Blog>() .HasMany(b => b.Posts) .WithOne(p => p.Blog) .OnDelete(Delete…

EF Core Read answer
Junior PDF
What is eager loading? How is .Include() / .ThenInclude() used?

Eager loading loads related data as part of the initial query, reducing round-trips to the database. ✅ Use .Include() to load related entities: var blogs = context.Blogs .Include(b => b.Posts) .ToList(); Use .ThenIncl…

EF Core Read answer
Junior PDF
What is eager loading?

How is .Include() / .ThenInclude() used? Eager loading loads related data as part of the initial query, reducing round-trips to the database. ✅ Use .Include() to load related entities: var blogs = context.Blogs .Include(…

EF Core Read answer
Junior PDF
What is lazy loading? How to enable lazy loading in EF Core? What

re proxies? Lazy loading delays the loading of related data until it's accessed for the first time. EF Core requires proxies for lazy loading: Install NuGet: Microsoft.EntityFrameworkCore.Proxies Enable in OnConfiguring…

EF Core Read answer
Junior PDF
What is lazy loading?

How to enable lazy loading in EF Core? What are proxies? Lazy loading delays the loading of related data until it's accessed for the first time. EF Core requires proxies for lazy loading: Install NuGet: Microsoft.EntityF…

EF Core Read answer
Junior PDF
What is explicit loading? 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 Example: var blog = context.Blogs.Fi…

EF Core Read answer
Junior PDF
What is explicit loading?

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 Example: v…

EF Core Read answer
Junior PDF
What is the N+1 query problem? 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); //…

EF Core Read answer
Junior PDF
What is the N+1 query problem?

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

EF Core Read answer
Junior PDF
What is the default loading behavior in EF Core?

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 avoi…

EF Core Read answer
Junior PDF
What is projection (Select) and why is it useful?

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…

EF Core Read answer
Junior PDF
What is the Repository Pattern? Why use it with EF Core (pros and cons)? ● Repository Pattern abstracts data access logic, exposing CRUD methods to the

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 unnecessa…

EF Core Read answer
Junior PDF
What is the Repository Pattern?

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…

EF Core Read answer
Junior PDF
What is the Unit of Work pattern? How does DbContext relate to Unit of Work?

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()). What interviewers expec…

EF Core Read answer
Junior PDF
What is a global query filter? When/why to use it?

Answer: A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning. What interviewers expect A clear definition tied to EF Core in En…

EF Core Read answer
Junior PDF
What is a global query filter?

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. What interviewers expect A clear definition t…

EF Core Read answer
Junior PDF
What is batching? How does EF Core handle batch operations?

Answer: EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead. What interviewers expect A clear definition tied to EF Core in Entity Framewor…

EF Core Read answer
Junior PDF
What is batching?

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. What interviewers expect A clear def…

EF Core Read answer
Junior PDF
What is soft delete? Implementation strategies in EF Core?

Answer: Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records. What interviewers expect A clear definition tied to EF Core in En…

EF Core Read answer
Junior PDF
What is soft delete?

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. What interviewers expect A…

EF Core Read answer
Junior PDF
What is optimistic concurrency? How to implement it?

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. EF Core throws DbUpdateConcurrencyException if…

EF Core Read answer

Entity Framework Core Entity Framework Core Tutorial · EF Core

  • Optimistic concurrency: Assumes that conflicts are rare. EF checks for changes

before saving using concurrency tokens.

  • Pessimistic concurrency: Locks records in the DB to prevent other updates (not

supported out-of-the-box in EF Core).

EF Core supports optimistic concurrency using [ConcurrencyCheck] or

[Timestamp].

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

concurrency token is a property used to detect concurrency conflicts.

Example with [Timestamp]:

[Timestamp]

public byte[] RowVersion { get; set; }
  • EF Core includes this column in the WHERE clause of updates.
  • If the row has changed since it was loaded, EF will throw a

DbUpdateConcurrencyException.

Entity Framework Core – Relationships

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

nnotations & Fluent API?

  • Primary Key (PK): Unique identifier of a record.
  • Foreign Key (FK): A field that references a PK in another table.

Data Annotations:

[Key]

public int Id { get; set; }

[ForeignKey("Blog")]

public int BlogId { get; set; }

Fluent API:

modelBuilder.Entity<Post>()

.HasKey(p => p.Id);

modelBuilder.Entity<Post>()

.HasOne(p => p.Blog)

.WithMany(b => b.Posts)

.HasForeignKey(p => p.BlogId);
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: composite key is a primary key made of multiple columns. EF Core does not support composite keys via data annotations, so you must use Fluent PI: modelBuilder.Entity&lt;OrderDetail&gt;() .HasKey(od =&gt; new { od.OrderId, od.ProductId });

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Cascade delete ensures that related entities are deleted when the parent entity is deleted.

Configure with Fluent API:

modelBuilder.Entity<Blog>()

.HasMany(b => b.Posts)

.WithOne(p => p.Blog)

.OnDelete(DeleteBehavior.Cascade);

Delete behaviors:

  • Cascade
  • Restrict
  • SetNull
  • NoAction

EF Core defaults to Cascade for required relationships.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Eager loading loads related data as part of the initial query, reducing round-trips to the

database.

✅ Use .Include() to load related entities:

var blogs = context.Blogs

.Include(b => b.Posts)

.ToList();

Use .ThenInclude() for deeper nesting:

context.Blogs

.Include(b => b.Posts)

.ThenInclude(p => p.Comments);

Eager loading prevents lazy load performance issues and the N+1 problem.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

How is .Include() / .ThenInclude()

used?

Eager loading loads related data as part of the initial query, reducing round-trips to the

database.

✅ Use .Include() to load related entities:

var blogs = context.Blogs

.Include(b => b.Posts)

.ToList();

Use .ThenInclude() for deeper nesting:

context.Blogs

.Include(b => b.Posts)

.ThenInclude(p => p.Comments);

Eager loading prevents lazy load performance issues and the N+1 problem.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

re proxies?

Lazy loading delays the loading of related data until it's accessed for the first time.

EF Core requires proxies for lazy loading:

Install NuGet:

Microsoft.EntityFrameworkCore.Proxies

  • Enable in OnConfiguring or AddDbContext:

options.UseLazyLoadingProxies();

  • Mark navigation properties as virtual:
public virtual ICollection<Post> Posts { get; set; }
  • EF creates runtime proxies to override navigation properties and load them when

ccessed.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

How to enable lazy loading in EF Core? What

are proxies?

Lazy loading delays the loading of related data until it's accessed for the first time.

EF Core requires proxies for lazy loading:

Install NuGet:

Microsoft.EntityFrameworkCore.Proxies

Enable in OnConfiguring or AddDbContext:

options.UseLazyLoadingProxies();

Mark navigation properties as virtual:

public virtual ICollection<Post> Posts { get; set; }

EF creates runtime proxies to override navigation properties and load them when

accessed.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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

Example:

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

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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

Example:

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

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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 in one query.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: Projection transforms entities into custom shapes, e.g., DTOs. var projected = context.Products .Select(p =&gt; new { p.Name, p.Price }); Useful for: Reducing data load. Returning only needed fields. Mapping to custom types.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

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()).

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: A filter automatically applied to all queries on an entity. Useful for soft deletes, multi-tenancy (filtering by tenant ID), or data partitioning.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: EF Core batches multiple commands into a single database round trip when possible. Improves performance by reducing network overhead.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: Mark entities as deleted without physically removing them. Implemented using a boolean flag and global query filters to exclude “deleted” records.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

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.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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

Entity Framework Core Entity Framework Core Tutorial · EF Core

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. EF Core throws DbUpdateConcurrencyException if a conflict occurs.

What interviewers expect

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

Real-world example

In a production Entity Framework Core 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 Entity Framework Core 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