Automation (RPA)
Software Design
JS Frameworks
.Net Stack
Java Stack
Django Stack
Cloud Computing
Mobile Development
SAP Modules
BIG Data
BI and Data Analytics
Web Technologies
All Interviews

Top 41 Angular Interview Questions and Answers

11/Jan/2024 | 20 minutes to read


Here is a List of essential Angular Interview Questions and Answers for Freshers and mid level of Experienced Professionals. All answers for these Angular questions are explained in a simple and easiest way. These basic, advanced and latest Angular questions will help you to clear your next Job interview.

Angular Interview Questions and Answers

These Angular interview questions are targeted for Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7 and all versions greater than Angular 2. You must know the answer of these frequently asked Angular interview questions to clear the interview. These Angular questions will help Full Stack developers, Java Developers, .Net Developers, UI or Front End developers and many more to clear the interview.

1. What is Angular?

Angular is an application design framework and a development platform to build sophisticated and efficient single page applications. This document applies to angular version 2.0 and later versions such as Angular 11, Angular 10, Angular 9, Angular 8, Angular 7 etc. For 1.x versions of angular we use the name as AngularJS.

2. What is the latest version of Angular?

You can check Angular version any time on this link Angular Latest Version

2. What is the template type checking in Angular?

Similar to TypeScript catching the errors related to types, Angular checks the expressions and bindings available in application code templates. Angular performs this check based on the value of these flags in the TypeScript configuration file. There are three modes:
  • Basic Mode - when the value of fullTemplateTypeCheck flag is set to false.
  • Full Mode - when the value of fullTemplateTypeCheck flag is set to true.
  • Strict Mode - when the value of strictTemplates flag is set to true.
For more refer Template Type check in Angular.

3. How is Angular different from AngularJs?

Angular and AngularJS both are the open source JavaScript based frameworks used to develop web based single page applications (SPAs). For angular versions 1.x we gave the name AngularJS and for angular version 2.0 and later we just call it Angular. There are a lot of differences between Angular and AngularJS as below.

  • Language - AngularJS is based on JavaScript, Whereas Angular is written in TypeScript superset of ECMAScript 6 (ES6). TypeScript provides object oriented features and better type checking.
  • Architecture - AngularJS has architecture of MVC (model-view-controller). Model manages its data with the help of $scope, the controller handles user interactions and the view displays the data. Angular has the architecture of components (that handles the logic and view part of the page) and directives. Directives with templates are called components. Angular provides 2 types of directives one is Structural and second attribute directives.
  • Expression Syntax - Both use double curly braces - {{ }} for expressions.
  • Mobile Support - Angular is built by keeping mobile browsers in mind but AngularJS was not built to support mobile devices.
  • Route Navigation - Both provide different configurations for routing as $routeProvider for AngularJS and RouteConfig in Angular.
  • Dependency Injection (DI) - Angular has its own Dependency Injection (DI) pattern which provides the efficiency and modularity in application design whereas AngularJS has not it's own Dependency Injection.
  • Performance - Angular has better performance than AngularJS because of it's DI and typescripts OOPs concept, type checking.
  • Structure - AngularJS has less complex structure whereas Angular provides better structure for Large single page applications.

4. What are the advantages of using Angular over AngularJS?

Angular is a typescript based free and open-source application design framework and platform for developers which comes with many advantages.

  • Angular has better architecture support for larger applications.
  • TypeScript provides OOPS features and better type checking.
  • Mobile support is a good feature.
  • Routing is simpler to configure.
  • Built in Dependency Injection.
  • Provide the capability to write the code in different languages typescript, ES5, Dart etc.
  • Upgrading to newer versions is easy.
  • Support of AOT compilation in Angular versions 4.0 onwards.

5. What are the main building blocks of an Angular Application?

Angular Architecture provides some basic concepts or main building blocks to develop an application. These main building blocks are:

  • NgModules - Angular application is a set of NgModules as angular supports modular programming. NgModules collect the related code into units for related functionality and provide the compilation context for the component. An application has at least one root module that is responsible for bootstrapping and other are the feature modules. You can create a module class using @NgModule decorator with some properties. Module can contain any components, service providers and other code for that module.
        imports: [],
        declarations: [],
        providers: [],
        bootstrap: [AppComponent],
    export class AppModule { }
  • Components - Components define and control the view , it's associated data and logic. Application has at least one component. The component decorator @Component() treats the class just below it as a component class and provides the information for the template and other meta-data information. Example is below.
        selector: 'web-portal-home',
        templateUrl: './home.component.html',
        styleUrls: ['./home.component.scss'],
    export class HomeComponent {
  • Services - Services are used to share the data across the components. The decorator @Injectable() defines the class just below it as a service that can be injected as a dependency.
    export class UserService {
  • Dependency Injection - Dependency Injection is a design pattern that is used to resolve the dependencies in different classes or components. you can inject the service in a component's constructor as below.
    constructor(private service: UserService) { }
  • Routing - Angular provides a RouterModule to handle the navigation between the states and view of application.

7. Explain the Standalone components in Angular?

Standalone components help you to build the applications in a simpler way by avoiding the use of NgModule(s). When you declare a component as standalone to 'true' it does not need to be declared in NgModule. You can reference the other standalone component, directive and pipe inside the import array of a standalone component without registering it in NgModule.
For more visit Standalone components.

7. How will you open the browser automatically when running your Angular application?

You can pass the "--open (or just -o)" with the "ng serve" command to automatically open the app in the browser.

ng serve --open

6. What is the difference between NgModules and JavaScript modules?

NgModules are different from JavaScript modules in the following ways.

  • NgModule binds to declared classes only not all as Angular compiler only understands declared classes.
  • JavaScript modules define all member classes in one giant file but Angular modules use the declaration array to include all member class files.
  • NgModules exports only classes available in it's declaration and imported from other modules, not all.
  • An NgModules can extend the entire application with services by adding providers in it's providers list but JavaScript modules can not do this.

7. What is the host view in Angular?

When a component is created it's directly associated with a single view that is called host view. The host view plays a critical role during the change detection in Angular. Whenever a component class finds any changes, Angular applies these change detection on the host view first then it checks for child views. It makes sure that any modifications to the component are always reflected in the host view.

8. What are the directives? How many types of directives are available in Angular?

Directives provide the Program logic and extend the power of HTML by providing new syntax.
Angular supports 3 types of directives as below.

  • Components - These are the directives with templates.
  • Structure directives - You can change DOM structure by adding or removing the elements. we use asterisk (*) as a prefix to the directive name. Structure directive examples are *ngIf, *ngFor etc.
     <span *ngIf="user" class="name">{{}}</span>
  • Attribute directives - When you want to change the appearance or behavior of a DOM element, you can use attribute directive. Attribute directive example.
    import { Directive, ElementRef } from '@angular/core';
        selector: '[highlight]'
        export class HighlightDirective {
            constructor(el: ElementRef) {
   = 'yellow';
    // directive usage
    <span highlight>High light content!</span>

9. What is Data Binding in Angular? Explain 2 way data binding.

Data binding is the way to share the data between a component class and its associated template called view. Angular provides 2 way data binding means component properties can be used in view for data and if you make any changes in view then changes should reflect back in component's properties.

10. What is Interpolation and Template Expressions in Angular?

Interpolation provides the easiest way to bind a component property in the view. In Interpolation you put the property in the double curly braces '{{property=name}}'.
A Template expression is used in double curly braces and produces a value like {{1+1}}, it will produce a value 2. In Property binding an expression is the right side part of '=' operator.

11. What are the different types of binding available?

Angular provides different ways of binding as below.

  • Property Binding - binding is set in one direction from component's property to template. Property binding example.
    <img [src]="ImageUrl">
  • Event Binding - It's used to bind any event. Event binding example.
    <button (click)="onUpdate($event)">Save</button>
  • Two way binding - It's used for two-way binding. Two-way data binding example.
    <input [(ngModel)]="name">
  • Attribute binding - It's used to set the value of an attribute directly. Attribute binding example.
    <button [attr.aria-label]="help">help</button>
  • Class binding - It's used to add or remove class names from class attributes. Class binding example.
     <span [class.specialClass]="isSpecialClass">Special class</span>
  • Style binding - It's used to add or remove the style from the style attribute. Style binding example.
    <button [style.color]="isSpecialClass ? 'blue' : 'black'">Click Me</button>

12. What are the lifecycle hooks in angular?

Components and directives have a lifecycle managed by Angular. Angular creates and renders the components and checks when their data bound properties change and destroy them before unloading. Angular creates components by calling it's constructor and follows the sequence of lifecycle hooks as below.
  • ngOnChanges() - called when Angular resets data bound properties.
  • ngOnInit() - used to initialize the directive or component and sets data bound properties.
  • ngDoCheck() - when the changes are not detected by angular own then it's used to catch those changes.
  • ngAfterContentInit()
  • ngAfterContentChecked()
  • ngAfterViewInit()
  • ngAfterViewChecked()
  • ngOnDestroy() - used to cleanup the component or directive before Angular destroys it.
For more visit Angular Lifecycle hooks.

13. How will you share the data between components?

In many scenarios you need to share the data between the components. it can be parent to child, child to parent and unrelated components. So let's understand this with the help of an example.

  • Parent To Child Component - any data from parent to child can be shared with the help of @Input decorator.
    // parent component
    import { Component } from '@angular/core';
      selector: 'app-parent',
      template: `<app-child [childMessage]="parentMessage"></app-child>`,
      styleUrls: ['./parent.component.css']
    export class ParentComponent{
      parentMessage = "message from parent"
      constructor() { }
    // child component
    import { Component, Input } from '@angular/core';
      selector: 'app-child',
      template: `Say {{ childMessage }}`,
      styleUrls: ['./child.component.css']
    export class ChildComponent {
      @Input() childMessage: string;
      constructor() { }
  • Child To Parent Component 1 - you can share the data from child to parent using @Output decorator.
    import { Component } from '@angular/core';
      selector: 'app-parent',
      template: `Message: {{message}}<app-child (messageEvent)="receiveMessage($event)"></app-child>`,
      styleUrls: ['./parent.component.css']
    export class ParentComponent {
      constructor() { }
      receiveMessage($event) {
        this.message = $event
    import { Component, Output, EventEmitter } from '@angular/core';
      selector: 'app-child',
      template: `<button (click)="sendMessage()">Send Message</button>`,
      styleUrls: ['./child.component.css']
    export class ChildComponent {
      message: string = "Hello Testing!"
      @Output() messageEvent = new EventEmitter();
      constructor() { }
      sendMessage() {this.messageEvent.emit(this.message) }
  • Child To Parent Component 2 - you can share the data from child to parent using @Viewchild decorator.
    import { Component, ViewChild, AfterViewInit } from '@angular/core';
    import { ChildComponent } from "../child/child.component";
      selector: 'app-parent',
      template: `
        Message: {{ message }}
      styleUrls: ['./parent.component.css']
    export class ParentComponent implements AfterViewInit {
      @ViewChild(ChildComponent) child;
      constructor() { }
      ngAfterViewInit() {this.message = this.child.message}
      selector: 'app-child',
      template: ``,
      styleUrls: ['./child.component.css']
    export class ChildComponent {
      message = 'Hello Testing!';
      constructor() { }
  • Share data between Unrelated Components - for this you can write one service and that service can be injected in both components. So Angular Services are used to share the data between unrelated components.

14. What are the Pipes in Angular?

A Pipe provides the functionality of transforming the data from your data input to desired output. For example, You receive some lower case data from the back end and now you want to display that data as upper case then you can Angular built in pipe 'uppercase'. You can also create your custom pipes in angular.
To implement a custom pipe, decorate your class with '@Pipe' metadata and implement PipeTransform interface's transform method as below.

@Pipe({name: 'exponentialStrength'})
export class ExponentialPipe implements PipeTransform {
  transform(value: number, exponent?: number): number {
    return Math.pow(value, isNaN(exponent) ? 1 : exponent);

15. Explain the AOT compilation? Or What is the difference between JIT and AOT?

Angular provides two ways for the compilation of your application.
  • JIT - Just-in-Time (JIT), it compiles the application at runtime in the browser. JIT was the default compiler till Angular 8. When you run ng-build or ng-server it will compile your application.
  • AOT - Ahead-of-Time (AOT), it compiles the application at build time. AOT compiler converts all HTML and TypeScript code into JavaScript code during build before browsers start downloading JavaScript code. It makes rendering faster. AOT provides a lot of benefits as below.
    • Browsers get pre-compiled code and do not wait for compilation that results in faster Rendering.
    • It reduces the size of Angular framework as there is no need to download the compiled code.
    • Binding Errors can be detected earlier during the build phase before the users see them.
    • AOT reduces the chances of injection attacks as it compiles the code long before they are sent to the client.
    • AOT improves the number of asynchronous resource requests as it inlines the external HTML templates and styles.
Angular 9 onwards, AOT is the default compiler. For more refer AOT Compiler.

16. What are the Services in Angular?

In Angular services are the classes with well defined purpose. Services provide the functionality in a modular way which can be reused across the components. To share the data between components you can use services. You can make your components efficient by delegating some functionality code to services like fetch the data from server, validation rules etc. By defining this code into services you can make your code reusable to any component. You can create a service by using @Injectable decorator.

 // It's a self registering service, now no need to put this service in providers array in module or component
  providedIn: 'root', // to inject the dependency in root. 
export class UserService {

// You register a service at module level by setting the 'providers' property of @NgModule decorator. 
  providers: [

// You can also register a service at component level by settings 'providers' property of @Component decorator.
  selector:    'app-user-list',
  templateUrl: './user-list.component.html',
  providers:  [ UserService ]

17. How to make a service a singleton in Angular?

There are two ways to make a service a singleton as below.

  • First way is - inject the service in root by setting 'providedIn' property to 'root' in @Injectable decorator.
  • Second way is - include the service in AppModule only or in a module that is imported only in AppModule no where else.

18. What is the provider in Angular?

In Angular, dependency injection is used to inject the dependencies of services, A Provider works as an instructor for dependency injection system to resolve the dependencies. When you create any service it comes with a default @Injectable decorator that contains a default property 'providedIn' which creates the provider for service.

  providedIn: 'root',
export class DataService {
You can inject the services in the root or particular module as well and you can limit the scope of a service to a particular component by using component providers.

/* . . . . .*/
  providers: [DataService]

19. Explain the dependency injection in Angular?

Dependency Injection (DI) is a design pattern. Angular provides it's own dependency injection to Angular applications to increase their efficiency and modularity. Dependency is an object or class that another class needs to complete its operations, for example A 'UserComponent' needs 'UserService' to perform user operations. Angular DI framework injects the dependencies when it's instantiating the class or component.
In angular it's mandatory to create the service with @Injecible decorator. To get injected the service by dependency injection you need to specify providers.

  providedIn: 'root', // to inject the dependency in root
export class UserService {

//In user component constructor you can inject the dependency like this

constructor(userService: UserService){}
To configure providers at NgModule and Component level you can set the 'providers' metadata option of @Component and @NgModule decorators.

20. What is RxJS library?

RxJS (Reactive Extensions for JavaScript) is a library that uses the observable sequences for asynchronous and event-based or callback-based code. RxJS library has one core type 'Observable' and satellite types including (Observer, Schedulers, Subjects).
RxJS provides many operators to support the below features.

  • To map to different types.
  • Iteration
  • Filter
  • Composition of multiple streams
  • To perform asynchronous operations convert existing code into observables.
For more you can refer RxJS Library and Angular RxJS Library.

21. What are the observables in Angular?

In Angular, observables are used to achieve some common asynchronous operations as below.

  • Custom events are used to send observable output data from child to parent components.
  • Observables are used to handle Ajax requests and responses by HTTP Modules.
  • Observables are also used to listen and respond to the user-input events by Forms and Router Modules.
For More about Observables refer Observables in Angular.

22. What are the differences between Promises and Observables in Angular?

Observables are compared with Promises most of the time, there are a lot of differences in them as below.

  • Observables are declarative means execution starts only when you subscribe to them but Promises start the execution on the creation only.
  • Observables can provide multiple values over the time but Promises provide only one value.
  • Observables provide many functions to perform transformations but promises have only '.then' function.
  • Promises pass errors to child promises but Observable's subscribe method provides good error handling.

23.What is the subscribe method in Angular?

You need to subscribe to the instance to use published values from Observable instances. For this, observable instances provide the subscribe method and pass an object to receive notifications.

// Create simple observable that emits three values
const testObservable = of(4, 5, 6);

// Create observer object
const tstObserver = {
  next: value => console.log('Observer got a next value that is: ' + value),
  error: err => console.error('Observer got an error: ' + err),
  complete: () => console.log('Observer got a complete notification'),

// Execute with the observer object
// Logs:
// Observer got a next value: 4
// Observer got a next value: 5
// Observer got a next value: 6
// Observer got a complete notification

24. How does routing work in Angular?

Angular configure routes in the AppRoutingModule file. To configure routes first import the AppRoutingModule file in your AppModule and add it to the imports array.

import { AppRoutingModule } from './app-routing.module'; // CLI imports AppRoutingModule
import { AppComponent } from './app.component';

  declarations: [AppComponent],
  imports: [AppRoutingModule] // CLI adds AppRoutingModule to the AppModule's imports array
To define and configure the routes perform below steps.
  • In AppRoutingModule import RouterModule and Routes.
  • Use Routes array to define your routes.
  • Configure routes to your application code.

import { Routes, RouterModule } from '@angular/router'; // 1. CLI imports router
const routes: Routes = [ { path: 'first-route', component: FirstRoute },
  { path: 'second-route', component: SecondRoute }]; // 2. sets up routes constant where you define your routes

// configures NgModule imports and exports
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
export class AppRoutingModule { 
// 3. configure routes
    <li><a routerLink="/first-route" routerLinkActive="active">First Route</a></li>
    <li><a routerLink="/second-route" routerLinkActive="active">Second Route</a></li>

25. Explain the route guards?

A User can navigate anywhere to the application at a moment of time, but sometimes you want to control the user access for various reasons as below.

  • Users must login.
  • You want to save some data before the user navigates.
  • you want to authorize the user.
  • You might ask the user to discard pending changes.
  • Many other reasons.
To handle these scenarios Angular provides the concept of guards that can be added to routes. Router's behavior can be controlled by guard's return value as below.
  • If value is true means navigation continues.
  • If the value is false, navigation stops.
  • If value is UrlTree means new navigation initiates for returned UrlTree.

26.What is Root Module in Angular?

Every Angular application has at least one module, You bootstrap that module to launch the application. This module is called Root Module. When you create an angular application then you get by default one NgModule with the name AppModule called root module.

27. Explain the feature module and types of feature modules.

Angular provides one NgModule by default when you create any new angular application. As your application functionality grows then you can create a feature module responsible for a particular set of functionality. for example you can create routingModule for routes, for customer functionality customerModule etc. You can create a feature module using the below command and then you can import this feature module to your root module's import array.

ng generate module CustomerDashboard
There are 5 types of feature modules as below.
  • Domain feature modules
  • Routed feature modules
  • Routing modules
  • Service feature modules
  • Widget feature modules

28. Explain the lazy loading of feature modules.

In Angular by default all NgModules are eager loaded means they load as soon as the app loads. But for large applications where there are many routes you should prefer lazy loading. Lazy loading is a pattern that loads modules as needed. It improves loading time of application as initial size of bundle is less.
You can create a lazy loaded feature module as below.

  • You should create a feature module with angular CLI, using --route flag.
  • Configure the routes as per lazy loading guideline visit here Lazy Loading Angular Module.

29. What is the HTTP interceptor?

HTTP Interceptor intercepts and handles an HTTP request or response. You create your own interceptor by implementing the HttpInterceptor interface.

interface HttpInterceptor {
    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>
In case of multiple interceptors, the first interceptor transforms the request before passing it to next with 'next.handle(transformedReq)' method.
To use the same instance of HttpInterceptor for the entire application, import HttpClientModule in your appModule and add the interceptor to the root application injector. If you want to override this interceptor then specify another interceptor in the feature module.

30. Explain some common commands in Angular.

Angular provides many commands to perform operations as below.

  • npm install -g @angular/cli - to install angular cli.
  • ng help - list available commands with descriptions.
  • ng new my-first-project - create new angular workspace.
  • cd my-first-project - go to your app directory.
  • ng generate - generate new files or modify existing.
  • ng build - compile the app into an output directory named 'dist'.
  • ng serve - build and serve your application.
  • ng run - runs an application with custom build configuration.
  • ng update - update dependencies in your application.
  • ng version - gives current CLI version.
  • There are many other visit Angular CLI commands.

31. How will you create the library in Angular?

Some applications provide general solutions like a unified interface, some data operations apps etc. Developers can create these general applications as a library which can be reused in different applications via npm packages. An Angular library differs from an Angular Application in that it can not run on its own as it must be imported in any application.
You can create, build, run, lint an angular library with below commands.

ng generate library auth-lib  // to create library
ng build my-lib
ng test my-lib
ng lint my-lib

32. How will you publish any angular library?

Once you are ready with your angular library you can publish it to NPM repositories with below commands.

ng build my-lib --prod
cd dist/my-lib
npm publish
Here --prod flag specify to use older compiler and runtime instead of using Ivy in angular 9.

33. How to update your angular applications to the latest version of angular?

You can run a basic update command to update the latest stable release of angular CLI and angular core.

ng update @angular/cli @angular/core
Above command will update your application to the latest angular CLI and angular core. You can also update from one major version to another by specifying the version as below.

ng update @angular/cli@^9 @angular/core@^9
To check other dependencies you can visit Angular Update Guide and to set any options visit Angular ng update command.

34. What is Transpiling in Angular?

In Angular, Transpiling refers to the process of converting Typescript code into JavaScript code. It's done using a TypeScript compiler that's called a transpiler.

35. Describe the Bazel that was introduced in Angular 8.

Bazel is a build tool that works with angular CLI to build your application. The @angular/bazel package provides this build tool. To include bazel in an existing application use the below command.

ng add @angular/bazel
To use Bazel in a new application, first you need to install it globally using the below command.
npm install -g @angular/bazel
// and to create new application
ng new --collection=@angular/bazel
Now Bazel will be used behind the scene for the commands like ng build, ng serve. You can put the Bazel output in the dist/bin folder.

36. What is an Angular service worker?

Angular Service Worker is a script that runs in the browser and manages the caching for an application. It provides a good user experience with performance and reliability.
It works as a network proxy that intercepts all the HTTP requests and decides how to respond to them. It can serve the request from cache if it is available. Unlike Other Angular scripts, service worker is preserved after the user closes the tab. The next time the browser loads the application, first the service worker loads and intercept all the requests without the need of the network.

37. On what port Angular runs by default?

By default, Angular runs on the 4200 port that could be configured.

38. Explain the SPA (Single Page Application).

SPA (Single Page Application) is a type of web application that provides a good user experience by dynamically loading the selected part of the application instead of loading the full application. SPA has good speed and performance.

39. What is an AOT compiler?

Browser does not understand Angular code directly, so compilation is required to convert that code into efficient JavaScript code. A ahead-of-time (AOT) compiler compiles the Angular and HTML code during the build phase so that compiled JavaScript code is available for the browser to download and run. AOT compiler compiles the code during build phase so it makes rendering to be fast in the browser. For more visit AOT Compiler.

39. How to implement authentication in Angular Application?

40. Where you will store the token in cookies, session storage or local storage?

1. List some new features in Angular 9

Angular 9 released on 6th Feb 2020 with a stable version 9.0.0 release. It's a major release of Angular that covers the Angular Framework, CLI, Angular Material and Platform updates.
There are many new features provided in Angular 9 as below.

  • Project Ivy - A new compiler and runtime that all angular 9 applications will use by default.
  • ng update - is more informative and reliable to automatically use latest CLI, clearer progress update and easier update debugging
  • New additional options for providedIn to inject the services. One is platform and other is any
  • Providing support for TypeScript 3.7
  • An alternative approach to test the components called Component Harnesses
  • Improvements in IDE and language service
  • New Components - you can use youtube and Google maps inline in your application.

2. How to update to Angular version 9?

To update your project to Angular 9 First update your project to Latest Release of Angular 8 for better update experience as below.

ng update @angular/cli@8 @angular/core@8
Once you have updated to Angular 8 then update to Angular 9 or latest version of Angular as below.
ng update @angular/cli @angular/core
For detailed update changes follow Angular Official document Update to Angular 9.

3. What is Project Ivy in Angular 9?

Angular 9 has come with project Ivy with a lot of advantages as below. Ivy is a compiler and runtime. Angular version 9 allows all applications to use this Ivy compiler and runtime by default. There are many advantages of Ivy compiler and runtime.

  • Bundle sizes reduced - Ivy compiler generates lesser code for each angular component by removing the extra code which is not being used via tree-shaking.
  • Faster Testing - TestBed Implementation has been changed in Angular 9, As TestBed will not recompile all the components during the tests unless there are any changes made to components. So this improvement in TestBed increases the test speed to 40-50% faster.
  • Better Debugging -
  • CSS class and style binding improvements -
  • Type checking improvements -
  • Build errors improvement -
  • Build time improvements, AOT on by default enabled -
  • Internationalization improvements -
For more details on Project Ivy follow the link Project Ivy in Angular 9.

4. What are Component Harnesses in Angular 9?

Normally component testing relies on implementation details, if a component library changes it's implementation then all the test dependent on that component needs to be updated. But component harness API provides the capability of insulating or isolating for a test against the updates to component's internal changes in DOM structure.
So Component Harness provides an alternate approach to test the components. it will be available to component authors as a part of Component Dev Kit (CDK). Multiple environments can be supported by component harnesses, as only single harness implementation can be used for both unit testing and end to end testing.
Let's take a look at the example of Component Harness.

it("should switch to customer data template", async () => {
  const select = await loader.getHarness(MatSelect);
  await select.clickOptions({ text: "Bug" });

5. What are the new options for 'providedIn' in Angular 9?

Angular services are added to the injector using @Injectable decorator. Angular 9 is providing 2 more options to inject the services with existing additional options as below.

  • platform - When all applications on that page share a special singleton platform injector and you want a service to be available in that then you can specify providedIn:'platform'.
  • any - Whenever you want unique instance in every module (including lazy modules as well) which injects the token then you can specify providedIn:'any'.

6. How 'ng update' works in Angular 9?

Angular 9 has made 'ng update' more informative and reliable.

  • Always Latest CLI is used - While updates, CLI is used from destination version not latest but going forward updates will take the benefit of new update features automatically.
  • Will see progress updates clearly - Now 'ng update' will provide you complete information about migration.
  • Update debugging is easier - 'ng update' runs all migrations and you can inspect all changes after completion. But Angular 9 provides additional flag --create-commits. So when you run 'ng update --create-commits' then all migrations will run and after that tools will commit the code base state so that you can inspect and debug the changes made in your code.

7. What are the improvements in IDE and language service in Angular 9?

You can see some improvements to the Angular Language Service extension on visual studio marketplace. There were some bugs that have been fixed. Some other improvements include:

  • TextMate grammar behavior that provides syntax highlight ability in both in-line and external templates.
  • Hover tooltip will provide NgModule and Type information.
  • For templateUrl and styleUrls you can check definition by "Go to definition".

Some General Interview Questions for Angular

1. How much will you rate yourself in Angular?

When you attend an interview, Interviewer may ask you to rate yourself in a specific Technology like Angular, So It's depend on your knowledge and work experience in Angular.

2. What challenges did you face while working on Angular?

This question may be specific to your technology and completely depends on your past work experience. So you need to just explain the challenges you faced related to Angular in your Project.

3. What was your role in the last Project related to Angular?

It's based on your role and responsibilities assigned to you and what functionality you implemented using Angular in your project. This question is generally asked in every interview.

4. How much experience do you have in Angular?

Here you can tell about your overall work experience on Angular.

5. Have you done any Angular Certification or Training?

It depends on the candidate whether you have done any Angular training or certification. Certifications or training are not essential but good to have.


We have covered some frequently asked Angular Interview Questions and Answers to help you for your Interview. All these Essential Angular Interview Questions are targeted for mid level of experienced Professionals and freshers.
While attending any Angular Interview if you face any difficulty to answer any question please write to us at Our IT Expert team will find the best answer and will update on the portal. In case we find any new Angular questions, we will update the same here.