SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
FullStack.Cafe - Never Fail Tech Interview
(https://www.fullstack.cafe)
26 Top Angular 8 Interview Questions To Know in 2020
Originally published on 26 Top Angular 8 Interview Questions To Know in 2020 | FullStack.Cafe
(https://www.fullstack.cafeblogangular-8-interview-questions)
Q1 : Explain the difference between Promise and Observable in Angular?
Q2 : Why should ngOnInit be used, if we already have a constructor?
Q3 : What is AOT?
Q4 : What is the use of codelyzer?
Q5 : What is the purpose of Wildcard route?
Q6 : What are custom elements?
Q7 : What are the utility functions provided by RxJS?
Q8 : What is subscribing?
Q9 : What's new in Angular 8?
Q10 : Angular 8: What is Bazel?
Q11 : Angular 8: What is Angular Ivy?
Q12 : Angular 8: Explain Lazy Loading in Angular 8?
Q13 : How to detect a route change in Angular?
Q14 : Are there any pros/cons (especially performance-wise) in using local storage to replace
cookie functionality?
Q15 : What is Zone in Angular?
Q16 : What does a just-in-time (JIT) compiler do (in general)?
Q17 : What is ngUpgrage?
Q18 : What is incremental DOM? How is it different from virtual DOM?
Q19 : Angular 8: Why we should use Bazel for Angular builds?
Q20 : Explain the purpose of Service Workers in Angular
Q21 : What is the Angular equivalent to an AngularJS "$watch"?
Q22 : Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation. Explain the difference.
Q23 : Why did the Google team go with incremental DOM instead of virtual DOM?
Q24 : Why Incremental DOM is Tree Shakable?
Q25 : Angular 8: How does Ivy affect the (Re)build time?
Q26 : Angular 8: What are some changes in Location module?
## Answers
Q1: Explain the difference between Promise and Observable in Angular? ★★★
Topic: Angular
Promises:
return a single value
not cancellable
more readable code with try/catch and async/await
Observables:
work with multiple values over time
cancellable
support map, filter, reduce and similar operators
use Reactive Extensions (RxJS)
an array whose items arrive asynchronously over time
Q2: Why should ngOnInit be used, if we already have a constructor? ★★★
Topic: Angular
The Constructor is a default method of the class that is executed when the class is instantiated and
ensures proper initialization of fields in the class and its subclasses.
ngOnInit is a life cycle hook called by Angular2 to indicate that Angular is done creating the
component.
Mostly we use ngOnInit for all the initialization/declaration and avoid stuff to work in the constructor. The
constructor should only be used to initialize class members but shouldn't do actual "work". So you should use
constructor() to setup Dependency Injection and not much else. ngOnInit() is better place to "start" - it's
where/when components' bindings are resolved.
Q3: What is AOT? ★★★
Topic: Angular
The Angular Ahead-of-Time compiler pre-compiles application components and their templates during the
build process.
Apps compiled with AOT launch faster for several reasons.
Application components execute immediately, without client-side compilation.
Templates are embedded as code within their components so there is no client-side request for
template files.
You don't download the Angular compiler, which is pretty big on its own.
The compiler discards unused Angular directives that a tree-shaking tool can then exclude.
Q4: What is the use of codelyzer? ★★★
Topic: Angular
All enterprise applications follows a set of coding conventions and guidelines to maintain code in better way.
Codelyzer is an open source tool to run and check whether the pre-defined coding guidelines has been
followed or not. Codelyzer does only static code analysis for angular and typescript project.
Codelyzer runs on top of tslint and its coding conventions are usually defined in tslint.json file. Codelyzer can
be run via angular cli or npm directly. Editors like Visual Studio Code and Atom also supports codelyzer just
by doing a basic settings.
Q5: What is the purpose of Wildcard route? ★★★
Topic: Angular
If the URL doesn't match any predefined routes then it causes the router to throw an error and crash the app.
In this case, you can use wildcard route. A wildcard route has a path consisting of two asterisks to match
every URL.
For example, you can define PageNotFoundComponent for wildcard route as below
{ path: '**', component: PageNotFoundComponent }
Q6: What are custom elements? ★★★
Topic: Angular
Custom elements (or Web Components) are a Web Platform feature which extends HTML by allowing you to
define a tag whose content is created and controlled by JavaScript code. The browser maintains a
CustomElementRegistry of defined custom elements, which maps an instantiable JavaScript class to an
HTML tag. Currently this feature is supported by Chrome, Firefox, Opera, and Safari, and available in other
browsers through polyfills.
Q7: What are the utility functions provided by RxJS? ★★★
Topic: Angular
The RxJS library also provides below utility functions for creating and working with observables.
1. Converting existing code for async operations into observables
2. Iterating through the values in a stream
3. Mapping values to different types
4. Filtering streams
5. Composing multiple streams
Q8: What is subscribing? ★★★
Topic: Angular
An Observable instance begins publishing values only when someone subscribes to it. So you need to
subscribe by calling the subscribe() method of the instance, passing an observer object to receive the
notifications.
Let's take an example of creating and subscribing to a simple observable, with an observer that logs the
received message to the console.
Creates an observable sequence of 5 integers, starting from 1
const source = range(1, 5);
// Create observer object
const myObserver = {
next: x => console.log('Observer got a next value: ' + x),
error: err => console.error('Observer got an error: ' + err),
complete: () => console.log('Observer got a complete notification'),
};
// Execute with the observer object and Prints out each item
myObservable.subscribe(myObserver);
// => Observer got a next value: 1
// => Observer got a next value: 2
// => Observer got a next value: 3
// => Observer got a next value: 4
// => Observer got a next value: 5
// => Observer got a complete notification
Q9: What's new in Angular 8? ★★★
Topic: Angular
This release is mostly about Ivy and the possibility to give it a try, but it also includes a few features and
breaking changes, namely:
Differential loading - with differential loading, two bundles are created when building for production:
a bundle for modern browsers that support ES2015+ and a bundle for older browsers that only
support the ES5 version of JavaScript
TypeScript 3.4 support
Ivy - it is the new compiler/runtime of Angular. It will enable very cool features in the future, but it is
currently focused on not breaking existing applications.
Bazel support - it is a build tool developed and massively used by Google, as it can build pretty
much any language.
Lazy-loading with import() syntax
// from
loadChildren: './admin/admin.module#AdminModule'
// to
loadChildren: () => import('./races/races.module').then(m => m.RacesModule)
To help people migrating from AngularJS, a bunch of things have been added to the location
services in Angular
The service worker registration has a new option that allows to specify when the registration should
take place.
@angular/http has been removed from 8.0, after being replaced by @angular/common/http in 4.3
and officially deprecated in 5.0,
Q10: Angular 8: What is Bazel? ★★★
Topic: Angular
Google open sourced the software responsible for building most of its projects under the name Bazel. Bazel
is a powerful tool which can keep track of the dependencies between different packages and build targets.
Some of the features of Bazel are:
It has a smart algorithm for determining the build dependencies - based on the dependency graph
of a project, Bazel determines which targets it can build in parallel
Bazel is independent of the tech stack. We can build anything we want with it using the same
interface. For example, there are plugins for Java, Go, TypeScript, JavaScript, and more
Q11: Angular 8: What is Angular Ivy? ★★★
Topic: Angular
A big part of Angular is its compiler: it takes all your HTML and generates the necessary JS code. This
compiler (and the runtime) has been completely rewritten over the last year, and this is what Ivy is about.
The last rewrite was done in Angular 4.0.
Ivy is a complete rewrite of the compiler (and runtime) in order to:
reach better build times (with a more incremental compilation)
reach better build sizes (with a generated code more compatible with tree-shaking)
unlock new potential features (metaprogramming or higher order components, lazy loading of
component instead of modules, a new change detection system not based on zone.js…)
Q12: Angular 8: Explain Lazy Loading in Angular 8? ★★★
Topic: Angular
Lazy loading is one of the most useful concepts of Angular Routing and brings down the size of large files.
This is done by lazily loading the files that are required occasionally.
Angular 8 comes up with support for dynamic imports in our router configuration. This means that we use the
import statement for lazy loading the module and this will be understood by the IDEs, webpack, etc.
Angular 7:
{path: ‘user’, loadChildren: ‘./users/user.module#UserModule’}
Angular 8:
{path: ‘user’, loadChildren: () => import(‘./users/user.module’).then(m => m.UserModule)};
New with Angular 8, loadChildren expects a function that uses the dynamic import syntax to import your lazy-
loaded module only when it’s needed. As you can see, the dynamic import is promise-based and gives you
access to the module, where the module’s class can be called.
Q13: How to detect a route change in Angular? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q14: Are there any pros/cons (especially performance-wise) in using local storage to
replace cookie functionality? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q15: What is Zone in Angular? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q16: What does a just-in-time (JIT) compiler do (in general)? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q17: What is ngUpgrage? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q18: What is incremental DOM? How is it different from virtual DOM? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q19: Angular 8: Why we should use Bazel for Angular builds? ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q20: Explain the purpose of Service Workers in Angular ★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q21: What is the Angular equivalent to an AngularJS "$watch"? ★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q22: Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation. Explain the difference.
★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q23: Why did the Google team go with incremental DOM instead of virtual DOM?
★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q24: Why Incremental DOM is Tree Shakable? ★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q25: Angular 8: How does Ivy affect the (Re)build time? ★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)
Q26: Angular 8: What are some changes in Location module? ★★★★★
Topic: Angular
Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)

Weitere ähnliche Inhalte

Was ist angesagt?

Use Cases for JNBridgePro in the Cloud
Use Cases for JNBridgePro in the CloudUse Cases for JNBridgePro in the Cloud
Use Cases for JNBridgePro in the CloudJNBridge
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorialvinayiqbusiness
 
S60 3rd FP2 Widgets
S60 3rd FP2 WidgetsS60 3rd FP2 Widgets
S60 3rd FP2 Widgetsromek
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Ben Edwards
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring FrameworkEdureka!
 
WebSphere Connect and API Discovery
WebSphere Connect and API DiscoveryWebSphere Connect and API Discovery
WebSphere Connect and API Discovery Arthur De Magalhaes
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Courseguest764934
 
Google app engine
Google app engineGoogle app engine
Google app engineSuraj Mehta
 
Going MicroServices with Net
Going MicroServices with NetGoing MicroServices with Net
Going MicroServices with NetDavid Revoledo
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersJithin Kuriakose
 
Enterprise Spring Building Scalable Applications
Enterprise Spring Building Scalable ApplicationsEnterprise Spring Building Scalable Applications
Enterprise Spring Building Scalable ApplicationsGordon Dickens
 
Ibm xamarin gtruty
Ibm xamarin gtrutyIbm xamarin gtruty
Ibm xamarin gtrutyRon Favali
 
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services AccessibleUsing IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services AccessibleArthur De Magalhaes
 

Was ist angesagt? (20)

Use Cases for JNBridgePro in the Cloud
Use Cases for JNBridgePro in the CloudUse Cases for JNBridgePro in the Cloud
Use Cases for JNBridgePro in the Cloud
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
S60 3rd FP2 Widgets
S60 3rd FP2 WidgetsS60 3rd FP2 Widgets
S60 3rd FP2 Widgets
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
 
WebSphere Connect and API Discovery
WebSphere Connect and API DiscoveryWebSphere Connect and API Discovery
WebSphere Connect and API Discovery
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
Google App Engine tutorial
Google App Engine tutorialGoogle App Engine tutorial
Google App Engine tutorial
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Angularj2.0
Angularj2.0Angularj2.0
Angularj2.0
 
Going MicroServices with Net
Going MicroServices with NetGoing MicroServices with Net
Going MicroServices with Net
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
Enterprise Spring Building Scalable Applications
Enterprise Spring Building Scalable ApplicationsEnterprise Spring Building Scalable Applications
Enterprise Spring Building Scalable Applications
 
Ibm xamarin gtruty
Ibm xamarin gtrutyIbm xamarin gtruty
Ibm xamarin gtruty
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services AccessibleUsing IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
 

Ähnlich wie 26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]

Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAlbiorix Technology
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29Nitin Bhojwani
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answersAnil Singh
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questionsGoa App
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshareSaleemMalik52
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular applicationSuresh Patidar
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Ahmed Bouchefra
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Angular 12 brought several new features to the table
Angular 12 brought several new features to the tableAngular 12 brought several new features to the table
Angular 12 brought several new features to the tableMoon Technolabs Pvt. Ltd.
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfiFour Technolab Pvt. Ltd.
 
Angular 7: Everything You Need to Know!
Angular 7: Everything You Need to Know!Angular 7: Everything You Need to Know!
Angular 7: Everything You Need to Know!Helios Solutions
 
Angular version 10 is here check out the new features, notable changes, depr...
Angular version 10 is here  check out the new features, notable changes, depr...Angular version 10 is here  check out the new features, notable changes, depr...
Angular version 10 is here check out the new features, notable changes, depr...Katy Slemon
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Nisheed Jagadish
 

Ähnlich wie 26 top angular 8 interview questions to know in 2020 [www.full stack.cafe] (20)

What is Angular Ivy?
What is Angular Ivy?What is Angular Ivy?
What is Angular Ivy?
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
 
What’s New in Angular 15.pptx
What’s New in Angular 15.pptxWhat’s New in Angular 15.pptx
What’s New in Angular 15.pptx
 
Angular
AngularAngular
Angular
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answers
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 
THE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JSTHE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JS
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Angular 12 brought several new features to the table
Angular 12 brought several new features to the tableAngular 12 brought several new features to the table
Angular 12 brought several new features to the table
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Angular IO
Angular IOAngular IO
Angular IO
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
 
Angular 7: Everything You Need to Know!
Angular 7: Everything You Need to Know!Angular 7: Everything You Need to Know!
Angular 7: Everything You Need to Know!
 
