KEMBAR78
Quick answers to Angular2+ Interview Questions | PPTX
Quick Answers to
ANGULAR
Interview Questions
QUICK ANSWERS
Here are some answers to common Angular interview
questions. That's Angular 2+, not AngularJS.
They’re quick, not really extended and are not in any
particular order. Let’s get it on!
Answer:
A Web Client Side framework that runs on Typescript.
1) What's Angular?
Answer:
Modules, Components, Templates, Directives, Data Binding,
Services, Dependency Injection & Routing
2) Which are the Angular Building Blocks?
Answer:
Compiling from TypeScript to Javascript
3) What's transpiling?
Answer:
ngOnChanges
4) Which execution component triggers on data-bound
input updates?
Answer:
A Component is a web application small part. A Directive
adds functionality to a DOM element.
5) What's the difference between Components and
Directives?
Answer:
A Directive to pass data to a child component.
6) What's the @Input decorator?
Answer:
A Directive to set an event to which a parent component can
subscribe.
7) What's the @Output decorator?
Answer:
It's a Directive to put some html content inside DOM
element.
8) What's ng-content?
Answer:
A method in the Router service that allow us to navigate to
component in a Single-Page-Application.
9) What's router.navigate?
Answer:
A method to encapsulate styles in a component, and has
three types: Emulated to allow other's components styles,
Native to ignore other component's styles and None to allow
other's components visibility.
10) Wha'ts ViewEncapsulation?
Answer:
A shared clas, code that we can use across components.
11) What's a Service
Answer:
It's a pattern that allow us to provide dependencies during
runtime asking rather than creating. It's a way to instance
once and pass by reference in any other call.
12) What's Dependency Injection?
Answer:
It's a way to emulate navigation in SPA's.
13) What's Routing?
Answer:
It's a Directive that allow us to render the components at an
specific location.
14) What's a RouterOutlet?
Answer:
With (event)="method()" Directive to route the event to a TS
method.
15) How to handle Events?
Answer:
String Interpotation: The content between the double curly
brackets is evaluated and the result replaces the string.
16) What's {{}}?
Answer:
Property, Event, Two Way & String Interpolation.
17) Which are the DataBinding types?
Answer:
OnChange -> OnInit ->DoCheck -> AfterContentInit ->
AfterContentChecked -> AfterViewInit -> AfterViewChecked ->
OnDestroy.
18) What's the Life-cycle Hooks sequence?
Answer:
It's a dependencies & configuration file that contains
information about the current package, its dependencies
and their versions
19) What's package.json?
Answer:
A Single-Page-Application, an entire application in a single
html page using javascript to emulate navigation and to
content the whole app logic.
20) What's a SPA?
Answer:
It's a small part of the application, an HTML block able to be
bound to data.
21) What's a Component?
Answer:
It's a directive for two-way data binding.
22) What's NgModel?
Answer:
It's a method for subscription to an event, in order to trigger
a function when it happens.
23) What's subscribe?
Answer:
Observables are lazy, they wait till the events occurs and can
handle may subscriptions. Promises are eager, immediatly
executes and handle a single event.
24) What's the difference between Observables &
Promises?
Answer:
It's a Directive that allow us to bind data asynchronously in a
string interpolation, using a Promise or Observable directly
instead of a property or variable.
25) What's an AsyncPipe?
Answer:
It's using an API on the server side to validate credentials
and return a JWT.
26) What's authentication?
Answer:
It's validating access to components or specific data for a
specific user in the client side application.
27) What's authorization?
Answer:
It's compiling typescript and html files into Javascript on
build time.
28) What's AOT compilation?
Answer:
It's a library that uses the Store pattern to access global data
client side in the application.
29) What's Redux?
Answer:
Directives that allow us to format the result in a String
Interpolation.
30) What's pipes?
Answer:
ngClass loads a css class, ngStyle sets css styles.
31) What's the difference between ngClass and ngStyle?
Answer:
Functions that allow a building block to be configured before
to be used, adding metadata to the object.
32) What's a decorator?
Answer:
The equivalent to the arguments object in Javascript to
handle the arguments array.
33) What's a rest parameter?
Answer:
*ngFor="let item of collection"
34) What's the ngFor syntax?
Answer:
FormsModule
35) What's the ngModel module?
Answer:
ReactiveFormsModule
36) What's the ReactiveForms module?
Answer:
ReactiveFormsModule
36) What's the ReactiveForms module?
Answer:
e = new EventEmitter<type>();
37) How to define custom event?
Answer:
A Decorator to access HTML element alias in a component
38) What's @ViewChild?
Answer:
Template Driven uses two-way data binding, automatic track
of data while Reactive Forms is event based.
39) Difference between Template Driven Forms &
ReactiveForms?
Answer:
Validator are pre-build functions to handle form validations
like min, max, required, etc.
40) What's Validators?
Answer:
A Provider is a Service.
41) What's a Provider?
Answer:
It's a method that returns an NgModule and its provider
dependencies.
42) What's 'forRoot'?
Answer:
It's a way to not load every module at once, but on demand,
using 'loadChildren' instead of 'component' in routing.
43) What's Lazy Loading?
Answer:
A function's parameter that may not be specified when
calling the function.
44) What's an optional parameter?
Answer:
It's Javascript runtime environment, able to run Javascript
browserless, as an interpreter.
45) What's NodeJS?
Answer:
It's package manager for NodeJS, able to install and manage
dependencies for Javascript projects.
46) What's NPM?
Answer:
It's the module bundler used by angular.
47) What's Webpack?
Answer:
Create, Render, Create and Render childs, Check databoubd
changes & re-render & destroy.
48) What's Angular Component Life Cycle?
Answer:
It's an object that represents the data emitted by an event.
49) What's $event?
Answer:
A Decorator to describe a module.
50) What's NgModule?
Answer:
It's a hook, a function trigger for a specific moment, ngOnInit
happens after first display of data-bound properties and
setup of directives.
51) What's ngOnInit?
Answer:
Unit testing validate isolated pieces of code & E2E validate
an integrated set of components.
52) Difference between Unit & E2E testing
Answer:
On Unit testing.
53) When to use test doubles?
Answer:
Model-View-Controller pattern separates data, UI and logic in
different pieces of code, the controller populates data ad
pass it to the view for the user.
54) Explain MVC
Answer:
Reactive interface, faster integration, concern separation,
modular client server independent.
55) Which are the MVC benefits?
Answer:
template, templateUrl, selector, styles, stylesUrls, animation,
interpolation, inputs, outputs, providers.
56) Which are some component decorator options?
THANKS!
I am Luis Espino
I am here because I love to spread knowledge.
I wish this info will help you. You can find me at
@espino316. Checkout my projects at luis.espino.info

Quick answers to Angular2+ Interview Questions