i
Cognizant
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
I applied via Naukri.com and was interviewed in Aug 2024. There were 2 interview rounds.
Online Hackathon test was taken.
I was interviewed in May 2024.
Redux is a predictable state container for JavaScript apps.
Redux is a state management library for JavaScript applications.
It helps in managing the state of the application in a predictable way.
Redux stores the entire state of the application in a single immutable object.
Actions are dispatched to update the state, and reducers specify how the state changes in response to actions.
Redux is commonly used with React to man...
Virtual DOM is a lightweight copy of the actual DOM in memory, used by React to improve performance by minimizing actual DOM manipulations.
Virtual DOM is a concept where a lightweight copy of the actual DOM is kept in memory.
React uses Virtual DOM to improve performance by minimizing actual DOM manipulations.
When state changes in a React component, a new Virtual DOM representation is created and compared with the previ...
useMemo is used for memoizing expensive calculations, while React.memo is used for memoizing functional components.
useMemo is a hook used to memoize expensive calculations and only recompute the value when the dependencies change.
React.memo is a higher order component used to memoize functional components and prevent unnecessary re-renders.
useMemo is typically used for optimizing performance by caching values, while Re...
map returns a new array with modified elements, forEach does not return anything and just iterates over the array.
map returns a new array with the results of calling a provided function on every element in the array.
forEach executes a provided function once for each array element without returning anything.
Example: const numbers = [1, 2, 3]; const doubled = numbers.map(num => num * 2); // doubled will be [2, 4, 6]; num...
Find duplicates in an array of strings
Iterate through the array and use a hash map to keep track of the frequency of each element
If an element is already in the hash map, it is a duplicate
Currying is a technique in functional programming where a function with multiple arguments is transformed into a sequence of functions, each taking a single argument.
Currying helps in creating reusable functions and improving code readability.
It allows partial application of functions, where some arguments are fixed and others are left to be provided later.
Example: const add = (a) => (b) => a + b; add(2)(3) will return
I applied via Naukri.com and was interviewed in Sep 2023. There were 2 interview rounds.
A Higher Order Component (HOC) is a function that takes a component and returns a new component with additional functionality.
HOCs are used to share code between components, add additional features, or modify behavior.
They are commonly used for tasks like authentication, logging, and data fetching.
Example: const withAuth = (WrappedComponent) => { return class extends React.Component { render() { return
A custom hook is a reusable function that allows you to extract component logic into a separate function.
Custom hooks start with 'use' keyword.
Custom hooks can call other hooks if needed.
Custom hooks can be shared and reused across multiple components.
A closure function is a function that has access to its own scope, as well as the outer scope in which it was defined.
A closure function can access variables from its outer scope even after the outer function has finished executing.
Closures are commonly used to create private variables in JavaScript.
Example: function outerFunction() { let outerVar = 'I am outer'; return function innerFunction() { console.log(outerVar);...
What people are saying about Cognizant
I applied via Referral and was interviewed in May 2021. There was 1 interview round.
React hooks are functions that allow functional components to use state and lifecycle methods.
Introduced in React 16.8
useState() hook for managing state
useEffect() hook for lifecycle methods
useContext() hook for accessing context
useReducer() hook for managing complex state
Custom hooks for reusable logic
Difference between React.memo vs use memo vs useCallback
React.memo is a higher-order component that memoizes a functional component
useMemo is a hook that memoizes a value
useCallback is a hook that memoizes a function
React.memo and useMemo are used for performance optimization
useCallback is used to prevent unnecessary re-renders
Reconciliation is the process of updating the virtual DOM with changes made to the actual DOM.
Reconciliation is a process that React uses to update the UI efficiently.
It compares the previous and current states of the virtual DOM and updates only the necessary changes to the actual DOM.
Reconciliation is a key feature of React that makes it fast and efficient.
For example, when a user types in a search box, React updates...
Cognizant interview questions for designations
posted on 10 Dec 2024
I applied via Approached by Company and was interviewed in Nov 2024. There were 2 interview rounds.
Virtual DOM is a lightweight copy of the actual DOM, React key features include component-based architecture, declarative syntax, and virtual DOM, React Hooks are functions that let you use state and other React features without writing a class.
Virtual DOM is a lightweight copy of the actual DOM that React uses to improve performance by updating only the necessary parts of the DOM.
Key features of React include componen...
Prop drilling is the process of passing props down multiple levels of nested components in React.
Prop drilling occurs when a prop needs to be passed through multiple levels of components that do not need the prop themselves.
It can lead to unnecessary passing of props through intermediate components, making the code harder to maintain.
To avoid prop drilling, you can use Context API, Redux, or React's useContext and useR...
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope during the compilation phase.
Variable declarations are hoisted to the top of their scope, but not their assignments.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
useContext hook allows components to access data from a context without passing props down manually
useContext hook is used to consume a context created by React.createContext
It takes the context object as an argument and returns the current context value for that context
It allows components to subscribe to context changes and re-render when the context value changes
I applied via Approached by Company and was interviewed in Oct 2024. There was 1 interview round.
Debugger in JavaScript is used for pausing the execution of code to inspect variables, check the flow of the program, and debug errors.
Debugger helps in identifying and fixing bugs in the code.
It allows developers to step through code line by line to understand the flow of execution.
Developers can inspect variables and their values at different points in the code.
By setting breakpoints, developers can pause the code at...
I applied via Naukri.com and was interviewed in Jul 2024. There were 2 interview rounds.
Find the max values, promises, async await
posted on 8 Nov 2024
I applied via Naukri.com and was interviewed in May 2024. There were 2 interview rounds.
CORS error occurs when a web application makes a request to a different domain than the one it originated from.
CORS stands for Cross-Origin Resource Sharing
It is a security feature implemented by browsers to prevent unauthorized access to resources on a different domain
CORS error can be resolved by configuring the server to include the appropriate CORS headers in the response
Common CORS error messages include 'Access-C...
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() method to handle success and failure cases.
Promises help in avoiding callback hell and writing cleaner asynchronous code.
based on 2 reviews
Rating in categories
Associate
72.6k
salaries
| ₹5.1 L/yr - ₹16 L/yr |
Programmer Analyst
55.4k
salaries
| ₹2.4 L/yr - ₹9.7 L/yr |
Senior Associate
48.3k
salaries
| ₹8.9 L/yr - ₹27 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