i
Cognizant
Filter interviews by
Functional interfaces are interfaces with a single abstract method, enabling lambda expressions in Java.
A functional interface can have multiple default or static methods but only one abstract method.
Common examples include Runnable, Callable, and Comparator.
They are used primarily in Java's functional programming features, such as streams and lambda expressions.
You can define a functional interface using the @Fun...
A circuit breaker is a design pattern used to prevent system failure by managing service calls and handling failures gracefully.
Prevents cascading failures in distributed systems by stopping calls to a failing service.
Has three states: Closed (normal operation), Open (calls are blocked), and Half-Open (testing if the service is recoverable).
Example: In a microservices architecture, if Service A fails, the circuit ...
OOP is a programming paradigm based on objects, encapsulating data and behavior for modular and reusable code.
Encapsulation: Bundling data and methods that operate on the data within one unit (e.g., a class).
Inheritance: Mechanism to create a new class based on an existing class, inheriting its properties (e.g., a 'Dog' class inheriting from an 'Animal' class).
Polymorphism: Ability to present the same interface fo...
JSX is a syntax extension for JavaScript, commonly used with React to describe UI components in a declarative manner.
JSX allows HTML-like syntax in JavaScript, making it easier to visualize the UI structure.
Example: <div>Hello, World!</div> is JSX that renders a div element.
JSX is transpiled to JavaScript using tools like Babel, converting it to React.createElement calls.
JSX can embed JavaScript expres...
What people are saying about Cognizant
The code will throw an error because 'a' is declared but not initialized.
The code will result in a ReferenceError because 'a' is declared but not assigned a value.
Variables declared with 'const' must be initialized at the time of declaration.
Initializing 'a' with a value before calling test() will prevent the error.
The color applied will be based on the specificity of the selector, with ID having higher specificity than class.
ID has higher specificity than class in CSS
Color applied will be based on the selector with higher specificity
Example: If ID selector has color red and class selector has color blue, the color applied will be red
CSS can be used to arrange elements in a row and column layout using flexbox or grid layout properties.
Use display: flex; for a row layout and display: flex; flex-direction: column; for a column layout
Use justify-content and align-items properties to align items in the main axis and cross axis respectively
For grid layout, use display: grid; and grid-template-columns or grid-template-rows to define the layout
Shallow copy only copies the references of nested objects, while deep copy creates new copies of nested objects.
Shallow copy creates a new object but does not create copies of nested objects, only copies their references.
Deep copy creates a new object and also creates new copies of all nested objects.
Shallow copy can be achieved using Object.assign() or spread operator, while deep copy can be achieved using JSON.p...
Various methods for creating an object in JavaScript include object literals, constructor functions, ES6 classes, and Object.create() method.
Object literals: var obj = { key: value };
Constructor functions: function ObjectName() { this.key = value; } var obj = new ObjectName();
ES6 classes: class ClassName { constructor() { this.key = value; } } var obj = new ClassName();
Object.create() method: var obj = Object.crea...
Yes, I have experience working with semantic tags in HTML.
Used semantic tags like <header>, <nav>, <main>, <section>, <article>, <aside>, <footer> for better structure and SEO.
Understand the importance of using semantic tags for accessibility and search engine optimization.
Semantic tags help in organizing content and making it more readable for developers and browsers.
I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.
Custom hooks in React are reusable functions that allow you to extract component logic into separate functions for better code organization and reusability.
Custom hooks are created using the 'use' prefix and can be used to share logic between components.
Use cases for custom hooks include fetching data from an API, handling form state, managing local storage, and more.
Example of a custom hook for API call: const useFetc...
useMemo is used to memoize a value, while useCallback is used to memoize a function.
useMemo is used to memoize a value and recompute it only when its dependencies change.
useCallback is used to memoize a callback function and prevent unnecessary re-renders.
Example: useMemo can be used to memoize the result of a complex computation, while useCallback can be used to memoize an event handler function.
Class-based components use ES6 classes and have lifecycle methods, while functional components are simpler and use functions.
Class-based components use ES6 classes to create components, while functional components are created using functions.
Class-based components have lifecycle methods like componentDidMount and componentDidUpdate, while functional components do not.
Functional components are simpler and more lightweig...
Implementing the lifecycle of a React component in a functional component
Use the useEffect hook to replicate lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount
Pass an empty array as the second argument to useEffect to mimic componentDidMount
Pass a variable or state as the second argument to useEffect to mimic componentDidUpdate
Return a cleanup function inside useEffect to mimic compo...
Various state management techniques in React include Context API, Redux, and local state.
Context API: React's built-in solution for passing data through the component tree without having to pass props down manually at every level.
Redux: A popular state management library for React applications, allowing for a centralized store to manage application state.
Local state: Managing state within individual components using us...
Redux is a predictable state container for JavaScript apps. Middlewares are functions that intercept actions before they reach the reducer.
Redux follows a unidirectional data flow architecture.
Middlewares in Redux are functions that can intercept, modify, or dispatch actions.
Common use cases for middlewares include logging, asynchronous API calls, and handling side effects.
Examples of popular Redux middlewares are Redu...
Hoisting in JavaScript is the behavior 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 initializations.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
Event bubbling is the propagation of events from the target element up through its ancestors in the DOM tree.
Events triggered on a child element will 'bubble up' and trigger on parent elements.
Event listeners can be attached to parent elements to handle events from multiple child elements.
Stopping event propagation can be done using event.stopPropagation() or event.stopImmediatePropagation().
Block scope and function scope are two types of scopes in JavaScript that determine the visibility and accessibility of variables.
Block scope refers to the visibility of variables within a block of code enclosed by curly braces. Variables declared with 'let' and 'const' have block scope.
Function scope refers to the visibility of variables within a function. Variables declared with 'var' have function scope.
Variables de...
Yes, I have experience working with semantic tags in HTML.
Used semantic tags like <header>, <nav>, <main>, <section>, <article>, <aside>, <footer> for better structure and SEO.
Understand the importance of using semantic tags for accessibility and search engine optimization.
Semantic tags help in organizing content and making it more readable for developers and browsers.
Various methods for creating an object in JavaScript include object literals, constructor functions, ES6 classes, and Object.create() method.
Object literals: var obj = { key: value };
Constructor functions: function ObjectName() { this.key = value; } var obj = new ObjectName();
ES6 classes: class ClassName { constructor() { this.key = value; } } var obj = new ClassName();
Object.create() method: var obj = Object.create(pr...
Shallow copy only copies the references of nested objects, while deep copy creates new copies of nested objects.
Shallow copy creates a new object but does not create copies of nested objects, only copies their references.
Deep copy creates a new object and also creates new copies of all nested objects.
Shallow copy can be achieved using Object.assign() or spread operator, while deep copy can be achieved using JSON.parse(...
The code will throw an error because 'a' is declared but not initialized.
The code will result in a ReferenceError because 'a' is declared but not assigned a value.
Variables declared with 'const' must be initialized at the time of declaration.
Initializing 'a' with a value before calling test() will prevent the error.
CSS can be used to arrange elements in a row and column layout using flexbox or grid layout properties.
Use display: flex; for a row layout and display: flex; flex-direction: column; for a column layout
Use justify-content and align-items properties to align items in the main axis and cross axis respectively
For grid layout, use display: grid; and grid-template-columns or grid-template-rows to define the layout
Yes, I have utilized CSS preprocessors such as SASS and LESS.
I have experience using SASS to streamline my CSS workflow by utilizing variables, mixins, and nesting.
I have also worked with LESS to improve code organization and maintainability through features like variables and functions.
The color applied will be based on the specificity of the selector, with ID having higher specificity than class.
ID has higher specificity than class in CSS
Color applied will be based on the selector with higher specificity
Example: If ID selector has color red and class selector has color blue, the color applied will be red
I applied via Campus Placement and was interviewed in Dec 2024. There was 1 interview round.
I have worked on various projects including developing web applications, implementing machine learning algorithms, and optimizing database performance.
Developed a web application using React.js and Node.js for a client in the e-commerce industry
Implemented machine learning algorithms for predictive analytics in a healthcare project
Optimized database performance by fine-tuning queries and indexing strategies
I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.
Hooks are a feature in React that allow you to use state and other React features without writing a class.
Hooks were introduced in React 16.8.
They let you use state and other React features in functional components.
Examples of hooks include useState, useEffect, useContext, etc.
Context API in React is used for passing data through the component tree without having to pass props down manually at every level.
Context API provides a way to share values like themes, user data, etc. across the component tree without having to pass props down manually at every level.
It consists of three main parts: Provider, Consumer, and createContext.
Provider component allows consuming components to subscribe to c...
I applied via Referral and was interviewed in Aug 2024. There were 2 interview rounds.
I applied via Job Portal
Singleton property in BPEL ensures only one instance of a service is created and shared among multiple clients.
Ensures only one instance of a service is created
Shared among multiple clients
Helps in managing resources efficiently
I appeared for an interview in Mar 2025, where I was asked the following questions.
Functional interfaces are interfaces with a single abstract method, enabling lambda expressions in Java.
A functional interface can have multiple default or static methods but only one abstract method.
Common examples include Runnable, Callable, and Comparator.
They are used primarily in Java's functional programming features, such as streams and lambda expressions.
You can define a functional interface using the @Function...
A circuit breaker is a design pattern used to prevent system failure by managing service calls and handling failures gracefully.
Prevents cascading failures in distributed systems by stopping calls to a failing service.
Has three states: Closed (normal operation), Open (calls are blocked), and Half-Open (testing if the service is recoverable).
Example: In a microservices architecture, if Service A fails, the circuit break...
A load balancer distributes network or application traffic across multiple servers to ensure reliability and performance.
Improves application availability by distributing traffic evenly.
Enhances performance by preventing any single server from becoming a bottleneck.
Can be hardware-based (like F5) or software-based (like Nginx).
Supports various algorithms for traffic distribution, such as round-robin or least connection...
I appeared for an interview in Mar 2025, where I was asked the following questions.
OOP is a programming paradigm based on objects, encapsulating data and behavior for modular and reusable code.
Encapsulation: Bundling data and methods that operate on the data within one unit (e.g., a class).
Inheritance: Mechanism to create a new class based on an existing class, inheriting its properties (e.g., a 'Dog' class inheriting from an 'Animal' class).
Polymorphism: Ability to present the same interface for dif...
I applied via Naukri.com and was interviewed in Jun 2024. There were 2 interview rounds.
Three coding problems of medium difficulty that are manageable.
Some of the top questions asked at the Cognizant Senior Software Engineer interview -
The duration of Cognizant Senior Software Engineer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 43 interview experiences
Difficulty level
Duration
based on 271 reviews
Rating in categories
Associate
73.2k
salaries
| ₹5.4 L/yr - ₹12.5 L/yr |
Programmer Analyst
56.2k
salaries
| ₹3.5 L/yr - ₹7.3 L/yr |
Senior Associate
55.1k
salaries
| ₹8.4 L/yr - ₹28.5 L/yr |
Senior Processing Executive
29.8k
salaries
| ₹2.2 L/yr - ₹6.5 L/yr |
Technical Lead
18.1k
salaries
| ₹6 L/yr - ₹25.5 L/yr |
TCS
Infosys
Wipro
Accenture