Named imports in JavaScript must match the exported names in the module, unless they are ________.

  • Renamed
  • Aliased
  • Excluded
  • Deprecated
Named imports in JavaScript must match the exported names in the module, unless they are "aliased." When you alias an import, you can give it a different name than the exported name, providing flexibility in your code.

The typeof operator in JavaScript returns 'object' for ________.

  • null
  • undefined
  • arrays
  • functions
In JavaScript, the typeof operator returns 'object' when used with the value null. This can be a source of confusion because null is not actually an object; it's a primitive value with its own data type.

The ______ header is often used to pass the authentication token from the client to the server in HTTP requests.

  • Authorization
  • Token
  • Authentication
  • Bearer
The Bearer header is often used to pass the authentication token from the client to the server in HTTP requests when using JWTs for authentication. It is a common practice to include the JWT as a Bearer token in the Authorization header. The other options may not be standard headers for this purpose.

When performing integration testing, the focus is on the ________ between different components of the application.

  • interactions
  • behavior
  • dependencies
  • functions
Integration testing focuses on the dependencies between different components of the application. It ensures that these components work together as expected. While interactions and behavior are important aspects, they are not the primary focus of integration testing. Functions are a narrower concept and do not encompass all aspects of integration.

What is the primary difference between OAuth 1.0 and OAuth 2.0?

  • OAuth 1.0 uses HMAC-SHA1 for signing requests, while OAuth 2.0 uses JWT.
  • OAuth 1.0 requires client registration, while OAuth 2.0 does not.
  • OAuth 1.0 uses two-legged authentication, while OAuth 2.0 uses three-legged authentication.
  • OAuth 1.0 is a token-based system, while OAuth 2.0 is a protocol for token-based authentication.
The primary difference is that OAuth 1.0 requires client registration, while OAuth 2.0 does not. OAuth 2.0 introduced a more streamlined and flexible approach to authorization. The other options describe differences but not the primary distinction.

Which of the following is a property of the Global Object in Node.js?

  • console
  • globalThis
  • module
  • require
In Node.js, the global object is a global context object that contains various properties and methods available throughout the application. globalThis is a reference to the global object, which allows cross-environment compatibility. console, module, and require are not properties of the global object but are commonly used in Node.js for various purposes.

To serve static files such as images, CSS files, and JavaScript files, a special folder called ______ is commonly used in Express.js.

  • public
  • assets
  • static
  • files
To serve static files such as images, CSS files, and JavaScript files, a special folder called the public folder is commonly used in Express.js. This folder typically contains all your publicly accessible static assets.

In Express.js, the :id? in a route path like "/users/:id?" denotes that id is a(n) ______ parameter.

  • optional
  • required
  • query
  • body
In Express.js, the :id? in a route path like "/users/:id?" denotes that id is an optional parameter. This means that the id parameter may or may not be present in the URL, and the route will still match. The other options are not correct in this context (required would mean the parameter is mandatory, query is used for query parameters, and body is used for request bodies).

Is it mandatory to define constructor for React component?

  • Yes, it is mandatory for all React components
  • No, it is only necessary if the component needs to set its initial state or bind methods to the component
  • No, it is only necessary if the component has props
It is not mandatory to define a constructor for a React component. If the component does not need to set its initial state or bind methods to the component, the constructor can be omitted. Additionally, if the component does not have any props, a constructor is not necessary.

What are forward refs?

  • A way to declare and initialize a component's state
  • A way to forward refs from parent components to child components
  • A way to pass props down to child components
  • A way to pass state up to parent components
Forward refs are a way to pass a ref from a parent component to a child component. This allows the parent component to access and manipulate the child component's DOM node. Forward refs are created using the React.forwardRef() function.

What is redux-saga?

  • A middleware library for Redux
  • A tool for code splitting in React
  • A data visualization library for Redux
redux-saga is a middleware library for Redux that allows you to handle side effects, such as asynchronous data fetching or complex state updates, in a declarative and testable way. It uses ES6 Generators to provide a more readable and maintainable way to handle complex logic in your Redux application.

What are Higher-Order components?

  • Components that are used for server-side rendering
  • Components that enhance the behavior of other components
  • Components that render other components
  • Components that use the shouldComponentUpdate() method
Higher-Order components (HOCs) are components that enhance the behavior of other components by adding additional functionality or props. HOCs take a component as input and return a new component that includes the additional behavior. This allows developers to reuse code and separate concerns in their applications.