Dev questions Flashcards

1
Q

What is React?

A

A javaScript library for building user interfaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Redux

A

Redux manages and updates application state, using events called “actions”. It serves as a centralized store for state that needs to be used across your entire application, with rules ensuring that the state can only be updated in a predictable fashion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does Redux work

A

react components => actions => reducers =>store => back to react components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Reducers in redux

A

Reducers are functions that take the current state and an action as arguments, and return a new state result. In other words, (state, action) => newState.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Reducers in redux

A

Reducers are functions that take the current state and an action as arguments, and return a new state result. In other words, (state, action) => newState.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why do you choose React?

A
  • Easy to learn => a simple library and learning process gets easier easier when you have experience with javascript
    -rich use interfaces => react supports front end libraries such as frontend libraries such as Bootstrap, Material ui, Tailwind.. etc to build rich UI
    -faster development => increase productivity by using reusable components and development tools. React Developer tools browser extention to make code working alot easier
  • react is used by great companies => Facebook, dropbox, nnetflix, airbnb, paypal etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is AJAX?

A

Short for Asynchronous Javascript and XML. It is used to allow for data to be sent and received to and from a database/server
-Special is that you can exchange data in the background without actually disturbing the user experience
-send and receive information in JSON, XML HTML.
-asynchronous -> can communicate with the server, exchange data, and update the page without having to refresh the page.
-Two major features => Makes requests to the server without reloading the page and receive and work with data from the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a closure?

A

Is a function that references variables in the outer scope from its inner scope
-preservers the outer scope inside its inner scope
-function greeting() {
let message = ‘Hi’;

function sayHi() {
    console.log(message);
}

return sayHi; } let hi = greeting(); hi(); // still can access the message variable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the major features of React?

A

-JSX (Javascript Syntax Extension) => combination if HTML and Javascript. You can embed JavaScript objects inside the HTML elements. Makes code easy and understandable
-Virtual DOM = > DOM (Document Object Model), It is the most important part of the web as it divides into modules and executes the code. JavaScript Frameworks updates the whole DOM at once. But react uses virtual DOM which is an exact copy of real DOM. Whenever there is a modification in the web application, the whole virtual DOM is updated first and finds the difference between real DOM and Virtual DOM. Once it finds the difference, then DOM updates only the part that has changed recently and everything remains the same.
-One way data binding => one direction flow.he data in react flows only in one direction i.e. the data is transferred from top to bottom i.e. from parent components to child components This is the working process of one-way data binding. This keeps everything modular and fast.
-Performance=> react uses virtual DOM and updates only the modified parts. So , this makes the DOM to run faster. DOM executes in memory so we can create separate components which makes the DOM run faster
-Extension => React has many extensions that we can use to create full-fledged UI applications. It supports mobile app development and provides server-side rendering. React is extended with Flux, Redux, React Native, etc. which helps us to create good-looking UI.
-Conditional Statements => JSX allows us to write conditional statements. The data in the browser is displayed according to the conditions provided inside the JSX.
-Components => React.js divides the web page into multiple components as it is component-based. Each component is a part of the UI design which has its own logic and design the component logic which is written in JavaScript makes it easy and run faster and can be reusable.
-Simplicity => React.js is a component-based which makes the code reusable and React.js uses JSX which is a combination of HTML and JavaScript. This makes code easy to understand and easy to debug and has less code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State vs Props

A

State => Data is passed within the component only, can be modified, can only be used with the state components/class component, state is both read and write
Props => Data is passed from one component to another, cannot be modified, can bee used with state and functional components, props are read only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why do we set a key property when we map over an array in react?

A

Keys help React identify which items have changed (added/removed/re-ordered). To give a unique identity to every element inside the array, a key is required.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the DOM

A

DOM stands for Document Object Model. It allows us to create, change, or remove elements from the document. We can also add events to these elements to make our page more dynamic.

The DOM views an HTML document as a tree of nodes. A node represents an HTML element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between == and ===?

A

== does not check for type only value and === checks for type and value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Let, var, const

A

-4 things => scope, hoisting, declaration, and assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly