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

Web Basics

How the browser works for a backend engineer: HTML, CSS, JavaScript and TypeScript, rendering and the DOM, the Fetch API, CORS, cookies, localStorage and sessionStorage.

  1. What are Web Workers, and when would you move JavaScript work off the main thread?
    Beginner Theory Web Basics
  2. What is the difference between DOMContentLoaded and the load event, and which should page scripts wait for?
    Beginner Theory Web Basics
  3. How do you keep TypeScript types in sync with an ASP.NET Core API's contracts?
    Junior Theory Web Basics
  4. When would you add retries to frontend API calls, and which requests must never be retried automatically?
    Junior Coding Web Basics
  5. You're a backend engineer and someone asks: what actually happens in the browser after your ASP.NET Core server sends back an HTML page? Explain how the browser turns HTML, CSS and JavaScript into pixels: parsing, the DOM and CSSOM, layout and paint, and how the JavaScript event loop decides when your code runs.

    How a browser parses HTML into the DOM, CSS into the CSSOM, runs layout, paint and compositing, how scripts block parsing, and how the single-threaded event loop with tasks and microtasks schedules JavaScript.

    Beginner Theory Web Basics Β· πŸ”— 3 follow-ups
  6. You're a C# developer joining a team with a TypeScript frontend. How do JavaScript and TypeScript compare with C#? Explain TypeScript's structural type system and type erasure, how async/await and promises differ from Task, how ES modules work, and the traps a C# developer usually falls into.

    Compares JavaScript and TypeScript with C#: dynamic vs static typing, structural typing and type erasure, null vs undefined, equality, promises vs Task, ES modules and npm, and common traps for C# developers.

    Junior Theory Web Basics Β· πŸ”— 2 follow-ups
  7. Show me how you call an ASP.NET Core Minimal API from the browser with fetch. Load and create items as JSON, handle HTTP errors properly (fetch doesn't throw on 404 or 500), read a ProblemDetails validation response, and cancel the request with AbortController when the user navigates away or types again.

    Writing a typed fetch wrapper in TypeScript against an ASP.NET Core Minimal API: JSON requests, checking response.ok, parsing ProblemDetails and ValidationProblemDetails, timeouts and cancellation with AbortController and AbortSignal, and how the server sees the cancellation.

    Junior Coding Web Basics Β· πŸ”— 3 follow-ups
  8. Explain CORS from the browser's point of view. What is the same-origin policy protecting, what makes a request "simple" versus preflighted, what happens during an OPTIONS preflight, how do credentials and exposed headers change the rules, and why is it the server's response that decides whether the browser lets your JavaScript read the result?

    How the browser enforces the same-origin policy and CORS: what an origin is, simple vs preflighted requests, the OPTIONS preflight and its headers, credentialed requests, Access-Control-Expose-Headers, preflight caching, and how ASP.NET Core's CORS middleware answers.

    Intermediate Theory Web Basics Β· πŸ”— 3 follow-ups
  9. Where should a web app keep data in the browser? Compare cookies, localStorage and sessionStorage on scope, lifetime, size, whether they're sent to the server automatically and whether JavaScript can read them. Explain the HttpOnly, Secure, SameSite, Domain and Path attributes, and say what each storage option is and isn't safe for.

    Compares cookies, localStorage, sessionStorage (and briefly IndexedDB) on scope, lifetime, size limits, automatic sending, JavaScript access and XSS/CSRF exposure, covers cookie attributes and the __Host- prefix, and maps each to safe uses such as session cookies, preferences and drafts.

    Intermediate Theory Web Basics Β· πŸ”— 3 follow-ups
  10. Your API works perfectly in Postman, and CORS is already configured, but in the browser things still break: the login call returns 200 yet every following request is 401 because the cookie never comes back, and in production some calls fail with "mixed content" while others show stale data. How do you use the browser dev tools to find out what's really happening, and how do you fix each cause?

    Diagnosing browser-only API failures beyond CORS with DevTools: cookies not stored or not sent (SameSite, Secure, Domain, credentials mode, third-party blocking), mixed content, HTTP caching and service workers serving stale data, and what Postman does differently from a browser.

    Mid-Level Debugging Web Basics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. The frontend team says the site is slow, but your API responds in 80 ms. As the backend engineer, what can you actually change to improve frontend performance? Talk about payload size, compression, HTTP caching headers and ETags, CDNs, HTTP/2 and HTTP/3, and how Core Web Vitals (LCP, INP, CLS) tell you whether it worked.

    Backend levers for frontend performance: response size and shape, Brotli/gzip compression, Cache-Control, ETag and immutable hashed assets, output caching, CDNs such as Azure Front Door, HTTP/2 and HTTP/3, early hints and preload, and measuring with Core Web Vitals (LCP, INP, CLS) and real-user monitoring.

    Mid-Level Theory Web Basics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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