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

Static Analysis

Roslyn analysers, SonarQube, StyleCop, EditorConfig, nullable warnings, security analysers and dependency scanning in CI.

  1. Your build has 40 analyser warnings and the team ignores them. Should you turn on TreatWarningsAsErrors tomorrow?
    Junior Theory Static Analysis
  2. Coverage on new code keeps failing the gate for DTO and EF Core migration files. What do you do?
    Intermediate Theory Static Analysis
  3. Your custom analyser works in Rider for one developer but does nothing for another on an older SDK. Why, and how do you fix it?
    Mid-Level Coding Static Analysis
  4. What is static analysis, and what does it catch that your unit tests don't? Name the main static analysis tools a .NET team uses and where each one runs.

    Covers what static analysis is, the kinds of defects it finds that tests miss, and the main .NET tools (compiler and nullable warnings, .NET SDK CA/IDE analysers, StyleCop, SonarAnalyzer, Roslynator, BannedApiAnalyzers, CodeQL) and where they run.

    Junior Theory Static Analysis Β· πŸ”— 3 follow-ups
  5. How does SonarQube (or SonarQube Cloud) fit into a .NET team's pipeline? Explain quality gates, the 'new code' focus, which edition you need for pull request analysis, and how you stop the team from gaming the metrics.

    Covers how SonarQube Server and SonarQube Cloud analyse .NET code with the scanner, how quality gates and the new-code period work, edition differences for branch and pull request analysis, coverage import, and how to avoid metric gaming.

    Intermediate Theory Static Analysis Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. Which security analysers would you run on a .NET 10 codebase in CI, and what does each kind find? Compare Roslyn security rules, CodeQL and SonarQube security analysis, secret scanning and dependency scanning, and explain how you triage false positives without letting real findings slip through.

    Covers the layers of automated security analysis for .NET (CA security rules, CodeQL taint analysis, Sonar vulnerabilities and hotspots, secret scanning, NuGetAudit and Dependabot), what each catches and misses, severity policy in CI, and a disciplined false-positive triage process.

    Mid-Level Theory Static Analysis Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. Your team keeps breaking a rule: money values must be decimal, never double. Write a small custom Roslyn analyser that enforces it, with a test. How do you package it for the team, and when would a banned-API list or an existing analyser be the better choice?

    Covers writing a custom Roslyn DiagnosticAnalyzer for a team rule (money must be decimal), the project setup (netstandard2.0, EnforceExtendedAnalyzerRules), symbol actions, testing with Microsoft.CodeAnalysis.Testing, shipping via project reference or NuGet, performance rules, and when BannedApiAnalyzers or existing rules are better.

    Mid-Level Coding Static Analysis Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. You join a team whose main .NET solution builds with about 5,000 compiler and analyser warnings, and nobody reads them any more. You're asked to make static analysis useful again without stopping feature delivery. Walk me through what you would do in the first weeks and how you would keep it from sliding back.

    Covers a real rollout plan for analysers on a legacy .NET solution with thousands of warnings: measuring and grouping warnings, deciding per rule (fix, enforce, or switch off), mechanical bulk fixes, a ratchet so the count can only fall, per-project warnings-as-errors, team agreement and progress tracking.

    Senior RealWorldScenario Static Analysis Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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