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.
Clustered, non-clustered, covering, composite, filtered and columnstore indexes, included columns, selectivity, fragmentation, fill factor and SARGability in SQL Server.
Covers how SqlParameterCollection.AddWithValue infers nvarchar with the value's length, why that creates one cached plan per length and implicit conversions on varchar columns, and how to detect and fix it.
Covers the B+ tree layout of SQL Server rowstore indexes, clustered indexes as the table itself, heaps and RIDs, non-clustered indexes and their row locators, and how seeks and lookups find a row.
Covers how a composite B+ tree index is sorted, the leftmost-prefix rule, equality-then-range column ordering, which predicates give seeks versus scans, and when to create a second index instead.
Covers key lookups and RID lookups, covering indexes, INCLUDE versus key columns, the tipping point where the optimiser switches to a scan, and the write and storage cost of covering.
Covers filtered index syntax and use cases (soft delete, sparse status values, optional unique keys), why parameterised queries often cannot use them, the required SET options, filter predicate limits and filtered statistics.
Covers columnstore storage (rowgroups, column segments, compression, segment elimination), the delta store and tuple mover, batch mode execution, clustered versus non-clustered columnstore, real-time operational analytics and the trade-offs.
Covers selectivity and density definitions, the statistics object (header, density vector, 200-step histogram), how estimates are derived for literals, parameters and local variables, the seek-versus-scan tipping point, and when low-selectivity indexes are still useful.
Covers page splits, logical fragmentation and low page density, fill factor trade-offs, REBUILD versus REORGANIZE (online, resumable, statistics side effects), why fixed 5%/30% thresholds are outdated on SSD storage, and a measured maintenance strategy for SQL Server and Azure SQL.
Covers what makes a predicate SARGable, the common non-sargable patterns (functions and arithmetic on columns, implicit conversions, leading wildcards, ISNULL/COALESCE, OR across columns, catch-all queries) and their rewrites, including computed columns and the CAST to date exception.
Covers how .NET strings become nvarchar parameters, why an nvarchar parameter against a varchar column converts the column and blocks seeks (collation nuances), finding it in plans and the plan cache, and fixing it with IsUnicode(false)/HasColumnType, DbString/AnsiString and typed SqlParameters.
Covers the per-index write, log, memory and blocking cost, building an index set from real query patterns, finding unused indexes with sys.dm_db_index_usage_stats and missing indexes with the missing-index DMVs and Query Store, their caveats (resets, no column-order or write-cost awareness), safe removal by disabling first, and Azure SQL automatic tuning.