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

SPA Integration

Connecting single-page apps to ASP.NET Core: React and Angular basics, hosting and dev proxies, the authentication flow, token storage risks, the BFF pattern, typed API clients and CSRF protection.

  1. When would you use TanStack Query instead of fetching in useEffect, and what does it give you?
    Junior Theory SPA Integration
  2. What are Angular signals, and how do they change change detection compared with zone.js?
    Junior Theory SPA Integration
  3. How would you stop a double-submitted create from producing two records, even if the client disables the button?
    Mid-Level Coding SPA Integration
  4. How do you evolve an API without breaking existing clients, and when do you introduce a new version?
    Mid-Level Theory SPA Integration
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. Implement the backend-for-frontend (BFF) pattern for a React SPA in ASP.NET Core. Show the cookie and OpenID Connect setup, how tokens are stored and refreshed server-side, how YARP forwards /api calls to the downstream API with the access token attached, how you protect against CSRF, and how login, logout and a 'who am I' endpoint work for the SPA.

    A hand-rolled BFF in .NET 10: cookie + OpenID Connect authentication with SaveTokens, server-side token refresh, YARP forwarding with a bearer-token transform, custom-header CSRF protection, and login, logout and user endpoints for a React SPA.

    Senior Coding SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. Your React frontend and ASP.NET Core API are maintained by different people, and DTO changes keep breaking the UI in production. How would you set up a contract pipeline: generating the OpenAPI document at build time in .NET 10, generating a typed TypeScript client from it, catching breaking changes in CI, and deciding what is allowed to change without a new API version?

    A contract-first workflow between ASP.NET Core and a TypeScript frontend: build-time OpenAPI generation in .NET 10, choosing a TypeScript generator (openapi-typescript, Orval, NSwag, Kiota), committing and diffing the spec, breaking-change detection in CI, and evolution rules for DTOs.

    Mid-Level Theory SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. Your organisation is starting a new internal line-of-business application, and the .NET team must choose between React, Angular and Blazor. How would you make and document that decision? Which criteria matter (team skills, hiring, hosting and render model, security, performance, long-term maintenance), what would you recommend in which situations, and how would you reduce the risk of choosing wrong?

    An architecture decision between React, Angular and Blazor for a .NET line-of-business app: weighted criteria, team and hiring realities in Australia, Blazor render modes vs SPA hosting, security and offline needs, a time-boxed spike, and recording the outcome in an ADR.

    Senior Architecture SPA Integration Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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