Add office photos
Cognizant logo
Engaged Employer

Cognizant

Verified
3.7
based on 50.3k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Reactjs Developer
Clear (1)

Cognizant Reactjs Developer Interview Questions and Answers

Updated 23 Dec 2024

Q1. What is closure in javascript?

Ans.

Closure is a feature in JavaScript that allows a function to access variables in its outer scope.

  • A closure is created when a function is defined inside another function.

  • The inner function has access to the outer function's variables and parameters.

  • The outer function's variables and parameters are not accessible from outside the closure.

  • Closures can be used to create private variables and methods.

  • Example: function outer() { let x = 10; function inner() { console.log(x); } retu...read more

Add your answer
right arrow

Q2. what are ES6 features?

Ans.

ES6 features are new additions to JavaScript language syntax and functionality.

  • Arrow functions

  • Template literals

  • Let and const keywords

  • Destructuring assignment

  • Spread and rest operators

  • Classes

  • Modules

  • Promises

  • Default parameters

  • Object.assign()

  • Symbol data type

Add your answer
right arrow

Q3. Coding question | How to reverse string

Ans.

To reverse a string, iterate through the characters and swap them from start to end.

  • Create an empty string to store the reversed result.

  • Iterate through the characters of the input string from end to start.

  • Append each character to the empty string to reverse the order.

  • Return the reversed string.

View 1 answer
right arrow

Q4. Explain about the redux workflow

Ans.

Redux workflow involves actions, reducers, and store to manage application state.

  • Actions are dispatched to describe what happened in the application

  • Reducers specify how the application's state changes in response to actions

  • Store holds the application state and allows access to it

  • Components can subscribe to the store to receive updates when the state changes

Add your answer
right arrow
Discover Cognizant interview dos and don'ts from real experiences

Q5. What is virtual DOM

Ans.

Virtual DOM is a lightweight copy of the actual DOM that React uses to improve performance by minimizing actual DOM manipulations.

  • Virtual DOM is a concept where a lightweight copy of the actual DOM is created and manipulated by React.

  • React uses the virtual DOM to efficiently update the actual DOM by only making necessary changes.

  • When state or props change in a React component, a new virtual DOM representation is created and compared with the previous one to determine the mini...read more

Add your answer
right arrow

Q6. Create counter application

Ans.

Counter application using Reactjs

  • Create a React component for the counter

  • Use state to keep track of the count

  • Implement functions to increment and decrement the count

  • Display the count on the screen

Add your answer
right arrow

Q7. Splice & slice difference

Ans.

Splice is used to add/remove elements from an array, while slice is used to extract a portion of an array without modifying the original array.

  • Splice modifies the original array, while slice does not.

  • Splice can add elements, remove elements, or replace elements in an array.

  • Slice returns a new array with the selected elements from the original array.

  • Example: const arr = [1, 2, 3, 4, 5]; arr.splice(2, 1); // removes element at index 2, arr is now [1, 2, 4, 5]; const newArr = ar...read more

Add your answer
right arrow

Q8. Wat is the hooks

Ans.

Hooks are a feature in React that allow you to use state and other React features in functional components.

  • Hooks were introduced in React 16.8.

  • They allow you to use state and other React features without writing a class component.

  • Some commonly used hooks are useState, useEffect, useContext, and useRef.

  • Hooks must be used at the top level of a functional component.

  • Hooks can be custom created as well.

Add your answer
right arrow

More about working at Cognizant

Back
Awards Leaf
AmbitionBox Logo
Top Rated Mega Company - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated IT/ITES Company - 2024
Awards Leaf
HQ - Teaneck. New Jersey., United States (USA)
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Cognizant Reactjs Developer

based on 4 interviews
1 Interview rounds
Technical Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Reactjs Developer Interview Questions from Similar Companies

Infosys Logo
3.6
 • 34 Interview Questions
TCS Logo
3.7
 • 16 Interview Questions
NeoSOFT Logo
3.7
 • 12 Interview Questions
Uplers Logo
4.0
 • 11 Interview Questions
View all
Recently Viewed
REVIEWS
HSBC Electronic Data Processing
No Reviews
INTERVIEWS
Cognizant
10 top interview questions
INTERVIEWS
Cognizant
100 top interview questions
INTERVIEWS
Cognizant
10 top interview questions
INTERVIEWS
Cognizant
10 top interview questions
INTERVIEWS
Tech Mahindra
No Interviews
DESIGNATION
INTERVIEWS
Cognizant
30 top interview questions
INTERVIEWS
Cognizant
No Interviews
DESIGNATION
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter