← All topics

Angular Interview Questions and Answers

Components, templates and control flow, signals, DI, RxJS, routing, forms, change detection, SSR and NgRx.

225 questions for Angular interviews with answers and explanations - Junior, Middle and Senior levels. Sample questions, online quizzes and coding tasks.

Questions by level

Sample questions

A few questions from each level with the correct answer and an explanation.

Angular · Junior

  1. What is Angular?

    Correct answer: A full TypeScript framework from Google with components, DI, routing, forms and HTTP out of the box

    Angular is an opinionated, batteries-included framework: the router, forms, HTTP client, DI, testing utilities and the CLI are all maintained by the Angular team. React, by contrast, is a rendering library around which you assemble your own stack.

  2. Which command creates a new Angular project?

    Correct answer: ng new my-app

    The Angular CLI (npm install -g @angular/cli) scaffolds the project with ng new, runs the dev server with ng serve, generates code with ng generate component name and builds with ng build.

  3. What does standalone mean for an Angular component?

    Correct answer: The component declares its own dependencies in imports instead of belonging to an NgModule

    Standalone components list the components, directives and pipes they use in imports. Since Angular 19 components are standalone by default; NgModules are still supported but no longer required.

  4. How is a standalone Angular application started?

    Correct answer: bootstrapApplication(App, appConfig) in main.ts

    bootstrapApplication renders the root component and takes an ApplicationConfig with providers such as provideRouter(routes) and provideHttpClient(). bootstrapModule is the older NgModule-based way.

All 75 questions with answers →

Angular · Middle

  1. What changes when a component uses ChangeDetectionStrategy.OnPush?

    Correct answer: Angular checks it only when it is marked dirty: an input reference changes, it or a child handles an event, a read signal changes, or async delivers a value

    With the default strategy every component is checked on each change detection run. OnPush skips whole subtrees that were not marked, which is the main runtime optimization in zone-based apps.

  2. When do you need ChangeDetectorRef.markForCheck()?

    Correct answer: In an OnPush component when state changes outside Angular's knowledge, e.g. a manual subscribe that sets a plain field

    markForCheck marks the component and its ancestors so they are checked in the next run. The async pipe and signals do this automatically, which is why they are preferred over manual subscriptions.

  3. What does ExpressionChangedAfterItHasBeenCheckedError mean?

    Correct answer: A bound value changed during the same change detection pass after it was checked (only detected in dev mode)

    In development Angular runs a second check to make sure data flows one way. It is typically caused by changing parent state in a child's ngAfterViewInit or by getters that return new values each time. Fix the data flow instead of hiding it with setTimeout.

  4. How do signals improve change detection compared to plain fields?

    Correct answer: Angular knows exactly which templates read a changed signal and marks only those components for refresh

    A signal read in a template registers the view as a consumer. When the signal changes, that view is marked dirty - even in an OnPush component - without relying on Zone.js guessing that something might have changed.

All 75 questions with answers →

Angular · Senior

  1. How does Zone.js let Angular know when to run change detection?

    Correct answer: It patches async browser APIs (events, timers, promises, XHR) and notifies Angular when a task finishes, which triggers ApplicationRef.tick()

    Zone.js doesn't know *what* changed, only that some async work completed, so Angular checks the tree from the root (skipping OnPush subtrees that are not dirty). That is simple but can cause many unnecessary checks.

  2. How do you enable zoneless change detection?

    Correct answer: Add provideZonelessChangeDetection() to the app providers and remove zone.js from polyfills

    Recent Angular versions create new projects zoneless by default. Removing Zone.js reduces bundle size, makes stack traces cleaner and avoids unnecessary checks.

  3. In a zoneless app, which of these does NOT schedule change detection?

    Correct answer: A setTimeout callback assigning a new value to a plain class field

    Without Zone.js Angular relies on explicit notifications: signal updates, markForCheck() (also used by async), ComponentRef.setInput, template/host listeners and attaching dirty views. A plain field change in a timer is invisible.

  4. Which component style is already compatible with zoneless change detection?

    Correct answer: OnPush components whose state lives in signals or flows through async/markForCheck

    If a component works correctly with OnPush, it is very likely zoneless-ready. APIs like NgZone.onStable/onMicrotaskEmpty don't emit without Zone.js and should be replaced with afterNextRender or signals.

All 75 questions with answers →

Combined quizzes with this topic

Questions from several topics at once - just like an interview for a specific role.

Coding tasks

Write your solution right in the browser, and tests check it instantly. Interview classics: debounce, throttle, deepClone, Promise.all, EventEmitter, an LRU cache and more.

Open tasks →