You are on page 1of 5

1. Differentiate between synchronous and asynchronous function.

2. Explain various file operations of fs module.

https://www.w3schools.com/nodejs/nodejs_filesystem.asp
https://www.geeksforgeeks.org/node-js-file-system/

3 Describe events module with an example.What is an Event Emitter in Node.js?Explain with


an example

https://www.tutorialsteacher.com/nodejs/nodejs-eventemitter

5. What is Express.JS? Why do we need Express.JS? What are its Core Features?

https://www.besanttechnologies.com/what-is-expressjs

7 Explain briefly the different types of Modules in Node.JS


https://www.w3schools.com/nodejs/nodejs_modules.asp
8 Explain with an example the two main data structures composing JSON

A collection of name/value pairs. Different programming languages support


this data structure in different names. Like object, record, struct, dictionary,
hash table, keyed list, or associative array.

An ordered list of values. In various programming languages, it is called as


array, vector, list, or sequence.

Since data structure supported by JSON is also supported by most of the


modern programming languages, it makes JSON a very useful
data-interchange format.

{
"firstName": "Bidhan",
"lastName": "Chatterjee",
"age": 40,
"email":"bidhan@example.com"
}

8 HTML Templating ? What are the various Template Engines supported by Expres.js.
Write a Server program using Handlebars that renders a dynamic list of people every time a
user visits your website..

https://blog.logrocket.com/top-express-js-template-engines-for-dynamic-html-pages/

15 React Intro, why we use it?.its features.

ReactJS is an open-source frontend JavaScript library which is used for


building user interfaces especifically for single page applications. It is used for
handling view layer for web and mobile apps. React was created by Jordan
Walke, a software engineer working for Facebook. ReactJS was first deployed
on Facebook’s newsfeed in 2011 and on Instagram.com in 2012.

The major features of ReactJS are as follows,

● It uses VirtualDOM instead RealDOM considering that RealDOM


manipulations are expensive.
● Supports server-side rendering
● Follows Unidirectional data flow or data binding
● Uses reusable/composable UI components to develop the view
16 Function Components: This is the simplest way to create a component. Those are
pure JavaScript functions that accept props object as first parameter and return
React elements:
function Greeting({ message }) {
return <h1>{`Hello, ${message}`}</h1>

}
Class Components: You can also use ES6 class to define a component. The above
function component can be written as:
class Greeting extends React.Component {
render() {
return <h1>{`Hello, ${this.props.message}`}</h1>
}
i. }

19 What are props in React?


A: props are properties that are passed into a child component from its parent, and
are readonly.

What's the difference between component props and state?

A: Props are readonly and passed in from parent to child component; state is an
internal object for a particular react component and can change, as it determines the
state of the component. It is not visible to other components.

18 State of a component is an object that holds some information that may


change over the lifetime of the component. We should always try to make our
state as simple as possible and minimize the number of stateful components.

Let's create a user component with message state,

class User extends React.Component {


constructor(props) {
super(props)

this.state = {
message: 'Welcome to React world'
}
}

render() {
return (
<div>
<h1>{this.state.message}</h1>
</div>
)
}
}
State is similar to props, but it is private and fully controlled by the
component. i.e, It is not accessible to any other component til the owner
component decides to pass it.

22 JSX

JSX is a XML-like syntax extension to ECMAScript (the acronym stands for


JavaScript XML). Basically it just provides syntactic sugar for the
React.createElement() function, giving us expressiveness of JavaScript along
with HTML like template syntax.

In the example below text inside <h1> tag is returned as JavaScript function to
the render function.

render() {
return(
<div>
<h1>{'Welcome to React world!'}</h1>
</div>
)
}
}

23
The virtual DOM (VDOM) is an in-memory representation of Real DOM. The
representation of a UI is kept in memory and synced with the “real” DOM. It’s a step
that happens between the render function being called and the displaying of
elements on the screen. This entire process is called reconciliation.

Reference

https://github.com/Devinterview-io/react-interview-questions

https://github.com/sudheerj/reactjs-interview-questions#what-is-state-in-react

You might also like