i
Cognizant
Filter interviews by
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
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.
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 c...
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
What people are saying about Cognizant
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...
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 ...
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
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.
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.
I applied via Naukri.com and was interviewed in Aug 2023. There were 3 interview rounds.
Asked about vanilla.js in react interview.
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.
I applied via Naukri.com and was interviewed in May 2022. There was 1 interview round.
I applied via Company Website and was interviewed in May 2021. There were 3 interview rounds.
I applied via LinkedIn and was interviewed in Jun 2021. There was 1 interview round.
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope.
Variables declared with var are hoisted to the top of their scope
Function declarations are hoisted before variables
Function expressions are not hoisted
Hoisting can lead to unexpected behavior and bugs
useEffect is a hook in React that allows you to perform side effects in functional components.
It replaces componentDidMount, componentDidUpdate, and componentWillUnmount.
It takes two arguments: a function that performs the side effect and an array of dependencies.
The function is called after every render, unless the dependencies haven't changed.
Common use cases include fetching data, setting up event listeners, and upd...
Function currying is a technique of transforming a function that takes multiple arguments into a sequence of functions that each take a single argument.
Currying allows partial application of a function.
It helps in creating reusable functions.
Curried functions are composable and can be easily combined to create new functions.
Currying can be achieved using closures or by using libraries like Lodash or Ramda.
Example: cons...
Closures are functions that have access to variables in their outer scope, even after the outer function has returned.
Closures are created when a function is defined inside another function.
The inner function has access to the outer function's variables and parameters.
Closures can be used to create private variables and methods.
Closures can also be used to create functions with pre-set arguments.
based on 4 interview experiences
Difficulty level
Duration
based on 6 reviews
Rating in categories
Associate
73k
salaries
| ₹5.3 L/yr - ₹12.5 L/yr |
Programmer Analyst
56.2k
salaries
| ₹3.5 L/yr - ₹7.3 L/yr |
Senior Associate
55.1k
salaries
| ₹9.7 L/yr - ₹23.4 L/yr |
Senior Processing Executive
29.8k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
Technical Lead
19k
salaries
| ₹6 L/yr - ₹21 L/yr |
TCS
Infosys
Wipro
Accenture