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 100

Career & HR topics

By tech stack

Mid PDF
What are the main differences between Entity Framework (EF6) and EF Core?

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

EF Core Read answer
Mid PDF
What are entities and how do they map to tables? Entities are .NET classes that represent database tables. Each property in the entity maps to

column. EF Core uses conventions or Fluent API to configure the mappings. What interviewers expect A clear definition tied to EF Core in Entity Framework Core projects Trade-offs (performance, maintainability, security,…

EF Core Read answer
Mid PDF
What are entities and how do they map to tables?

Answer: Entities are .NET classes that represent database tables. Each property in the entity maps to a column. EF Core uses conventions or Fluent API to configure the mappings. What interviewers expect A clear definitio…

EF Core Read answer
Mid PDF
What are scalar properties, complex properties, and shadow properties?

Answer: Scalar: Simple types like int, string, DateTime Complex: Nested objects mapped to multiple columns (Value objects) Shadow: Properties not defined in the .NET class but tracked by EF Core What interviewers expect…

EF Core Read answer
Mid PDF
What are the benefits of using EF Core?

Answer: Productivity via abstraction from SQL Cross-platform support Strongly-typed LINQ queries Migration support Tracks changes automatically Works well with dependency injection What interviewers expect A clear defini…

EF Core Read answer
Mid PDF
What are some disadvantages / pitfalls of using EF Core?

May generate inefficient SQL for complex queries Learning curve for advanced features Less control over fine-tuned SQL performance Not ideal for high-performance bulk operations Entity Framework Core – Schema Design &amp…

EF Core Read answer
Mid PDF
How do you reverse engineer a database in EF Core (DB First) into entity classes & DbContext?

Use the CLI or Package Manager Console: dotnet ef dbcontext scaffold "YourConnectionString" Microsoft.EntityFrameworkCore.SqlServer -o Models OR Scaffold-DbContext "YourConnectionString" Microsoft.EntityFrameworkCore.Sql…

EF Core Read answer
Mid PDF
How does Code First handle schema changes in the database?

EF Core uses migrations to track and apply schema changes: You modify your C# models. Use Add-Migration to create a migration class. Use Update-Database to apply the changes to the DB. EF Core compares the model to the c…

EF Core Read answer
Mid PDF
How do you configure mappings (table names, column names, keys) using Data Annotations vs Fluent API?

🧩 Data Annotations (in the entity class): [Table("Users")] public class User { [Key] public int Id { get; set; } [Column("UserName")] public string Name { get; set; } } 🧠 Fluent API (in OnModelCreating): modelBuilder.E…

EF Core Read answer
Mid PDF
What are migrations? How are they used in Code First?

Migrations in EF Core are a way to: Track schema changes over time Apply those changes to the database 📦 Basic commands: Add-Migration MigrationName Update-Database Remove-Migration Script-Migration 🔄 Migrations are cl…

EF Core Read answer
Mid PDF
What are migrations?

How are they used in Code First? Migrations in EF Core are a way to: Track schema changes over time Apply those changes to the database 📦 Basic commands: Add-Migration MigrationName Update-Database Remove-Migration Scri…

EF Core Read answer
Mid PDF
How do you create a migration? (e.g. Add-Migration) Use one of the following commands: .NET CLI: dotnet ef migrations add MigrationName ● Package Manager Console:

Answer: dd-Migration MigrationName This creates a migration file with Up() and Down() methods, and a snapshot of the current model. What interviewers expect A clear definition tied to EF Core in Entity Framework Core pro…

EF Core Read answer
Mid PDF
How do you create a migration?

(e.g. Add-Migration) Use one of the following commands: .NET CLI: dotnet ef migrations add MigrationName Package Manager Console: Add-Migration MigrationName This creates a migration file with Up() and Down() methods, an…

EF Core Read answer
Mid PDF
How to apply migrations to the database? (e.g. Update-Database)

Answer: pply the migration to your database using: .NET CLI: dotnet ef database update Package Manager Console: Update-Database EF Core translates your model changes into SQL and executes them against the database. What…

EF Core Read answer
Mid PDF
How to apply migrations to the database?

Answer: (e.g. Update-Database) Apply the migration to your database using: .NET CLI: dotnet ef database update Package Manager Console: Update-Database EF Core translates your model changes into SQL and executes them aga…

EF Core Read answer
Mid PDF
How do you rollback or revert a migration?

Answer: To remove the last migration before applying it: dotnet ef migrations remove To rollback the database to a previous migration: dotnet ef database update MigrationName To rollback all migrations: dotnet ef databas…

EF Core Read answer
Mid PDF
What are migration scripts? How to generate SQL scripts for migrations?

Answer: Generate SQL script using: dotnet ef migrations script To script a specific range: dotnet ef migrations script FromMigration ToMigration These scripts are useful for deploying to production environments or execut…

EF Core Read answer
Mid PDF
What are migration scripts?

How to generate SQL scripts for migrations? Generate SQL script using: dotnet ef migrations script To script a specific range: dotnet ef migrations script FromMigration ToMigration These scripts are useful for deploying…

EF Core Read answer
Mid PDF
How do you seed initial data using migrations / EF Core configuration?

Answer: Use the HasData() method in OnModelCreating(): modelBuilder.Entity<User>().HasData( new User { Id = 1, Name = "Admin" } ); Data is inserted automatically during Update-Database. Changes to seed data…

EF Core Read answer
Mid PDF
How do you handle conflicts in migrations (e.g. when team members make schema changes)?

Best practices: Communicate and coordinate migration changes. Always pull and apply the latest migrations before adding a new one. If conflicts arise: Resolve merge conflicts in migration files manually. Rebuild ModelSna…

EF Core Read answer
Mid PDF
How to handle migrations in production / CI/CD pipelines?

Generate SQL script from tested migrations. Manually review and apply via DBA or DevOps tools. Use EF Core tools in CI/CD (e.g., GitHub Actions, Azure DevOps): dotnet ef database update --no-build ● Always backup the dat…

EF Core Read answer
Mid PDF
What are scaffolded migrations?

Answer: Scaffolded migrations are the automatically generated classes that contain Up() and Down() methods. They are generated based on model differences. You can manually edit these files to: Add custom SQL Rename colum…

EF Core Read answer
Mid PDF
How can you customize migrations (e.g. modify Up/Down methods, custom SQL)?

You can manually edit migration files after scaffolding: protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.Sql("UPDATE Users SET IsActive = 1 WHERE IsActive IS NULL"); } Add indexes, constr…

EF Core Read answer
Mid PDF
What are the different entity states? EF Core uses these EntityState values: State Description

dded New entity to be inserted into the database Modified Entity has been changed and will be updated Deleted Entity will be deleted from the database Detached Entity is not tracked by the context Unchange No changes hav…

EF Core Read answer
Mid PDF
What are the different entity states?

EF Core uses these EntityState values: State Description Added New entity to be inserted into the database Modified Entity has been changed and will be updated Deleted Entity will be deleted from the database Detached En…

EF Core Read answer

Entity Framework Core Entity Framework Core Tutorial · EF Core

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

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

column. EF Core uses conventions or Fluent API to configure the mappings.

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: Entities are .NET classes that represent database tables. Each property in the entity maps to a column. EF Core uses conventions or Fluent API to configure the mappings.

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: Scalar: Simple types like int, string, DateTime Complex: Nested objects mapped to multiple columns (Value objects) Shadow: Properties not defined in the .NET class but tracked by EF Core

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: Productivity via abstraction from SQL Cross-platform support Strongly-typed LINQ queries Migration support Tracks changes automatically Works well with dependency injection

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

  • May generate inefficient SQL for complex queries
  • Learning curve for advanced features
  • Less control over fine-tuned SQL performance
  • Not ideal for high-performance bulk operations

Entity Framework Core – Schema Design &

Migrations Interview Questions

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Use the CLI or Package Manager Console:

dotnet ef dbcontext scaffold "YourConnectionString"

Microsoft.EntityFrameworkCore.SqlServer -o Models

OR

Scaffold-DbContext "YourConnectionString"

Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

✅ It generates:

  • Entity classes
  • DbContext class
  • Mappings based on database schema
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

EF Core uses migrations to track and apply schema changes:

  • You modify your C# models.
  • Use Add-Migration to create a migration class.
  • Use Update-Database to apply the changes to the DB.

EF Core compares the model to the current schema to generate SQL.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

🧩 Data Annotations (in the entity class):

[Table("Users")]

public class User
{

[Key]

public int Id { get; set; }

[Column("UserName")]

public string Name { get; set; }
}

🧠 Fluent API (in OnModelCreating):

modelBuilder.Entity<User>()

.ToTable("Users")

.HasKey(u => u.Id);

modelBuilder.Entity<User>()

.Property(u => u.Name)

