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

Phase 26 — Frontend Awareness for .NET Engineers

What a senior .NET engineer needs to know about the frontend: web basics and the browser, integrating SPAs (React, Angular) securely with ASP.NET Core APIs, and building UIs with Blazor in .NET 10.

  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
  12. When would you use TanStack Query instead of fetching in useEffect, and what does it give you?
    Junior Theory SPA Integration
  13. What are Angular signals, and how do they change change detection compared with zone.js?
    Junior Theory SPA Integration
  14. How would you stop a double-submitted create from producing two records, even if the client disables the button?
    Mid-Level Coding SPA Integration
  15. How do you evolve an API without breaking existing clients, and when do you introduce a new version?
    Mid-Level Theory SPA Integration
  16. You're a .NET developer joining a team with a React frontend. Explain React's core ideas: components, props, state and hooks (useState, useEffect), how rendering and re-rendering work, and how a React app typically loads and saves data through an ASP.NET Core API.

    React fundamentals for a backend .NET developer: function components, props vs state, the useState and useEffect hooks, the render cycle, and the usual patterns for calling an ASP.NET Core API.

    Junior Theory SPA Integration Β· πŸ”— 3 follow-ups
  17. What are the building blocks of an Angular application: components, templates and data binding, services, dependency injection, HttpClient and signals? How does Angular call an ASP.NET Core API, and how does it compare with React for a .NET team?

    Angular fundamentals for a .NET developer: standalone components, templates and binding, services and hierarchical DI, HttpClient with interceptors, signals and zoneless change detection, and a comparison with React.

    Junior Theory SPA Integration Β· πŸ”— 3 follow-ups
  18. Build a small React + TypeScript screen against an ASP.NET Core Minimal API: list products, create a new one with a form, and show the server's validation errors next to the right fields. Walk me through the endpoint, the typed client code, loading and error states, and how you keep the list up to date after a create.

    End-to-end React + TypeScript against a .NET 10 Minimal API: built-in validation returning ValidationProblem, a typed fetch client, a form that maps ProblemDetails errors to fields, loading and error states, and refreshing the list after a create.

    Mid-Level Coding SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  19. How do you host a React or Angular SPA with an ASP.NET Core backend? Compare serving it from the same origin as the API with deploying it to a separate origin, explain how the Vite dev server proxy works locally, and what changes for routing, caching, CORS, authentication and deployment in each case.

    SPA hosting options with ASP.NET Core: same-origin (static files + MapFallbackToFile or a reverse proxy) versus separate origins (Azure Static Web Apps, CDN), the Vite dev proxy and the .NET SPA templates, and the effect on deep links, caching, CORS, cookies and deployment.

    Mid-Level Theory SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  20. Your React SPA signs users in with OpenID Connect and keeps the access token and refresh token in localStorage. From the browser's point of view, what can an XSS payload or a malicious npm package actually do with them? How much safer are in-memory tokens or sessionStorage, and why do current guidelines recommend a backend-for-frontend with an HttpOnly cookie instead?

    Token storage in SPAs from the browser's side: what injected script can do with tokens in localStorage, sessionStorage or memory, why in-memory tokens only narrow the window, and why the BFF pattern with HttpOnly SameSite cookies is the current recommendation.

    Mid-Level Security SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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