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.
Transactions, raw SQL, interceptors, compiled queries, global query filters, temporal tables, JSON columns, table splitting, TPH, TPT and TPC, concurrency tokens and RowVersion, bulk operations, query tags and execution strategies.
Covers EF Core transactions: the implicit SaveChanges transaction and AutoTransactionBehavior, explicit BeginTransaction and UseTransaction, automatic and manual savepoints, TransactionScope pitfalls (Serializable default, async flow, no distributed transactions on Azure SQL) and wrapping explicit transactions in the execution strategy.
Covers EF Core raw SQL APIs (FromSql/FromSqlInterpolated, FromSqlRaw, SqlQuery and SqlQueryRaw, ExecuteSql and ExecuteSqlRaw), how interpolated strings become parameters, the injection traps with FromSqlRaw and dynamic identifiers, the EF1002 analyser, and composing LINQ over composable SQL versus stored procedures.
Covers EF Core interceptors: IDbCommandInterceptor, ISaveChangesInterceptor, IDbConnectionInterceptor, IMaterializationInterceptor and IQueryExpressionInterceptor; registration with AddInterceptors and DI; lifetime with pooling; suppression results; real uses (audit columns, soft delete, slow-query logging, query hints, Entra ID tokens) and the fact that ExecuteUpdate/ExecuteDelete bypass SaveChanges interceptors.
Covers EF Core global query filters: HasQueryFilter, how filters are added to every LINQ query (including Include, Find and ExecuteUpdate), parameterising them through DbContext members, IgnoreQueryFilters, EF Core 10 named filters, the required-navigation INNER JOIN pitfall (warning 10622), one filter per hierarchy root and indexing for filtered columns.
Covers SQL Server system-versioned temporal tables in EF Core 6+: IsTemporal configuration, period columns as shadow properties, migrations, the TemporalAsOf/All/FromTo/Between/ContainedIn operators, restoring deleted rows, what temporal tables don't record (who changed it), history growth and retention, and alternatives such as audit tables and ledger tables.
Covers EF Core JSON mapping: ToJson on owned types (EF Core 7+) and complex types (EF Core 10), primitive collections, translation to JSON_VALUE/OPENJSON, partial updates with JSON_MODIFY, the native json data type used with Azure SQL and SQL Server 2025 (compatibility level 170), indexing through computed columns, ExecuteUpdate on JSON properties, and the design trade-offs versus normalised tables.
Covers EF Core inheritance mapping strategies: table-per-hierarchy with a discriminator (default), table-per-type (EF Core 5+) and table-per-concrete-type (EF Core 7+); generated SQL for polymorphic and leaf queries (single table, JOINs, UNION ALL); key generation across TPC tables with sequences; foreign keys to the base type; nullability and constraint trade-offs; and how to choose.
Covers EF Core optimistic concurrency: [Timestamp]/IsRowVersion on SQL Server rowversion, app-managed concurrency tokens with IsConcurrencyToken, the UPDATE ... WHERE RowVersion = @original pattern, setting OriginalValue from the client, DbUpdateConcurrencyException with GetDatabaseValuesAsync and store-wins/client-wins/merge resolution, concurrency with ExecuteUpdate, and mapping to 409 or ETag/If-Match with 412.
Covers bulk data changes with EF Core 10: set-based ExecuteUpdateAsync/ExecuteDeleteAsync (EF Core 7+, delegate setters in EF Core 10), SaveChanges batching and MaxBatchSize for AddRange, SqlBulkCopy and table-valued parameters, third-party libraries and their licensing, and the consequences of bypassing the change tracker (stale tracked entities, no SaveChanges interceptors, no automatic concurrency checks, cascade and trigger behaviour).
Covers inspecting EF Core SQL: ToQueryString, simple logging with LogTo and event filters, the Microsoft.EntityFrameworkCore.Database.Command log category, query tags with TagWith and TagWithCallSite, EnableSensitiveDataLogging and EnableDetailedErrors and their privacy risks, dependency tracking in Application Insights and OpenTelemetry, and finding tagged queries in SQL Server.
Covers diagnosing transient Azure SQL failures with EF Core: transient error numbers and reconfiguration events, SqlServerRetryingExecutionStrategy and its defaults, the user-initiated transaction error and wrapping work in CreateExecutionStrategy().ExecuteAsync, idempotency and commit-in-doubt with ExecuteInTransactionAsync, connection resiliency in Microsoft.Data.SqlClient, and telemetry for retries.