0% found this document useful (0 votes)
7 views6 pages

Interview Questions

The document contains a comprehensive list of interview questions and answers for React, JavaScript, and Node.js. It covers key concepts such as React components, state vs props, JavaScript data types, and Node.js event-driven architecture. Each section provides concise definitions and explanations relevant to each technology.

Uploaded by

dev.sadit
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)
7 views6 pages

Interview Questions

The document contains a comprehensive list of interview questions and answers for React, JavaScript, and Node.js. It covers key concepts such as React components, state vs props, JavaScript data types, and Node.js event-driven architecture. Each section provides concise definitions and explanations relevant to each technology.

Uploaded by

dev.sadit
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/ 6

React Interview Questions

1. What is React?
Ans: A JavaScript library for building user interfaces.
2. What are the key features of React?
Ans:
 Virtual DOM
 component-based architecture
 unidirectional data flow.
3. What is JSX? Why do we use it?
Ans: JSX is a syntax extension for JavaScript that allow us to write HTML-like
markup inside a JavaScript file. It makes the code more readable and expressive.
4. Explain the concept of Virtual DOM in React.
Ans: Virtual DOM is a concept in React where a lightweight, virtual representation
of the actual DOM (Document Object Model) is created and stored in memory.
5. What are components in React? Explain functional and class components.
Ans: Reusable building blocks of a UI. Functional components are stateless
functions, while class components are ES6 classes.
6. What is the difference between state and props in React?
Ans: Here is the difference between them.
 State is mutable and local to a component
 props are immutable and passed from parent to child.
7. What is a Higher-Order Component (HOC)?
Ans: A function that takes a component and returns an enhanced version of it.
8. Explain the concept of React reconciliation.
Ans: A process where React updates the Virtual DOM and applies changes to the
real DOM efficiently.
9. What are React fragments? Why are they used?
Ans: A way to group elements without adding extra nodes to the DOM. Syntax:
<></>.
10. What is the purpose of keys in React?
Ans: To uniquely identify elements for efficient list rendering.
11. What is React Context, and how do you use it?
Ans: A way to share data across components without props drilling.
12. What is React Router? How is it used for navigation?
Ans: A library for navigation in React apps using components like <Route> and
<Link>.
13. What are controlled and uncontrolled components in React?
Ans: Controlled components are managed via state; uncontrolled components use
refs.
JavaScript Interview Questions

1. What is JavaScript?
Ans: JavaScript is a synchronous single threaded language.
2. Explain the difference between var, let, and const.
Ans:
 var: function-scoped,
 let: block-scoped,
 const: block-scoped and immutable.
3. What are JavaScript data types?
Ans:
 Primitive: string, number, boolean, undefined, null, symbol, bigint.
 Non-primitive: object.
4. What is the difference between == and === in JavaScript?
Ans:
 == checks value;
 === checks value and type.
5. What are closures in JavaScript? Provide an example.
Ans:
A closure is the combination of a function bundled together (enclosed) with
references to its surrounding state (the lexical environment)
6. Explain the concept of event bubbling and event capturing.
Ans:
Bubbling: Event propagates from child to parent.
Capturing: Event propagates from parent to child.
7. What are promises in JavaScript?
Ans:
Promises is an object representing the eventual completion of an async operation.
8. What is the difference between null and undefined?
Ans:
null: explicitly empty;
undefined: not assigned.
9. Explain the concept of hoisting in JavaScript.
Ans:
Variables and functions are moved to the top of their scope during execution.
10. What is the purpose of async and await?
Ans:
Simplifies handling promises in asynchronous code.
11. What is the difference between map, filter, and forEach?
Ans:
 map: transforms array,
 filter: returns a filtered array,
 forEach: iterates without returning.
Node.js Interview Questions

1. What is Node.js, and why is it used?


Ans:
Node.js is an open-source and cross-platform JavaScript runtime environment.
2. Explain the concept of event-driven architecture in Node.js.
Ans:
Node.js uses an event loop to handle multiple client requests without blocking the
main thread. Events trigger specific callbacks, enabling high performance and
scalability.
3. What is the purpose of the package.json file in Node.js?
Ans:
The package.json file is a JSON file that stores metadata about the project,such as
its name, version, dependencies, and scripts.
4. What are the core modules of Node.js?
Ans:
Core modules are built-in modules like fs (file system), http (server creation), path
(file paths), and events (event handling), which provide essential functionalities
without requiring external libraries.
5. What is middleware in Node.js?
Ans:
Middleware in Express.js is a function that has access to the request object(req),
the response object (res), and the next middleware function in theapplication.
They can also be used for error handling, authentication,logging, and more.
6. What is the difference between synchronous and asynchronous functions in
Node.js?
Ans:
Synchronous functions block the execution until they return a result,
whileasynchronous functions do not block the execution and instead usecallbacks
to signal when they are completed.
7. Explain the concept of clustering in Node.js.
Ans:
Clustering allows you to create multiple instances of a Node.js application to utilize
all CPU cores. This improves performance for handling concurrent requests.
8. What is Express.js ?
Ans:
Express.js is a web application framework for Node.js that simplifies the process of
building APIs and web applications. It is used to streamline the development
process and make it easier to handle HTTP requests, middleware, routing and
responses.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy