0% found this document useful (0 votes)
5 views2 pages

Cognizant Interview Guide

The document is a comprehensive preparation guide for Cognizant interviews, covering essential topics such as SQL, Java, Spring Boot, and React JS. It includes detailed explanations of key concepts in React, such as components, state vs. props, Virtual DOM, hooks, and form handling. Additionally, it poses questions regarding advanced topics like Redux and performance optimization in React.

Uploaded by

mohammadrafis576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Cognizant Interview Guide

The document is a comprehensive preparation guide for Cognizant interviews, covering essential topics such as SQL, Java, Spring Boot, and React JS. It includes detailed explanations of key concepts in React, such as components, state vs. props, Virtual DOM, hooks, and form handling. Additionally, it poses questions regarding advanced topics like Redux and performance optimization in React.

Uploaded by

mohammadrafis576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COGNIZANT INTERVIEW COMPLETE PREPARATION GUIDE

SECTION 1: SQL DATABASE IMPORTANT QUESTIONS (Elaborated)

[SQL content remains unchanged]

SECTION 2: JAVA IMPORTANT INTERVIEW QUESTIONS (Elaborated)

[Java Questions 1–25 remain unchanged]

SECTION 3: SPRING BOOT INTERVIEW QUESTIONS (Elaborated)

[Spring Boot content remains unchanged]

SECTION 4: REACT JS INTERVIEW QUESTIONS (Elaborated)

1. What is React? React is an open-source JavaScript library developed by Facebook for building
user interfaces, especially single-page applications.

Key Features:

• Component-based architecture
• Virtual DOM
• One-way data binding

• JSX syntax

• What is JSX? JSX stands for JavaScript XML. It allows writing HTML inside JavaScript and makes
code easier to understand.

Example:

const element = <h1>Hello, world!</h1>;

1. What are components in React? Components are the building blocks of a React application.

2. Functional Components: Use plain JavaScript functions.

3. Class Components: Use ES6 classes with lifecycle methods.

4. What is the difference between state and props? | Feature | State | Props |
|--------|-------|--------| | Mutability | Mutable | Immutable | | Ownership | Owned by component
| Passed by parent | | Usage | Internal changes | External input |

1
5. What is Virtual DOM? A lightweight copy of the real DOM. React updates the Virtual DOM first,
compares it with the previous version (diffing), and updates the actual DOM efficiently
(reconciliation).

6. What are hooks in React? Hooks are functions that let you use state and lifecycle features in
functional components.

Popular Hooks:

• useState
• useEffect

• useContext

• What is useEffect Hook? useEffect is used to perform side effects like API calls, DOM
manipulation, etc.

Example:

useEffect(() => {
fetchData();
}, []); // runs once like componentDidMount

1. What is the difference between controlled and uncontrolled components?

2. Controlled: Form elements controlled by React state.

3. Uncontrolled: Form data handled by the DOM.

4. What is React Router? Library used for routing in React applications. It helps in navigating
between views or components.

Example:

<Route path="/home" element={<Home />} />

1. How does React handle forms? React forms handle input through state updates and handlers.
Controlled components update the state on every input change.

Example:

<input type="text" value={name} onChange={e => setName(e.target.value)} />

Would you like to add questions on advanced topics like Redux, Context API, or performance
optimization in React?

You might also like