Angular Interview Questions

Want to become an expert in cracking Angular interview questions?

Start with practicing the questions below. Whether a question involves multiple choice or live coding, we will give you hints as you go and tell you if your answers are correct or incorrect.

After that, take our timed public Angular Interview Questions Test.

To use our service for testing candidates, buy a pack of candidates.


1. Component

Angular Components Public

Which of the following statements about components in Angular are correct?

(multiple correct answers possible)

Easy  
2min
   


2. Welcome

Angular Components Public New

Consider the following component:

import { Component, Input } from '@angular/core';

@Component({
  selector: 'welcome',
  template: `<h1>Welcome to {{name}}!</h1>`,
  styles: [`h1 { font-family: Lato; }`]
})
export class WelcomeComponent  {
  @Input() name: string;
}

Select the statements about its use (in another components template) that are correct.

(multiple correct answers possible)

Easy  
3min
   


3. Animal Noise

Angular Expressions Public

Consider the following component, which can be used to model an animal and the noise it makes.

import {Component, Input, Output} from '@angular/core';

@Component({
  selector: 'animal-noise',
  template: `
    <span>{{animal}}</span>
    <button (click)="makeNoise()">Make noise</button>
  `
})
export class AnimalNoise {
  @Input('animal') animal: string;
  @Input('noise') noise: string;

  makeNoise() {
    alert(`${this.noise}`);
  }
}

Select the statements about the AnimalNoise component that are correct.

(multiple correct answers possible)

Easy  
5min
   


4. Router Module

Angular Routing Public

Consider the following application module:

import { NgModule }             from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent }        from './home.component';
import { ItemDetailComponent }  from './item-detail.component';
const routes: Routes = [
    { path: '', redirectTo: '/home', pathMatch: 'full' },
    { path: 'home',  component: HomeComponent },
    { path: 'detail/:id', component: ItemDetailComponent, outlet: 'route1' }
];
@NgModule({
    imports: [ RouterModule.forRoot(routes) ],
    exports: [ RouterModule ]
})
export class AppRoutingModule {}

Which of the following statements about the routers behavior are correct?

(multiple correct answers possible)

Hard  
3min
   


If you feel ready, take one of our timed public Angular Interview Questions tests:
  • Angular Online Test (Easy / Hard)
  • Angular and TypeScript Online Test (Easy / Hard)
Not exactly what you are looking for? Go to our For Jobseekers section.