Capgemini – Angular Interview Questions
Here is the list of Angular Interview Questions which are recently asked in Capgemini company. These questions are included for both Freshers and Experienced professionals. Our Angular Training has Answered all the below Questions.
1.What do you mean by String Interpolation?
string interpolation is the process of evaluating a string literal that contains one or more placeholders. It yields a result in which the placeholders are replaced with their values.String interpolation in Angular is used to display dynamic data on an HTML template.
2.What are the Differences between Angular Annotation and Decorator?
3. What is an AOT compilation in Angular?
The Angular ahead-of-time (AOT) compiler converts the Angular code into JavaScript code. The conversion happens before the browser downloads and runs the code. To achieve faster rendering in the browser, Compile your application during the build process.
4. What is ECMA Script ?
ECMAScript stands for European Computer Manufacturers Association Script.ECMAScript is a standard script language, developed with the cooperation of Netscape and Microsoft and mainly derived from Netscape's JavaScript, the widely-used scripting language that is used in Web pages.
5. What is @NgModule?
An NgModule is a class marked by the @NgModule decorator.@NgModule takes a metadata object that describes how to compile a component's template and how to create an injector at runtime.
It identifies the module's own components, directives, and pipes, making some of them public, through the exports property, so that external components can use them.
6. What are modules in Angular?
A module is a mechanism or container to group the components, directives, pipes and services.It helps to encapsulate the code that deals with several aspects of an application. Developers can create modules using the NgModule decorator.
7. How to perform CRUD operations using Spring Boot and Angular?
- Create & Setup Spring Boot project.
- Configure Spring Datasource, JPA, Hibernate.
- Define Data Model.
- Create Repository Interface.
- Create Spring Rest APIs Controller.
- Run the Spring Boot Server.
- Setup Angular 10 Project.
- Set up App Module.
- Define Routes for Angular AppRoutingModule
- Create Data Service
- Create Angular Components
- Run the Angular 10 App
8. What is Basic Authentication? How to implement it using Angular?
The Basic Authentication Interceptor intercepts http requests from the application to add basic authentication credentials to the Authorization header if the user is logged in. It's implemented using the HttpInterceptor class that was introduced in Angular 4.3 as part of the new HttpClientModule.
9. doAdd(1,2) doAdd( 1.2,3,4) use the above arguments to sum the values. using without any parameter receive through the function
10. What is Buffer (window storage)?
Angular window storage, offers an easy interface for usage of the web storage and cookies.It works as a store manager so no need to worry about where to store information.
11. Explain Life cycle in Angular?
In Angular, every component has a life-cycle, a number of different stages it goes through from initializing to destroying. There are 8 different stages in the component lifecycle and every stage is called life cycle hook events
12. What are the data bindings M angular?
Data-binding in AngularJS apps is the automatic synchronization of data between the model and view components. The way that AngularJS implements data-binding lets you treat the model as the single-source-of-truth in your application. The view is a projection of the model at all times.
13. When using ngIf if the condition is true. how to display the message and if the condition is false then how to display the message?
OR condition in *ngIf
Similary If you want to display the element with *ngIf only if one of the condition is true. We can use OR (||) operator.
14. Difference between directive and pipe in Angular?
Pipes are for formatting data, and directives are to alter the behavior/appearance of an element. A pipe is to manipulate data, while a directive is more for DOM manipulation.
A pipe gets data as an input, transforms it and outputs this data in another way. Directives are two types.
Free PDF : Get our updated Angular Course Content pdf
15. What is Traceur compiler ?
Traceur compiler takes classes, generators, and other features from ECMAScript edition 6 (ES6) and compiles it into JavaScript ES5 that runs on the browser. This means developers can use the code from a future version that has more features and encourages design patterns.
16. What is the Document Object Model?
The Document Object Model (DOM) is a programming API or object oriented representation for web documents. It represents the page and allows you to make changes. The DOM follows traditional object oriented design.
17. What does Angular Material mean?
Angular Material is a User Interface component library. It is used to speed up the development of the user interfaces. Angular Material offers reusable and beautiful UI components.It allows to develop fully functional web pages,and applications.
18. What are services in the Angular framework?
A service is a class or reusable code with a well-defined purpose. It allows defining functionality that are accessible and reusable in many other components.A single service performs only a single task. One component uses several services to achieve various tasks.
19. What is a template in Angular?
A template is a form of HTML which is a blueprint for UI. It contains attributes and elements. The template represents how to render the component. It provides a dynamic view to the end user.Also, it creates a complex view in an external HTML file.
20. What is @Inputs in Angular ?
A common pattern in Angular is sharing data between a parent component and one or more child components. @Input() and @Output() give a child component a way to communicate with its parent component. @Input() allows a parent component to update data in the child component.
21. What is @Outputs in angular?
A common pattern in Angular is sharing data between a parent component and one or more child components.@Input() and @Output() give a child component a way to communicate wi`th its parent component. @Input() allows a parent component to update data in the child component.
22. What are differences between Components and Directives?
Directives allowsto attach behavior to elements in the DOM.Angular components are a subset of directives. Unlike directives, components always have a template and only one component can be instantiated per an element in a template.” Angular 2 Components are an implementation of the Web Component concept.
23. What is an annotation in Angular?
Annotation is a block of text or metadata set in a class to represent an object with a string. It is used to detect errors by the compiler. Annotation can be edited at run time and displayed over a node.
24. Can we have any service for ngFor and ngIF in Angular
In Angular, we cannot use two structural directives on the same element. i.e., we cannot place *ngFor,*ngIf together on same element.
25. Difference between Angular 2, 4, 5, 6, &7
Angular 4 is an inheritance from Angular 2.In Angular 2 only TypeScript 1.8 version was supported, whereas, in Angular 4, it supports TypeScript 2.1 and TypeScript 2.2 compatibility, so can use all new features supported in TypeScript 2.1 and TypeScript 2.2 can be used in Angular 4 application.
Angular 7 focused more on upgrading the existing features rather than publishing maximum features which was the case with Angular 6.
26. Compiler in TypeScript
The TypeScript compiler (tsc) converts the instructions written in TypeScript to its JavaScript equivalent. The TypeScript Language Service − The "Language Service" exposes an additional layer around the core compiler pipeline that are editor-like applications.
27. How did you reverse a string?
function reverseString(s){
return s. split(""). reverse(). join("");
}
reverseString("Hello");//"olleH"
28. How did you get the value from input box using JQuery?
To get the textbox value, we can use the jQuery val() function. For example, $('input:textbox'). val() – Get textbox value.
Book a Free Mock Interviews and Test your Angular Knowledge with our Experts
TOP MNC's ANGULAR INTERVIEW QUESTIONS & ANSWERS
Here we listed all Angular Interview Questions and Answers which are asked in Top MNCs. Periodically we update this page with recently asked Questions, please do visit our page often and be updated in Angular .
To become a Angular Certified professional and join in your dream company, Enroll now for our Best Angular Training. We help you to crack any level of Angular Interviews and We offering Angular Training with 100% Placements.