Explain the use cases for, and differences between — bind, apply and call.

Bind method creates a copy of the function and sets the “this” keyword, while the call and apply methods sets “this” keyword and calls the function immediately. — https://blog.bitsrc.io/understanding-call-bind-and-apply-methods-in-javascript-33dbf3217be

How do you handle code organization and dependency management?

Both of these are subjects I feel I need to improve on significantly. Currently, I often follow templates to get started.

What is React.cloneElement? And the difference with this.props.children?

React.cloneElement returns a copy of a specified element. Then props can be passed into it allowing the parent element to influence and modify the child element.

--

--

What are “actions” in Redux? What is the role of reducers in Redux?

An action, is an object that contains the payload of information. They are the only source of information for the Redux store to be updated. Reducers update store based on the value of the action.type. https://www.smashingmagazine.com/2020/12/how-redux-reducers-work/

What is the meaning of “single source of truth” in Redux?

The global state of the application is handled within a single store which allows for the easy creation of universal apps, because the data can be transferred easily without lots of extra code needed.

--

--

What is Redux?

It is a state management tool primarily used with React

What is ‘Store’ in Redux?

It is a JS object that allows state sharing across components.

What is the difference between a Presentational component and a Container component?

Presentational components are mostly concerned with generating some markup to be outputted.

Container components are mostly concerned with the “backend” operations.

Flaviocopes.com React: Presentational vs Container Components

What is the second argument that can optionally be passed to setState and what is its purpose?

It is an optional callback function that’s purpose is to re-render the component.

--

--

Why is setState() in React async instead of sync?

If it was synchronous the amount of requests being made could leave the browser unresponsive. It is set as async to improve the user experience and performance of the application.

What is a higher order component?

It reuses other component’s logic to create a new component. Ex:
const awesomeNewComponent = higherOrderComponent(initialComponent);

How does hoisting work in JavaScript?

“a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.” — Understanding Hoisting in Javascript

--

--

What is render() in React? Explain its purpose.

It is a class component’s only required method. We use it to tell the method the view that should be presented in the browser to a user.

Is setState() async?

Yes, and its actions are batched to improve performance.

What are controlled components?

It is one that stores its current value through using props. It is often used with a callback to notify of changes. This is in opposition to an Uncontrolled Component that doesn’t use props and use internal tracking for its state.

What is the event loop in JavaScript?

It monitors any Calls that are in the queue, and anytime the ability to process an item from the queue opens it pushes that item to be processed which runs the function.

--

--

Can you explain the purpose of each type of HTTP Request when using a RESTful web service?

The GET method requests and only retrieves data. The POST method is used to send a new entry (such as a user) to the specified location. The PUT method replaces all current data of the target resource with the new data being sent. The DELETE method deletes the specified information.

What’s a test pyramid?

This test automation pyramid operates at three levels 1) Unit tests 2) Integration tests 3) End-to-End tests

What’s the difference between “blocking” and ‘non-blocking’ functions?

Non-blocking occurs if an answer can’t be returned quickly, the API returns immediately with an error and does nothing else. Blocking is when you call the API, it stops the thread until it has an answer to return.

--

--

What is the preferred method of resolving unhandled exceptions in Node.js?

The preferred method is to add a layer between the application and the Node.js process which is called the domain. By having the application running in a separate domain, you can handle exceptions at the domain level, before they reach the process level which allows for a safe environment.

How does Node.js support multi-processor platforms, and does it fully utilize all processor resources?

Clustering allows you to create virtual instances of your node server with as many CPU-cores you have to support multi-processor platforms.

What is typically the first argument passed to a Node.js callback handler?

Node Js core modules, as well as most community-published modules, follow a pattern where the first argument to any callback handler is an error object.

--

--