
Accenture


10+ Accenture Front end Developer Interview Questions and Answers
Q1. How to redirect to login page through React Router if the user has not logged in and trying to go to another page through URL.
Use React Router's Redirect component to redirect to login page if user is not logged in.
Create a PrivateRoute component that checks if user is logged in
If user is not logged in, redirect to login page using Redirect component
Wrap the routes that require authentication with PrivateRoute component
Q2. How can you only accept jpg and png files using HTML5.
Use the accept attribute in the input tag to only allow jpg and png files.
Add accept attribute to input tag with 'image/jpeg, image/png' value
This will restrict file selection to only jpg and png files
Q3. How to center align a div in just one line in css.
Use flexbox to center align a div in just one line in CSS.
Set the parent container's display property to flex.
Use the justify-content property with the value 'center' to horizontally center the div.
Use the align-items property with the value 'center' to vertically center the div.
Q4. Remove duplicate elements from an Array
Remove duplicate elements from an Array
Use the Set object to remove duplicate elements
Convert the Set back to an array using the spread operator
If the array contains objects, use a custom comparison function
Q5. What is event bubling
Event bubbling is the process of propagating an event from the innermost element to its parent elements in the DOM hierarchy.
Events in JavaScript are triggered on elements and then propagate up the DOM tree.
During event bubbling, an event triggered on a child element will also trigger on its parent elements.
This allows for event delegation, where a single event handler can be used for multiple elements.
Event.stopPropagation() can be used to stop the event from further propaga...read more
Q6. How you can improve performance in Angular App
Improving performance in Angular app involves optimizing code, reducing HTTP requests, lazy loading modules, and using AOT compilation.
Optimize code by avoiding unnecessary watchers and using track by in ngFor loops
Reduce HTTP requests by combining multiple requests into one using HTTP interceptors
Lazy load modules to only load components when needed, improving initial load time
Use Ahead-of-Time (AOT) compilation to pre-compile templates and improve load time
Q7. How to adjust a box on left?
To adjust a box on the left, use CSS properties like margin-left or left.
Use margin-left property to adjust the box's position to the right.
Use left property with position: absolute or position: relative to adjust the box's position relative to its containing element.
Consider using flexbox or grid layout for more control over the box's positioning.
Q8. How to handle form validation?
Form validation can be handled using client-side and server-side validation techniques.
Use HTML5 form validation attributes like required, pattern, min, max, etc.
Implement client-side validation using JavaScript to provide instant feedback to users.
Perform server-side validation to ensure data integrity and security.
Display error messages next to the input fields for better user experience.
Use a combination of front-end and back-end validation to prevent malicious attacks.
Q9. What are CSS accessibilities?
CSS accessibilities refer to making web content accessible to users with disabilities.
Using proper color contrast for text and background
Providing alternative text for images using the 'alt' attribute
Using semantic HTML elements for better screen reader compatibility
Q10. what is promises in js?
Promises in JavaScript are objects representing the eventual completion or failure of an asynchronous operation.
Promises help in handling asynchronous operations in a more readable and manageable way.
They can be in one of three states: pending, fulfilled, or rejected.
Promises can be chained together using .then() method to handle success and failure cases.
They help in avoiding callback hell and writing cleaner asynchronous code.
Example: const myPromise = new Promise((resolve,...read more
Q11. Explain the concept of redux-toolkit
Redux Toolkit is an official, opinionated, batteries-included toolset for efficient Redux development.
Redux Toolkit simplifies Redux code by providing a set of tools and best practices
It includes utilities like createSlice, createReducer, configureStore, and createAsyncThunk
Helps in writing concise and readable Redux code with less boilerplate
Encourages the use of Immer for writing immutable updates in a more intuitive way
Q12. How to use Redux
Redux is a predictable state container for JavaScript apps.
Create a store to hold the state of your application
Use actions to describe what happened
Write reducers to specify how the state changes in response to actions
Connect your components to the Redux store using mapStateToProps and mapDispatchToProps
Q13. Explain promise in javascript
Promises in JavaScript are objects representing the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations in JavaScript.
They can be in one of three states: pending, fulfilled, or rejected.
Promises can be chained using .then() to handle success and .catch() to handle errors.
Example: new Promise((resolve, reject) => { ... }).then(result => { ... }).catch(error => { ... });
Q14. Let and var difference
let is block scoped, var is function scoped
let is block scoped, var is function scoped
let can't be re-declared in the same scope, var can be
let variables are not hoisted, var variables are hoisted
Q15. create a Custom hooks
Custom hooks are reusable functions that allow you to extract component logic into separate functions for reusability.
Custom hooks start with 'use' keyword (e.g. useState, useEffect)
Custom hooks can be used to share logic between components
Custom hooks can accept arguments and return values
More about working at Accenture










Interview Process at Accenture Front end Developer

Top Front end Developer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

