Skip to content

Angular .NET Developer Interview Questions & Answers

40 questions for Angular .NET Developer interviews — 27 easy, 13 medium.

About the Angular .NET Developer role

This role pairs Angular front-end work with an ASP.NET Core back end, common in banking, insurance and enterprise portals. You build standalone components, reactive forms, route guards and HTTP interceptors, and connect them to secure APIs. Interviews test TypeScript, RxJS, signals and change detection along with C# and Web API basics, plus handling CORS, tokens and large data grids. Good UI sense also helps.

Angular and TypeScript RxJS and signals Reactive forms HTTP interceptors ASP.NET Core APIs
Solved for this roleStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How do model binding and validation work in ASP.NET Core Web API?

Save to ▾
Show answer
Model binding maps request data into action parameters from the route, query string, headers or body, using [FromRoute], [FromQuery] and [FromBody]. Validation uses data annotations like [Required], [StringLength] and [Range] on DTOs. With [ApiController], invalid models automatically return 400 Bad Request with ProblemDetails listing the errors, so you do not need to check ModelState manually. FluentValidation is popular for complex rules.
02

What is CORS and how do you enable it in ASP.NET Core?

Save to ▾
Show answer
Browsers block JavaScript from calling an API on a different origin (scheme, host or port) unless the server allows it via CORS headers. If an Angular app on localhost:4200 calls an API on localhost:5001, you add a policy with builder.Services.AddCors, allowing that origin with WithOrigins, plus required methods and headers, and call app.UseCors before authorization. Avoid AllowAnyOrigin in production, especially with credentials.
03

Show attribute routing for a products controller with route constraints.

Save to ▾
Show answer
[ApiController] [Route("api/[controller]")] public class ProductsController(IProductService service) : ControllerBase { [HttpGet] public async Task<IActionResult> GetAll() => Ok(await service.GetAllAsync()); [HttpGet("{id:int}")] public async Task<IActionResult> Get(int id) { var p = await service.GetAsync(id); return p is null ? NotFound() : Ok(p); } [HttpPost] public async Task<IActionResult> Create(ProductDto dto) { var created = await service.CreateAsync(dto); return CreatedAtAction(nameof(Get), new { id = created.Id }, created); } }
04

Explain the types of data binding in Angular.

Save to ▾
Show answer
Interpolation {{ value }} shows component data in the template. Property binding [src]="imageUrl" sets an element or child property. Event binding (click)="save()" calls a component method on a DOM event. Two-way binding [(ngModel)]="name" combines property and event binding so the input and the field stay in sync. The first two flow from component to view, event binding flows from view to component.
05

Show how yield return works with an example.

Save to ▾
Show answer
static IEnumerable<int> EvenNumbers(int max) { for (int i = 0; i <= max; i += 2) { yield return i; // pause here, resume on next MoveNext } } foreach (var n in EvenNumbers(10).Take(3)) Console.WriteLine(n); // 0 2 4 The compiler builds a state machine, so values are produced lazily one at a time. Only three values are generated here, which saves memory for large or infinite sequences.
06

Your Angular app on localhost:4200 gets a CORS error when calling the ASP.NET Core API on localhost:5001. How do you fix it?

Save to ▾
Show answer
The browser blocks the call because the origins differ and the API sends no CORS headers. In the API, register a policy with AddCors allowing http://localhost:4200, the needed methods and headers, and call app.UseCors before UseAuthorization. Alternatively, use the Angular dev server proxy (proxy.conf.json) to forward /api calls, so the browser sees the same origin. In production, configure the real front-end domain, not AllowAnyOrigin.
07

What is the virtual DOM in React?

Save to ▾
Show answer
The virtual DOM is a lightweight JavaScript copy of the UI tree. When state changes, React renders a new virtual tree, compares it with the previous one in a process called reconciliation, and applies only the minimal changes to the real DOM, which is slow to update. Keys on list items help React match elements correctly. This lets developers write UI declaratively without manually updating DOM nodes.
08

An API creates a new HttpClient inside a using block for every outgoing call, and under load you see socket exhaustion errors. How do you fix it?

Save to ▾
Show answer
Disposing HttpClient does not immediately free the underlying socket; connections stay in TIME_WAIT, so thousands of short-lived clients exhaust ports. A single static client fixes that but misses DNS changes. The recommended fix is IHttpClientFactory: register builder.Services.AddHttpClient<PaymentClient>() and inject the typed client. The factory pools and rotates handlers, and you can add resilience with Microsoft.Extensions.Http.Resilience for retries and timeouts.
09

Show the useState and useEffect hooks in a React component.

Save to ▾
Show answer
import { useState, useEffect } from 'react'; export function Timer() { const [seconds, setSeconds] = useState(0); useEffect(() => { const id = setInterval(() => setSeconds(s => s + 1), 1000); return () => clearInterval(id); // cleanup on unmount }, []); // empty array: run once return <p>Elapsed: {seconds}s</p>; } useState stores state that triggers re-render; useEffect runs side effects after render, and its dependency array controls when it re-runs.
10

Sort a list of students by marks descending, then by name ascending.

Save to ▾
Show answer
var ranked = students .OrderByDescending(s => s.Marks) .ThenBy(s => s.Name) .ToList(); // in-place alternative with a comparison students.Sort((a, b) => b.Marks != a.Marks ? b.Marks.CompareTo(a.Marks) : string.Compare(a.Name, b.Name, StringComparison.Ordinal)); OrderBy is stable and returns a new sequence; List.Sort sorts in place and is not stable.
11

What are boxing and unboxing?

Save to ▾
Show answer
Boxing converts a value type to object or an interface type by wrapping it in a heap object, for example object o = 42. Unboxing extracts the value back with an explicit cast, such as int n = (int)o. Both cost allocations and CPU time, and repeated boxing in loops increases garbage collection pressure. Generic collections like List<int> avoid boxing, which is one reason ArrayList is no longer used.
12

Why should we hire you as a .NET full stack developer?

Save to ▾
Show answer
I can contribute on both sides of a feature: I have built ASP.NET Core APIs with EF Core and SQL Server, and front ends in Angular and React, and deployed them myself. I write clean, tested code and I am comfortable reading logs and execution plans when things break. I learn quickly, ask questions early and take ownership, so you can give me a module and trust that it will be completed properly.
13

Walk me through a full stack project you built.

Save to ▾
Show answer
I built an online bus-pass system (Situation) as my final project with two classmates. My task was the API and database. I designed SQL Server tables, built an ASP.NET Core Web API with EF Core and JWT login, and connected an Angular front end with reactive forms and route guards. I deployed it on Azure App Service. Result: it handled pass applications, approvals and PDF passes, and our college used it for a semester demo.
14

Implement global exception handling that returns ProblemDetails.

Save to ▾
Show answer
public class GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger) : IExceptionHandler { public async ValueTask<bool> TryHandleAsync(HttpContext ctx, Exception ex, CancellationToken ct) { logger.LogError(ex, "Unhandled error"); var status = ex is KeyNotFoundException ? 404 : 500; ctx.Response.StatusCode = status; await ctx.Response.WriteAsJsonAsync(new ProblemDetails { Status = status, Title = status == 404 ? "Not found" : "Server error" }, ct); return true; } } // Program.cs builder.Services.AddExceptionHandler<GlobalExceptionHandler>(); builder.Services.AddProblemDetails(); app.UseExceptionHandler();
15

What is the difference between props and state in React?

Save to ▾
Show answer
Props are inputs passed from a parent component to a child, like function arguments, and the child must not modify them. State is data owned and managed inside a component with useState or useReducer, and changing it re-renders the component. For example, a ProductCard receives product details as props, while a Cart component keeps the quantity in state. Shared state is lifted up to a common parent or moved into a store.
16

What are services and dependency injection in Angular?

Save to ▾
Show answer
A service is a class, marked @Injectable, that holds logic or data shared across components, such as API calls, authentication or a cart. Angular's DI creates the service and provides it to components that request it in the constructor or with the inject() function. With providedIn: 'root', one shared instance exists for the whole app. This keeps components focused on UI and makes logic easy to test.
17

Which HTTP status codes and methods should a REST API use, and what is the difference between PUT and PATCH?

Save to ▾
Show answer
GET reads, POST creates, PUT replaces, PATCH partially updates and DELETE removes. Return 200 OK for success with a body, 201 Created with a Location header after POST, 204 No Content after delete, 400 for invalid input, 401 unauthenticated, 403 forbidden, 404 not found, 409 conflict and 500 for server errors. PUT sends the full resource and is idempotent; PATCH sends only changed fields.
18

Show encapsulation using properties, including init-only and validation.

Save to ▾
Show answer
public class BankAccount { public string AccountNo { get; init; } = ""; public decimal Balance { get; private set; } public void Deposit(decimal amount) { if (amount <= 0) throw new ArgumentOutOfRangeException(nameof(amount)); Balance += amount; } } var acc = new BankAccount { AccountNo = "SB1001" }; Balance can only change through Deposit, and AccountNo can be set only during object creation.
19

Explain the transient, scoped and singleton service lifetimes.

Save to ▾
Show answer
Transient services are created every time they are requested, suitable for lightweight stateless helpers. Scoped services are created once per HTTP request and shared within it; DbContext is registered as scoped. Singleton services are created once for the whole application lifetime, suitable for caches and configuration. Choose based on state: anything holding per-request data must not be singleton, and singletons must be thread-safe.
20

Fetch products from an ASP.NET Core API in React with loading and error states.

Save to ▾
Show answer
function Products() { const [items, setItems] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const ctrl = new AbortController(); fetch('/api/products', { signal: ctrl.signal }) .then(r => { if (!r.ok) throw new Error(r.status); return r.json(); }) .then(setItems) .catch(e => { if (e.name !== 'AbortError') setError(e.message); }) .finally(() => setLoading(false)); return () => ctrl.abort(); }, []); if (loading) return <p>Loading...</p>; if (error) return <p>Error: {error}</p>; return <ul>{items.map(p => <li key={p.id}>{p.name}</li>)}</ul>; }
21

Angular or React with ASP.NET Core: how do you choose?

Save to ▾
Show answer
Angular is a complete framework with routing, forms, HTTP, dependency injection and TypeScript built in, which suits large enterprise apps and teams that want strong conventions. React is a UI library with a large ecosystem, giving more freedom to pick routing and state tools, and is popular in product startups. Both work equally well with an ASP.NET Core API. Choose based on team skills, project size and the company's existing stack.
22

Why do you want to work as a .NET full stack developer?

Save to ▾
Show answer
I enjoy building complete features, from database to screen, and .NET lets me do that with one strong, typed language on the back end. It is widely used by IT services firms, banks and product companies in India, so there are steady opportunities. I have built projects with ASP.NET Core and React, and I like that the platform is open source, cross-platform and keeps improving every year.
23

What is the difference between controllers and Minimal APIs?

Save to ▾
Show answer
Controllers group actions into classes with attributes for routing, filters and model binding, which suits large APIs with many conventions. Minimal APIs map endpoints directly with app.MapGet and lambdas, with less ceremony and slightly better performance, ideal for microservices and small APIs. Since .NET 7 they support filters, route groups and OpenAPI, and .NET 10 adds built-in validation, so both are production-ready choices.
24

What are generics and what benefits do they give?

Save to ▾
Show answer
Generics let you write classes and methods with a type parameter, such as List<T> or Repository<T>, that work with any type while staying type-safe. Benefits are compile-time checking instead of casts, no boxing for value types, and code reuse. For example, one generic Result<T> type can wrap any API response. The CLR creates specialised code for value types and shares code for reference types.
25

What is deferred execution in LINQ?

Save to ▾
Show answer
Most LINQ operators such as Where and Select do not run when you write them; they build a query that executes only when you enumerate it with foreach, ToList, Count or First. This means the query sees the latest data at enumeration time and can be composed step by step. The catch is that enumerating the same query twice runs it twice, which can mean two database calls. Call ToList to materialise once.
26

What is the difference between a clustered and a non-clustered index?

Save to ▾
Show answer
A clustered index defines the physical order of the table's data, so the leaf level is the data itself, and a table can have only one. A non-clustered index is a separate structure with key values and a pointer back to the row, and a table can have many. Range queries on the clustered key are fast. Non-clustered indexes speed up searches on other columns but add cost to inserts and updates.
27

What is the middleware pipeline in ASP.NET Core?

Save to ▾
Show answer
Every HTTP request passes through a chain of middleware components configured in Program.cs. Each component can inspect or modify the request, call the next one, and then work on the response on the way back. Order matters: exception handling first, then HTTPS redirection, static files, routing, CORS, authentication, authorization and finally endpoints. For example, putting UseAuthorization before UseAuthentication means users never appear logged in.
28

What is the difference between an RxJS Observable and a Promise?

Save to ▾
Show answer
A Promise represents a single future value, starts immediately and cannot be cancelled. An Observable can emit many values over time, is lazy until subscribed, and can be cancelled by unsubscribing. RxJS operators like map, debounceTime, switchMap and retry make it powerful for streams such as search boxes or WebSocket data. Angular's HttpClient returns Observables; use the async pipe or toSignal to avoid manual unsubscribe.
29

Show how to bind configuration from appsettings.json using the Options pattern.

Save to ▾
Show answer
// appsettings.json // "Smtp": { "Host": "smtp.example.com", "Port": 587 } public class SmtpOptions { public string Host { get; set; } = ""; public int Port { get; set; } } builder.Services.Configure<SmtpOptions>(builder.Configuration.GetSection("Smtp")); public class EmailService(IOptions<SmtpOptions> options) { private readonly SmtpOptions _smtp = options.Value; } appsettings.{Environment}.json and environment variables override base values. Use IOptionsMonitor to pick up changes without restart.
30

What is the difference between authentication and authorization in ASP.NET Core?

Save to ▾
Show answer
Authentication answers who you are: middleware reads a cookie or JWT, validates it and builds a ClaimsPrincipal for HttpContext.User. Authorization answers what you may do: it checks that user against rules such as [Authorize(Roles = "Admin")] or a policy like requiring an Employee claim with a certain department. A missing or invalid identity gives 401 Unauthorized, while a valid user without permission gets 403 Forbidden.
31

What is the difference between CPU-bound and I/O-bound work, and how do you handle each in .NET?

Save to ▾
Show answer
CPU-bound work keeps the processor busy, like encryption, image processing or heavy calculations; speed it up with parallelism using Parallel.For, PLINQ or Task.Run in desktop apps. I/O-bound work spends most time waiting on databases, files or networks; handle it with async/await so threads are released while waiting. Choosing wrongly wastes resources, such as using Parallel.ForEach for HTTP calls or Task.Run around database queries.
32

What is ASP.NET Core and what are its main features?

Save to ▾
Show answer
ASP.NET Core is the open-source, cross-platform framework for building web APIs, MVC sites, Razor Pages, Blazor apps and real-time apps with SignalR on modern .NET. Key features are built-in dependency injection, a configurable middleware pipeline, the fast Kestrel web server, unified configuration and logging, and support for Docker and cloud hosting. It runs on Windows, Linux and macOS and consistently ranks among the fastest web frameworks.
33

Explain normalisation and the first three normal forms.

Save to ▾
Show answer
Normalisation organises tables to reduce redundancy and update anomalies. 1NF: each column holds atomic values and there are no repeating groups. 2NF: in 1NF and every non-key column depends on the whole primary key, not part of a composite key. 3NF: in 2NF and non-key columns do not depend on other non-key columns, for example City should not be stored with an order if it depends on the customer. Reporting databases may denormalise for speed.
34

Where do you see yourself in five years?

Save to ▾
Show answer
In five years I want to be a senior full stack engineer who can design a complete .NET system, from database and APIs to front end and cloud deployment, and guide newer developers. In the near term I want to master ASP.NET Core, EF Core and SQL Server performance, then grow into Azure and system design. I would like to grow inside one company where I can take on bigger modules over time.
35

What is the difference between var, dynamic and object?

Save to ▾
Show answer
var is implicitly typed: the compiler infers the real type at compile time, so it is fully type-safe. object is the base type of everything; you need casts to use specific members, and value types get boxed. dynamic skips compile-time checking and resolves members at runtime, so typos fail only when the code runs. Use var for readability, object rarely, and dynamic only for COM interop or truly dynamic data.
36

What is LINQ and why is it useful?

Save to ▾
Show answer
LINQ, Language Integrated Query, lets you query collections, databases, XML and other sources with the same C# syntax using methods like Where, Select, OrderBy and GroupBy. Queries are type-checked at compile time and read close to the intent, for example orders.Where(o => o.Total > 500).OrderBy(o => o.Date). With EF Core, the same LINQ expression is translated into SQL, so you rarely write raw SQL strings.
37

A report builder concatenates 50,000 rows into one string with += and takes several seconds. What do you change?

Save to ▾
Show answer
Each += creates a new string and copies everything built so far, so the cost grows quadratically. Replace it with a StringBuilder, ideally created with an estimated capacity, and call Append or AppendLine in the loop, then ToString once at the end. For very large output, write directly to a StreamWriter or the response stream instead of building the whole string in memory.
38

What is the difference between DELETE, TRUNCATE and DROP?

Save to ▾
Show answer
DELETE removes rows one by one, supports WHERE, fires triggers and is fully logged, so it is slower on big tables. TRUNCATE removes all rows by deallocating pages, is minimally logged, resets identity values and cannot have WHERE; it fails if foreign keys reference the table. DROP removes the whole table including structure, indexes and permissions. In SQL Server, both DELETE and TRUNCATE can be rolled back inside a transaction.
39

Protect an Angular route so only logged-in users can open it.

Save to ▾
Show answer
import { CanActivateFn, Router } from '@angular/router'; import { inject } from '@angular/core'; export const authGuard: CanActivateFn = () => { const auth = inject(AuthService); return auth.isLoggedIn() ? true : inject(Router).createUrlTree(['/login']); }; // app.routes.ts export const routes = [ { path: 'dashboard', component: DashboardComponent, canActivate: [authGuard] }, { path: 'login', component: LoginComponent } ]; Guards only improve user experience; the API must still enforce [Authorize] on the server.
40

Write an Angular HTTP interceptor that adds a JWT to every API request.

Save to ▾
Show answer
import { HttpInterceptorFn } from '@angular/common/http'; import { inject } from '@angular/core'; export const authInterceptor: HttpInterceptorFn = (req, next) => { const token = inject(AuthService).token(); if (token) { req = req.clone({ setHeaders: { Authorization: `Bearer ${token}` } }); } return next(req); }; // app.config.ts provideHttpClient(withInterceptors([authInterceptor])); Requests are immutable, so clone() creates a modified copy. The ASP.NET Core JWT middleware then reads the header.

Frequently asked questions

What does a Angular .NET Developer do?

This role pairs Angular front-end work with an ASP.NET Core back end, common in banking, insurance and enterprise portals. You build standalone components, reactive forms, route guards and HTTP interceptors, and connect them to secure APIs. Interviews test TypeScript, RxJS, signals and change detection along with C# and Web API basics, plus handling CORS, tokens and large data grids. Good UI sense also helps.

Which skills are tested in a Angular .NET Developer interview?

Expect questions on Angular and TypeScript, RxJS and signals, Reactive forms, HTTP interceptors, ASP.NET Core APIs. Most rounds also ask you to explain a project and solve one practical problem live.

How do I prepare for a Angular .NET Developer interview?

Revise Angular and React Front End, ASP.NET Core Web API first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.