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

Database Design

Normalisation (1NF to 5NF), denormalisation, primary, foreign, unique and check constraints, key choice and schema design for SQL Server and Azure SQL.

  1. How do you choose a primary key and clustered key for a SQL Server table? Compare int and bigint identity with GUIDs (NEWID, NEWSEQUENTIALID and version 7), natural versus surrogate keys, and explain what makes a good clustered index key.

    Covers surrogate versus natural keys, identity integers versus GUID variants, why SQL Server's uniqueidentifier sort order matters for v7 GUIDs, and the properties of a good clustered key (narrow, unique, static, ever-increasing).

    Mid-Level Theory Database Design Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  2. When would you denormalise a SQL Server schema, and how? Compare persisted computed columns, indexed views and reporting tables, and explain what denormalisation costs you in writes and consistency.

    Covers when denormalisation is justified and the SQL Server tools for it (persisted computed columns, indexed views, summary and reporting tables, read models), with their write, consistency and operational costs.

    Mid-Level Theory Database Design Β· πŸ”— 1 follow-ups Β· πŸ›  1 real-world
  3. How would you enforce a business rule that spans two tables in SQL Server, such as uniqueness across a join?
    Intermediate Theory Database Design
  4. What is an untrusted constraint in SQL Server, how does it happen, and why does it matter?
    Junior Theory Database Design
  5. What is database normalisation and why does it matter? Explain insert, update and delete anomalies, and walk me through first, second and third normal form using an orders example.

    Covers the purpose of normalisation, the three data anomalies it removes, and 1NF, 2NF and 3NF applied step by step to an orders table in SQL Server.

    Beginner Theory Database Design Β· πŸ”— 2 follow-ups
  6. What do Boyce-Codd normal form, fourth normal form and fifth normal form fix that third normal form does not? Give an example of each, and tell me how much they matter in a real SQL Server schema.

    Covers BCNF (determinants that are not candidate keys), 4NF (independent multi-valued facts) and 5NF (join dependencies), with examples and their practical relevance for SQL Server OLTP design.

    Intermediate Theory Database Design Β· πŸ”— 2 follow-ups
  7. What constraints does SQL Server give you — primary key, foreign key, unique, check, default and NOT NULL — and why would you enforce business rules in the database rather than only in your .NET code?

    Covers each SQL Server constraint type, what it enforces and creates (indexes), how they help the optimiser, and why rules belong in the database as well as in application validation.

    Junior Theory Database Design Β· πŸ”— 3 follow-ups
  8. Design the schema for a small online shop in SQL Server: customers, products, orders and order lines. Write the DDL with data types, primary and foreign keys, unique and check constraints and the indexes you would add on day one, and explain each choice.

    A T-SQL design exercise: DDL for customers, products, orders and order lines with deliberate type choices, named constraints, foreign key indexes, a rowversion and the first query-driven indexes, explained as an interviewer expects.

    Mid-Level Sql Database Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Deleting old customers from a SQL Server database has become very slow, and while the delete job runs other sessions are blocked. The tables have foreign keys, some created WITH NOCHECK years ago. How do you diagnose and fix it?

    A debugging scenario covering unindexed foreign keys that force child-table scans during parent deletes, lock escalation from large deletes, cascades, and untrusted constraints (WITH NOCHECK) that stop the optimiser using them.

    Senior Debugging Database Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  10. Code review: a pull request adds SQL Server tables where every string is nvarchar(max), there are no foreign keys, product attributes go in an entity-attribute-value table, order tags are stored as comma-separated ids in one column, and dates and prices use datetime and money. What do you flag, in what order, and what does the fixed design look like?

    A senior code review of a SQL Server table design: nvarchar(max) keys, missing foreign keys, an EAV table, comma-separated values, datetime and money, ranked by severity with a rewrite and review close-out.

    Senior CodeReview Database Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. Your SQL Server database is heading towards several terabytes and many tenants. How would you design it to scale? Discuss table partitioning, archiving old data, multi-tenant database layouts, and choosing between Azure SQL Hyperscale and elastic pools.

    A staff-level architecture question on scaling SQL Server and Azure SQL: partitioning (and what it does not do), archiving with partition switching, tenant layouts, Hyperscale versus elastic pools, read scale-out and sharding.

    Staff / Architect Architecture Database Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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