Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f79ec1b

Browse files
author
Jeff Sanchez
committed
Corrected soem typos; added some additional questions
1 parent 77a1445 commit f79ec1b

File tree

1 file changed

+60
-5
lines changed

1 file changed

+60
-5
lines changed

‎README.md

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# 90+ Angular 2+ Interview Questions And Answers
1+
# 100+ Angular 2, 4 and 5 Interview Questions And Answers
22

33
This is a collection of Angular 2 interview questions I've found online, along with (hopefully) correct answers for most of them. Feel free to contribute / send corrections.
4+
I'm adding in some Angular 4 and 5 questions now.
45

5-
Note: "PA" = Possible Answer (one of many valid ones), and "A" = Answer (when there's clearly just one right answer).
6+
Note: "PA" stands for Possible Answer (one of many valid ones).
67

78
## Template Syntax Questions
89

@@ -14,6 +15,10 @@ A: A variable (defined using a #) in a component template, which can be referenc
1415

1516
A: Interpolation binding, one way binding, two way binding.
1617

18+
**What's the difference between binding a value with or without square brackets, i.e.: `<input attr="something" />` vs `<input [attr]="something" />`?**
19+
20+
A: The square brackets will cause "something" to be evaluated as an expression, as opposed to just be passed in as a literal string.
21+
1722
**What does the ngFor template syntax look like?**
1823

1924
A: example:`<ul><li *ngFor="let val of values">{{val}}</li></ul>`
@@ -33,7 +38,7 @@ A: A grouping element that does not interfere with styles or layout (it's analog
3338

3439
**What is `<ng-template>`?**
3540

36-
A: It's an Angular element for rendering HTML when using structural directives. The ng-template itself does not render to anything but a commment directly.
41+
A: It's an Angular element for rendering HTML when using structural directives. The ng-template itself does not render to anything but a comment directly.
3742

3843

3944
## Component/Directive Questions
@@ -74,6 +79,14 @@ A: For example: `<div [ngClass]="{firstCondition: 'class1', secondCondition: 'cl
7479

7580
A: By specifying the moduleId to be module.id in the Component decorator. (Note: while this is still needed when using SystemJS, it is not necessary anymore when using Webpack module bundler for Angular 2 projects.)
7681

82+
**What are dynamic components?**
83+
84+
A: Components that are added at runtime (i.e. not fixed). For example, an ad banner component that is determined at runtime.
85+
86+
**What is ComponentFactoryResolver used for?**
87+
88+
A: A class that is used to create dynamic components - it produces a ComponentFactory for a particular component which can then be loaded into view via a createComponent on ViewContainerRef.
89+
7790

7891
## NgModules Questions:
7992

@@ -125,6 +138,14 @@ A: Yes.
125138

126139
A: Components, pipes, directives
127140

141+
**What is the providers property used for in a module's NgModule metadata?**
142+
143+
A: To provide a list of service cerators that this module contributes to the global collection of services.
144+
145+
**What is bootstrapping in Angular?**
146+
147+
A: The mechanism that launches the application in Angular, loading the root module (typically called AppModule) which loads one or more bootstrapped components into the application's DOM.
148+
128149
## Services Questions:
129150

130151
**What is the use case of services?**
@@ -192,7 +213,7 @@ A: Stateful, asynchronous
192213

193214
**What types of pipes are supported in Angular 2?**
194215

195-
A: Pure and impure pipes (async pipes a kind of impure pipe).
216+
A: Pure and impure pipes (async pipes are a kind of impure pipe).
196217

197218
## Routing Questions:
198219

@@ -314,6 +335,28 @@ A: Verifying some field using some asynchronous call (perhaps a server call)...
314335

315336
A: Setting a form value (one or more fields with an object) bypassing validation.
316337

338+
## Observables Questions
339+
340+
**What are observables?**
341+
342+
A: They provide a declarative way of message passing between publishers and subscribers in an application. They typically produce one or more values over time, which are subscribed to by observers. They provide some advantages over promises.
343+
344+
**What is RxJS?**
345+
346+
A: RxJS stands for Reactive Extensions for JavaScript, and is a reactive programming library centered around observables and operators making it easier to write complex asynchronous code.
347+
348+
**How do observables differ from promises?**
349+
350+
A: Observables are declarative; promises execute immediately upon creation. Observables can provide many values, whereas promises provide one value. Observables are cancellable, whereas promiess aren't. Error handling also differs between them.
351+
352+
**What are some advantages to using observables?**
353+
354+
A: Observables are cancellable; they come with powerful transformative functions (especially when using RxJS) to make asynchronous coding easier.
355+
356+
**Does an observable compute anything if it has no calls to subscribe?**
357+
358+
A: No, it will not.
359+
317360
## Animations Questions
318361

319362
**How do you define transition between two states?**
@@ -334,9 +377,13 @@ A: Services, Templates, Modules, Components, Providers, etc.
334377

335378
A: Ahead of time compilation.
336379

380+
**What is Reactive programming and how does it relate to Angular?**
381+
382+
A: It's an "asynchronous programming paradigm concerned with data streams and the propagation of change."
383+
337384
**What are some differences between Angular 2 and 4?**
338385

339-
A: Improvements in AOT; allowing else clause in ngIf, few other things...
386+
A: Improvements in AOT, allowing the "else" clause in ngIf, support for TypeScript 2.1, breaking out the animations package...
340387

341388
**What are some security related features built in to the Angular framework?**
342389

@@ -366,6 +413,14 @@ A: In the tsconfig.json file.A
366413

367414
A: Linting the TypeScript code (making sure it conforms to certain standards / conventions).
368415

416+
**What are some changes introduced in Angular 4?**
417+
418+
A: Introduction of the else clause in ngIf; splitting out of animation package; support for TypeScript 2.1; improvements around AOT.
419+
420+
**What are some changes introduced in Angular 5?**
421+
422+
A: New version of HttpClient; build optimizer; Universal State Transfer API (allows sharing state of app between server and client easily); support for TypeScript 2.3.
423+
369424
## API Questions:
370425

371426
**What does this line do?**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /