Angular interview questions for experience and freshers
- What are building blocks of angular ?
- Can you explain angular architecture in depth and how it works behind the scene?
- Can you explain the angular lifecycle hooks?
- In angular we have Template Driven Form, Reactive Form and Signal based Form, Explain which one you should use and when ?
- For Example your APIs are authenticated once you loggedin got the token how do you pass the token in all the APIs?
- What is difference between pure and impure pipes?
- Can you explain the realtime scenario of Custom Directive in angular?
- Can we create Custom Tooltip using Custom Directive if yes How?
- How do we create html from the Custom Directive?
- What is use of viewChilld in angular?
- What is the porpose of Hostlistener?
- What is use of Service in angular?
- What are Oprators in RXJS you have used till now?
- How do you make sure your angular Performace is upto the mark?
- For example You have one service injected in a component and in that service I have a fuction and returning the loggedIn username, Can you directly call the serrvice in HTML and get the function?
- For example I have one big form and 70/80 fields are there, How can I make it everything dynamic with “Reactive From”?
- What is ngContent in angular?
- What all are “Decorator” available in angular?
- What are the modules required for “Reactive Form” ?
- What are the possible way to transfer data between two components?
- What are the features available in “NgModule”?
- When we compare Angular and React both the architecture how does both behave?
- For Example with client discussion same application is developed with Angular and same application is developed with React which will work faster?
3. Suppose a new client came and the project discussion is completed and asked in which technology I should go with Angular or React? and why?
Ans: Angular provide the stability, It is scalable, both are component base when we look for angular it has everything what it needs rarely we need thirparty library for specific feature. But React heavily dependent on third party library.
when React is more suitable when the UI is more dynamic like facebook app when add comment comment box should get populated like reply dynamic UI will render.
But in normal application like admin kind, banking, insurence like we have form and crud operation like add, edit, delete it is not change the UI very dynamically.
React it works in “Virtual Dom” it is very fast it will update that section and will patch the real dom.
4. From Angular 17 we got standalone component what will happen to modules?
5. Explain dependency injection how does it work?
Ans: Dependency Injection allows you to create an object of your services more easily. when ever we are creatingthe injectable what are the services are there. Services are injectable.
Lets we have a service and we want to create an object of that service in to our component so we used Dependency Injection rather than manually create the object by ourself by using new operator.