Angular version 10 is here check out the new features, notable changes, depr...
Angular version 10 is here  check out the new features, notable changes, depr...Angular version 10 is here  check out the new features, notable changes, depr...
Angular version 10 is here check out the new features, notable changes, depr...
 
Angular Js
Angular JsAngular Js
Angular Js
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0
 

Kürzlich hochgeladen

Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...
Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...
Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...ZurliaSoop
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaonmeghakumariji156
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Angela Justice, PhD
 
Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........deejay178
 
UIowa Application Instructions - 2024 Update
UIowa Application Instructions - 2024 UpdateUIowa Application Instructions - 2024 Update
UIowa Application Instructions - 2024 UpdateUniversity of Iowa
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...nirzagarg
 
B.tech civil major project by Deepak Kumar
B.tech civil major project by Deepak KumarB.tech civil major project by Deepak Kumar
B.tech civil major project by Deepak KumarDeepak15CivilEngg
 
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...vershagrag
 
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfDMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfReemaKhan31
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Juli Boned
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...ZurliaSoop
 
b-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardb-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardramyaul734
 
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...HyderabadDolls
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证eqaqen
 
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 

Kürzlich hochgeladen (20)

Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...
Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...
Jual obat aborsi Dubai ( 085657271886 ) Cytote pil telat bulan penggugur kand...
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
 
Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........
 
UIowa Application Instructions - 2024 Update
UIowa Application Instructions - 2024 UpdateUIowa Application Instructions - 2024 Update
UIowa Application Instructions - 2024 Update
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
 
B.tech civil major project by Deepak Kumar
B.tech civil major project by Deepak KumarB.tech civil major project by Deepak Kumar
B.tech civil major project by Deepak Kumar
 
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
 
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfDMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
 
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
b-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardb-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state board
 
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...
Howrah [ Call Girls Kolkata ₹7.5k Pick Up & Drop With Cash Payment 8005736733...
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
 
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
 
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Shillong [ 7014168258 ] Call Me For Genuine Models ...
 

26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]

  • 1. FullStack.Cafe - Never Fail Tech Interview (https://www.fullstack.cafe) 26 Top Angular 8 Interview Questions To Know in 2020 Originally published on 26 Top Angular 8 Interview Questions To Know in 2020 | FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q1 : Explain the difference between Promise and Observable in Angular? Q2 : Why should ngOnInit be used, if we already have a constructor? Q3 : What is AOT? Q4 : What is the use of codelyzer? Q5 : What is the purpose of Wildcard route? Q6 : What are custom elements? Q7 : What are the utility functions provided by RxJS? Q8 : What is subscribing? Q9 : What's new in Angular 8? Q10 : Angular 8: What is Bazel? Q11 : Angular 8: What is Angular Ivy? Q12 : Angular 8: Explain Lazy Loading in Angular 8? Q13 : How to detect a route change in Angular? Q14 : Are there any pros/cons (especially performance-wise) in using local storage to replace cookie functionality? Q15 : What is Zone in Angular? Q16 : What does a just-in-time (JIT) compiler do (in general)? Q17 : What is ngUpgrage? Q18 : What is incremental DOM? How is it different from virtual DOM? Q19 : Angular 8: Why we should use Bazel for Angular builds? Q20 : Explain the purpose of Service Workers in Angular Q21 : What is the Angular equivalent to an AngularJS "$watch"? Q22 : Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation. Explain the difference. Q23 : Why did the Google team go with incremental DOM instead of virtual DOM?
  • 2. Q24 : Why Incremental DOM is Tree Shakable? Q25 : Angular 8: How does Ivy affect the (Re)build time? Q26 : Angular 8: What are some changes in Location module?
  • 3. ## Answers Q1: Explain the difference between Promise and Observable in Angular? ★★★ Topic: Angular Promises: return a single value not cancellable more readable code with try/catch and async/await Observables: work with multiple values over time cancellable support map, filter, reduce and similar operators use Reactive Extensions (RxJS) an array whose items arrive asynchronously over time Q2: Why should ngOnInit be used, if we already have a constructor? ★★★ Topic: Angular The Constructor is a default method of the class that is executed when the class is instantiated and ensures proper initialization of fields in the class and its subclasses. ngOnInit is a life cycle hook called by Angular2 to indicate that Angular is done creating the component. Mostly we use ngOnInit for all the initialization/declaration and avoid stuff to work in the constructor. The constructor should only be used to initialize class members but shouldn't do actual "work". So you should use constructor() to setup Dependency Injection and not much else. ngOnInit() is better place to "start" - it's where/when components' bindings are resolved. Q3: What is AOT? ★★★ Topic: Angular The Angular Ahead-of-Time compiler pre-compiles application components and their templates during the build process. Apps compiled with AOT launch faster for several reasons. Application components execute immediately, without client-side compilation. Templates are embedded as code within their components so there is no client-side request for template files. You don't download the Angular compiler, which is pretty big on its own. The compiler discards unused Angular directives that a tree-shaking tool can then exclude. Q4: What is the use of codelyzer? ★★★ Topic: Angular
  • 4. All enterprise applications follows a set of coding conventions and guidelines to maintain code in better way. Codelyzer is an open source tool to run and check whether the pre-defined coding guidelines has been followed or not. Codelyzer does only static code analysis for angular and typescript project. Codelyzer runs on top of tslint and its coding conventions are usually defined in tslint.json file. Codelyzer can be run via angular cli or npm directly. Editors like Visual Studio Code and Atom also supports codelyzer just by doing a basic settings. Q5: What is the purpose of Wildcard route? ★★★ Topic: Angular If the URL doesn't match any predefined routes then it causes the router to throw an error and crash the app. In this case, you can use wildcard route. A wildcard route has a path consisting of two asterisks to match every URL. For example, you can define PageNotFoundComponent for wildcard route as below { path: '**', component: PageNotFoundComponent } Q6: What are custom elements? ★★★ Topic: Angular Custom elements (or Web Components) are a Web Platform feature which extends HTML by allowing you to define a tag whose content is created and controlled by JavaScript code. The browser maintains a CustomElementRegistry of defined custom elements, which maps an instantiable JavaScript class to an HTML tag. Currently this feature is supported by Chrome, Firefox, Opera, and Safari, and available in other browsers through polyfills. Q7: What are the utility functions provided by RxJS? ★★★ Topic: Angular The RxJS library also provides below utility functions for creating and working with observables. 1. Converting existing code for async operations into observables 2. Iterating through the values in a stream 3. Mapping values to different types 4. Filtering streams 5. Composing multiple streams Q8: What is subscribing? ★★★ Topic: Angular An Observable instance begins publishing values only when someone subscribes to it. So you need to subscribe by calling the subscribe() method of the instance, passing an observer object to receive the notifications. Let's take an example of creating and subscribing to a simple observable, with an observer that logs the received message to the console.
  • 5. Creates an observable sequence of 5 integers, starting from 1 const source = range(1, 5); // Create observer object const myObserver = { next: x => console.log('Observer got a next value: ' + x), error: err => console.error('Observer got an error: ' + err), complete: () => console.log('Observer got a complete notification'), }; // Execute with the observer object and Prints out each item myObservable.subscribe(myObserver); // => Observer got a next value: 1 // => Observer got a next value: 2 // => Observer got a next value: 3 // => Observer got a next value: 4 // => Observer got a next value: 5 // => Observer got a complete notification Q9: What's new in Angular 8? ★★★ Topic: Angular This release is mostly about Ivy and the possibility to give it a try, but it also includes a few features and breaking changes, namely: Differential loading - with differential loading, two bundles are created when building for production: a bundle for modern browsers that support ES2015+ and a bundle for older browsers that only support the ES5 version of JavaScript TypeScript 3.4 support Ivy - it is the new compiler/runtime of Angular. It will enable very cool features in the future, but it is currently focused on not breaking existing applications. Bazel support - it is a build tool developed and massively used by Google, as it can build pretty much any language. Lazy-loading with import() syntax // from loadChildren: './admin/admin.module#AdminModule' // to loadChildren: () => import('./races/races.module').then(m => m.RacesModule) To help people migrating from AngularJS, a bunch of things have been added to the location services in Angular The service worker registration has a new option that allows to specify when the registration should take place. @angular/http has been removed from 8.0, after being replaced by @angular/common/http in 4.3 and officially deprecated in 5.0, Q10: Angular 8: What is Bazel? ★★★ Topic: Angular
  • 6. Google open sourced the software responsible for building most of its projects under the name Bazel. Bazel is a powerful tool which can keep track of the dependencies between different packages and build targets. Some of the features of Bazel are: It has a smart algorithm for determining the build dependencies - based on the dependency graph of a project, Bazel determines which targets it can build in parallel Bazel is independent of the tech stack. We can build anything we want with it using the same interface. For example, there are plugins for Java, Go, TypeScript, JavaScript, and more Q11: Angular 8: What is Angular Ivy? ★★★ Topic: Angular A big part of Angular is its compiler: it takes all your HTML and generates the necessary JS code. This compiler (and the runtime) has been completely rewritten over the last year, and this is what Ivy is about. The last rewrite was done in Angular 4.0. Ivy is a complete rewrite of the compiler (and runtime) in order to: reach better build times (with a more incremental compilation) reach better build sizes (with a generated code more compatible with tree-shaking) unlock new potential features (metaprogramming or higher order components, lazy loading of component instead of modules, a new change detection system not based on zone.js…) Q12: Angular 8: Explain Lazy Loading in Angular 8? ★★★ Topic: Angular Lazy loading is one of the most useful concepts of Angular Routing and brings down the size of large files. This is done by lazily loading the files that are required occasionally. Angular 8 comes up with support for dynamic imports in our router configuration. This means that we use the import statement for lazy loading the module and this will be understood by the IDEs, webpack, etc. Angular 7: {path: ‘user’, loadChildren: ‘./users/user.module#UserModule’} Angular 8: {path: ‘user’, loadChildren: () => import(‘./users/user.module’).then(m => m.UserModule)}; New with Angular 8, loadChildren expects a function that uses the dynamic import syntax to import your lazy- loaded module only when it’s needed. As you can see, the dynamic import is promise-based and gives you access to the module, where the module’s class can be called. Q13: How to detect a route change in Angular? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q14: Are there any pros/cons (especially performance-wise) in using local storage to replace cookie functionality? ★★★★
  • 7. Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q15: What is Zone in Angular? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q16: What does a just-in-time (JIT) compiler do (in general)? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q17: What is ngUpgrage? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q18: What is incremental DOM? How is it different from virtual DOM? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q19: Angular 8: Why we should use Bazel for Angular builds? ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q20: Explain the purpose of Service Workers in Angular ★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q21: What is the Angular equivalent to an AngularJS "$watch"? ★★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q22: Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation. Explain the difference. ★★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q23: Why did the Google team go with incremental DOM instead of virtual DOM? ★★★★★
  • 8. Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q24: Why Incremental DOM is Tree Shakable? ★★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q25: Angular 8: How does Ivy affect the (Re)build time? ★★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions) Q26: Angular 8: What are some changes in Location module? ★★★★★ Topic: Angular Read Full Answer on FullStack.Cafe (https://www.fullstack.cafeblogangular-8-interview-questions)