Tuesday, July 24, 2018

Interview

1.What is Node.js
2.Difference between bootstrap 3 and bootstrap 4.
3.Polymorphism and encapsulation in JavaScript.
Ans : https://www.javatpoint.com/javascript-oops-polymorphism
https://medium.com/javascript-scene/encapsulation-in-javascript-26be60e325b4
4.Common files in distrbution package in angular Js
5.How can we create singleton in angular
  There are two ways to make a service a singleton in Angular:  
  Set the providedIn property of the @Injectable() to "root".
  Include the service in the AppModule or in a module that is only imported by the AppModule
  
6.If starting page of application is slow then how you will check the performance.
Ans : Check if lazy loading applied or not. To make it fast lazy loading should be applied.

7.How will you check memory leak in your application in angular
open the Chrome Dev Tools, open the panel on the right and click on More Tools > Performance Monitor.
8.What is new in angular5
9.What is EventEmitter?
EventEmitter used in components with the @Output directive to emit custom events synchronously or asynchronously, and register handlers for those events by subscribing to an instance
10.Which one is better to write filter logic client side or server side if records are 1000.
Ans : Server side.
11.How will you fetch data in one go or in parts.
Ans : in parts
12.If some data is coming from an api where it get stored? Is it stored somewhere? (Browser, PC).
Ans : No where
13.What is benefit of linting?
Ans : A linter is a program that can analyze source code in a particular programming language and flag potential problems like syntax errors, deviations from a prescribed coding style, or using constructs known to be unsafe. For example a JavaScript linter would flag the first use of parseInt below as unsafe:

// Unsafe without a radix argument
var count1 = parseInt(countString);

// Safe because a radix is specified
var count2 = parseInt(countString, 10);

14.Difference between JIT and AOT?
  Just-in-Time (JIT), compiles your app in the browser at runtime.
Ahead-of-Time (AOT), compiles your app at build time on the server.
JIT compilation is the default when you run the ng build (build only) or ng serve (build and serve locally) CLI commands. This is for development.

For AOT compilation, include the --aot option with the ng build or ng serve command. Another ways is using --prod which by default production mode is configured in Angular.json with AOT is set to true
15.What does CLI do?
Ans: CLI gives command to scafolding, create component create module.

16.Tell me some commands for CLI?
Ans : ng build, ng g c cusotm, ng g s user
17.Who does minification and bundling? What is the benefit?
Ans : Webpack
18.Why the build generated by AOT is faster?
19.How the typescript get transplied? What is the output?
Ans :

20.What is benefit of SPA?
Ans:
1. Only data comes from server instead of complete html
2. Easy to deploye in comparision of Server side application.

3. Fast 
  Battery reusability
Optimization
Client-side rendering
User experience
Easy debugging
Performance
Less complex implementation
Better caching
Better SEO optimization
Disadvantages of Single-page Apps
There are also some disadvantages to using single-page apps:

Single-page apps use JavaScript, so it can be difficult to trace errors.
Users need to turn on JavaScript in their web browser or the application won’t work.
Memory leaks may result in a performance dro .
Single-page apps are not suitable for enterprise-based applications, only for small and mid-size applications.
They have terrible maintainability due to using third-party plug-ins.
  

21.How will you start developing angular application?
22.We have requirement for TAB and Desktop to run application so what will you do in bootstrap?
And : Tab is medium and Desktop is large device

23.What will you do to support SAAS in angular?
Ans :  At the time of application creation it will ask you what you want to use css,saas,scss,less

24.How the web server will know which file is the entry file of application.
Ans Location Strategy
25.How will you secure api ?
Ans: Using token.

26.Whihc architechture angular follows?
Ans : There was much confusion about whether Angular was really Model-View Controller (MVC) or Model-View-ViewModel (MVVM) . In reality, it was neither! Rather, Angular follows a component-oriented architecture. Having said that, Angular does share some of the concepts of both MVC and MVVM.
Ans : https://www.htmlgoodies.com/javascript/the-model-view-viewmodel-pattern-and-angular-development
27. Post is cachable or not?
Ans
"Responses to POST method are not cacheable, UNLESS the response includes appropriate Cache-Control or Expires header fields."

So, YES, you can cache POST request response but only if it arrives with appropriate headers. In most cases you don't want to cache the response. But in some cases - such as if you are not saving any data on the server - it's entirely appropriate.


Note, however many browsers, including current Firefox 3.0.10, will not cache POST response regardless of the headers. IE behaves more smartly in this respect.


Cache-Control: max-age=3600

A PUT request cannot be cached. Moreover, it invalidates cached data for request to the same URI done via HEAD or GET:

PUT /pageX.html HTTP/1.1
(…)

200 OK
(…)
A specific Cache-Control header in the response can prevent caching:

GET /pageX.html HTTP/1.1
(…)

200 OK
Cache-Control: no-cache

(…)

No comments:

Followers

Link