Cognizant
Promien Consultancy Services Interview Questions and Answers
Q1. How to share data one component to another
Using services or @Input/@Output decorators to share data between components
Use services to create a shared data service that can be injected into multiple components
Use @Input decorator to pass data from parent to child component
Use @Output decorator with EventEmitter to emit events and pass data from child to parent component
Q2. What is Pipe?
Pipe is a feature in Angular that allows transforming data before displaying it in the view.
Pipes are used to format and filter data in Angular templates.
They can be used to transform data types, apply currency and date formatting, and filter data based on certain criteria.
Pipes can be chained together to perform multiple transformations on the same data.
Custom pipes can also be created to perform specific transformations not provided by the built-in pipes.
Q3. How do you implement a login page
Implementing a login page involves creating a form for users to input their credentials and validating them against a database.
Create a login form with fields for username and password
Use Angular's form validation to ensure required fields are filled out
Send the user's credentials to a backend server for authentication
Upon successful authentication, redirect the user to the main application page
Q4. Promise vs Observables?
Promises are used for asynchronous operations that return a single value, while Observables are used for streams of data.
Promises return a single value, while Observables can return multiple values over time.
Observables can be cancelled, while Promises cannot.
Observables have operators like map, filter, and reduce, while Promises do not.
Observables are lazy, meaning they only execute when subscribed to, while Promises execute immediately.
Promises are easier to understand and ...read more
Q5. how does 2 components communicate
Components can communicate using @Input and @Output decorators, services, and event emitters.
Use @Input decorator to pass data from parent to child component
Use @Output decorator and EventEmitter to emit events from child to parent component
Use services to share data between components
Q6. Http request in angular
Http request in Angular is used to fetch data from a server or API.
Use HttpClient module to make HTTP requests in Angular
Subscribe to the Observable returned by the HTTP request to get the data
Handle errors using catchError operator
Set headers, query parameters, and request body as needed
More about working at Cognizant
Interview Process at Promien Consultancy Services
Top Angular Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month