.HasColumnName("UserName");

📌 Fluent API is more powerful and flexible, preferred for complex configurations.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Migrations in EF Core are a way to:

  • Track schema changes over time
  • Apply those changes to the database

📦 Basic commands:

  • Add-Migration MigrationName
  • Update-Database
  • Remove-Migration
  • Script-Migration

🔄 Migrations are classes containing Up() and Down() methods (for applying and reverting

changes).

📌 They are essential for schema versioning in Code First.

Entity Framework Core – Migrations

Interview Questions
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

How are they used in Code First?

Migrations in EF Core are a way to:

  • Track schema changes over time
  • Apply those changes to the database

📦 Basic commands:

  • Add-Migration MigrationName
  • Update-Database
  • Remove-Migration
  • Script-Migration

🔄 Migrations are classes containing Up() and Down() methods (for applying and reverting

changes).

📌 They are essential for schema versioning in Code First.

Entity Framework Core – Migrations

Interview Questions

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: dd-Migration MigrationName This creates a migration file with Up() and Down() methods, and a snapshot of the current model.

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

(e.g. Add-Migration)

Use one of the following commands:

.NET CLI:

dotnet ef migrations add MigrationName

Package Manager Console:

Add-Migration MigrationName

This creates a migration file with Up() and Down() methods, and a snapshot of the current

model.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: pply the migration to your database using: .NET CLI: dotnet ef database update Package Manager Console: Update-Database EF Core translates your model changes into SQL and executes them against the database.

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: (e.g. Update-Database) Apply the migration to your database using: .NET CLI: dotnet ef database update Package Manager Console: Update-Database EF Core translates your model changes into SQL and executes them against the database.

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: To remove the last migration before applying it: dotnet ef migrations remove To rollback the database to a previous migration: dotnet ef database update MigrationName To rollback all migrations: dotnet ef database update 0

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: Generate SQL script using: dotnet ef migrations script To script a specific range: dotnet ef migrations script FromMigration ToMigration These scripts are useful for deploying to production environments or executing via CI/CD pipelines.

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

How to generate SQL scripts for

migrations?

Generate SQL script using:

dotnet ef migrations script

To script a specific range:

dotnet ef migrations script FromMigration ToMigration

These scripts are useful for deploying to production environments or executing via CI/CD

pipelines.

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: Use the HasData() method in OnModelCreating(): modelBuilder.Entity&lt;User&gt;().HasData( new User { Id = 1, Name = "Admin" } ); Data is inserted automatically during Update-Database. Changes to seed data require a new migration.

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

Best practices:

  • Communicate and coordinate migration changes.
  • Always pull and apply the latest migrations before adding a new one.
  • If conflicts arise:
  • Resolve merge conflicts in migration files manually.
  • Rebuild ModelSnapshot as needed.
  • Consider squashing or reorganizing migrations.
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

  • Generate SQL script from tested migrations.
  • Manually review and apply via DBA or DevOps tools.

Use EF Core tools in CI/CD (e.g., GitHub Actions, Azure DevOps):

dotnet ef database update --no-build

  • ● Always backup the database before applying migrations in production.
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

Answer: Scaffolded migrations are the automatically generated classes that contain Up() and Down() methods. They are generated based on model differences. You can manually edit these files to: Add custom SQL Rename columns Seed data, etc.

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

You can manually edit migration files after scaffolding:

protected override void Up(MigrationBuilder migrationBuilder)

{

migrationBuilder.Sql("UPDATE Users SET IsActive = 1 WHERE

IsActive IS NULL");

}
  • Add indexes, constraints, stored procedures.
  • Use raw SQL or Fluent API.
  • Be cautious to maintain idempotency and correctness.

Entity Framework Core – Change

Tracking & Concurrency

Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

dded New entity to be inserted into the database

Modified Entity has been changed and will be updated

Deleted Entity will be deleted from the database

Detached Entity is not tracked by the context

Unchange

No changes have been made since it was

loaded

You can check/set the state via:

context.Entry(entity).State = EntityState.Modified;
Permalink & share

Entity Framework Core Entity Framework Core Tutorial · EF Core

EF Core uses these EntityState values:

State Description

Added New entity to be inserted into the database

Modified Entity has been changed and will be updated

Deleted Entity will be deleted from the database

Detached Entity is not tracked by the context

Unchange

No changes have been made since it was

loaded

You can check/set the state via:

context.Entry(entity).State = EntityState.Modified;

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