i
Cognizant
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
I applied via Naukri.com and was interviewed in May 2022. There was 1 interview round.
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...
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
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
I applied via Naukri.com and was interviewed in Mar 2024. There was 1 interview round.
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 elem...
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.
What people are saying about Cognizant
I applied via Naukri.com and was interviewed in Aug 2023. There were 3 interview rounds.
Asked about vanilla.js in react interview.
Cognizant interview questions for designations
I applied via Naukri.com and was interviewed before Apr 2023. There were 2 interview rounds.
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
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 create...
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.
Get interview-ready with Top Cognizant Interview Questions
I applied via Naukri.com and was interviewed in Dec 2024. There was 1 interview round.
Development dependencies are needed for development and testing, while regular dependencies are needed for the application to run.
Development dependencies are used during the development process, such as testing frameworks or build tools.
Regular dependencies are required for the application to function properly in production.
Development dependencies are typically listed in the devDependencies section of package.json, w...
Symbols ^ and ~ in package.json represent version ranges for dependencies.
The symbol ^ represents a range that allows minor version updates.
The symbol ~ represents a range that allows only patch updates.
For example, ^1.2.3 allows any version from 1.2.3 to <2.0.0, while ~1.2.3 allows any version from 1.2.3 to <1.3.0.
404 page can be handled in React routing by creating a Route component with a path of '*' at the end of all other routes.
Create a Route component with a path of '*' at the end of all other routes in the Switch component.
Inside the '*' Route component, render a custom 404 page component.
Use the Switch component to ensure that only one Route is rendered at a time.
Component lifecycle in functional components involves useEffect hook for side effects.
Functional components use useEffect hook to handle side effects like fetching data, subscribing to events, etc.
useEffect hook can be used to mimic componentDidMount, componentDidUpdate, and componentWillUnmount lifecycle methods.
useEffect hook takes a callback function as its first argument and an optional array of dependencies as its...
Redux data flow is a unidirectional flow of data in React applications using a centralized store.
Actions are dispatched to the store
Reducers update the state based on the action
Components subscribe to the store to access the updated state
I applied via LinkedIn and was interviewed in Oct 2024. There was 1 interview round.
React offers advantages such as virtual DOM for improved performance, reusable components, and easy integration with other libraries.
Virtual DOM for efficient updates and improved performance
Reusable components for easier development and maintenance
Easy integration with other libraries like Redux for state management
Support for server-side rendering for better SEO performance
Performance optimization in React Js can be achieved through code splitting, memoization, virtualization, and minimizing re-renders.
Implement code splitting to load only necessary components when needed
Use memoization techniques like useMemo and useCallback to prevent unnecessary re-renders
Implement virtualization for long lists or tables to render only visible items
Minimize re-renders by using shouldComponentUpdate or
useMemo and useCallback are hooks in React used for optimizing performance by memoizing values and functions respectively.
useMemo is used to memoize the result of a function so that it is only recomputed when its dependencies change.
useCallback is used to memoize a function instance so that it is not recreated on every render unless its dependencies change.
Both hooks help in optimizing performance by preventing unneces...
1 Interview rounds
based on 4 reviews
Rating in categories
Associate
72.4k
salaries
| ₹5.1 L/yr - ₹15.9 L/yr |
Programmer Analyst
55.4k
salaries
| ₹2.4 L/yr - ₹9.6 L/yr |
Senior Associate
48.3k
salaries
| ₹8.9 L/yr - ₹27.1 L/yr |
Senior Processing Executive
28.6k
salaries
| ₹1.8 L/yr - ₹9 L/yr |
Technical Lead
17.6k
salaries
| ₹5.9 L/yr - ₹24.2 L/yr |
TCS
Infosys
Wipro
Accenture