📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

EF Core Fundamentals

DbContext, DbSet, entities, model configuration, migrations, relationships, keys and foreign keys, shadow properties, value converters, owned entities, complex types and backing fields in EF Core 10.

  1. How does EF Core decide which SQL to run for SaveChanges, and in what order?
    Beginner Theory EF Core Fundamentals
  2. How do you set model-wide defaults in EF Core, such as decimal precision or string length for every property?
    Junior Theory EF Core Fundamentals
  3. Why is nvarchar(max) a problem for indexing and performance in SQL Server?
    Junior Theory EF Core Fundamentals
  4. SQL Server rejects your migration with 'may cause cycles or multiple cascade paths'. What does it mean and how do you fix it?
    Intermediate Theory EF Core Fundamentals
  5. When should a many-to-many relationship use an explicit join entity instead of skip navigations?
    Intermediate Theory EF Core Fundamentals
  6. What is an EF Core migration bundle and when would you use it instead of a SQL script?
    Junior Theory EF Core Fundamentals
  7. What is the HiLo pattern in EF Core and what trade-offs does it bring?
    Mid-Level Theory EF Core Fundamentals
  8. Why is a random GUID a poor clustered index key in SQL Server, and how would you measure the damage?
    Mid-Level Theory EF Core Fundamentals
  9. How do you set audit columns like CreatedAt and CreatedBy automatically in EF Core?
    Mid-Level Theory EF Core Fundamentals
  10. How does EF Core materialise an entity that has private setters and no public parameterless constructor?
    Mid-Level Theory EF Core Fundamentals
  11. When does EF Core need a ValueComparer, and what goes wrong without one?
    Mid-Level Coding EF Core Fundamentals
  12. Why would you model Money as a complex type rather than with a value converter in EF Core?
    Mid-Level Coding EF Core Fundamentals
  13. When would you store data in a JSON column with EF Core instead of separate tables, and how do you index it on SQL Server?
    Mid-Level Theory EF Core Fundamentals
  14. How do you rename a column with zero downtime when the old and new app versions run at the same time?
    Mid-Level Debugging EF Core Fundamentals
  15. How do you connect EF Core to Azure SQL without a password in the connection string?
    Senior CodeReview EF Core Fundamentals
  16. What is Entity Framework Core? Explain what DbContext, DbSet and entities are, how a LINQ query becomes SQL, and when you would choose Dapper or plain ADO.NET instead.

    Covers what EF Core is, the roles of DbContext, DbSet and entity classes, the LINQ-to-SQL translation pipeline, and how to choose between EF Core, Dapper and ADO.NET.

    Beginner Theory EF Core Fundamentals Β· πŸ”— 3 follow-ups
  17. How do you configure an EF Core model? Explain conventions, data annotations and the Fluent API with IEntityTypeConfiguration<T>, and how you set required properties and maximum lengths.

    Covers EF Core model building: conventions, data annotations versus the Fluent API, IEntityTypeConfiguration<T>, ApplyConfigurationsFromAssembly, required and max length, and how nullable reference types affect the schema.

    Junior Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups
  18. How do you model relationships in EF Core? Explain one-to-many, one-to-one and many-to-many with skip navigations, required versus optional relationships, and the cascade delete behaviours you can choose.

    Covers EF Core relationship mapping: principal and dependent, foreign keys and navigations, one-to-many, one-to-one, many-to-many with skip navigations and payload join entities, required versus optional, and DeleteBehavior options.

    Intermediate Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups
  19. How do EF Core migrations work? Explain how you add, script and apply a migration, what the model snapshot is for, what a migration file contains, and how a team handles migration merge conflicts.

    Covers the EF Core migrations workflow: migrations add, script and update, the Up/Down methods and Designer file, the ModelSnapshot, the __EFMigrationsHistory table, idempotent scripts and resolving migration conflicts between branches.

    Junior Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups
  20. How do you choose primary keys in EF Core on SQL Server? Compare identity integers with GUIDs (random, sequential and Guid.CreateVersion7()), and explain composite keys, alternate keys, sequences and HiLo.

    Covers key strategies in EF Core on SQL Server: identity columns, random versus sequential GUIDs and Version 7 GUIDs, clustered index fragmentation, composite and alternate keys, database sequences and the HiLo pattern.

    Mid-Level Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me