Which of the following JavaScript properties allows an object to inherit properties from another object?

  • inherit
  • copy
  • prototype
  • extend
In JavaScript, the prototype property is used to allow an object to inherit properties from another object. When an object is created, it inherits properties and methods from its prototype, which can be another object. This forms the basis of prototype-based inheritance in JavaScript. The other options are not standard properties used for inheritance.

Which of the following is a common tool used for benchmarking Node.js applications?

  • NPM
  • Mongoose
  • Apache
  • Apache Benchmark (ab)
Apache Benchmark (ab) is a common tool used for benchmarking Node.js applications. It allows you to measure the performance and concurrency of your Node.js server by simulating multiple requests. NPM and Mongoose are not benchmarking tools, and Apache is not typically used for Node.js benchmarking.

The process of an object gaining access to properties and methods of another object through the prototype chain is known as ______.

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Abstraction
The process of an object gaining access to properties and methods of another object through the prototype chain is known as "Inheritance." In JavaScript, objects inherit properties and methods from their prototypes in a chain-like fashion. This allows for code reuse and is a fundamental concept in object-oriented programming.

When is the package-lock.json file created or updated in a Node.js project?

  • It is created when the project is started and never updated
  • It is created when dependencies are installed or updated using npm
  • It is automatically created when the project is pushed to a version control system
  • It is manually created by the developer when needed
The package-lock.json file is created or updated in a Node.js project when dependencies are installed or updated using npm (Node Package Manager). This file keeps track of the specific versions of dependencies currently used in the project. It is automatically generated and updated to reflect changes in the project's dependencies. The other options are not accurate; it's not created when the project is started, it's not automatically created when pushed to version control, and it's not manually created by developers for typical use cases.

How can you serve multiple static directories using Express.js?

  • app.static('directory1'); app.static('directory2');
  • app.use(express.static('directory1')); app.use(express.static('directory2'));
  • app.static('directory1, directory2');
  • app.use(express.static(['directory1', 'directory2']));
To serve multiple static directories in Express.js, you should use the express.static middleware function multiple times with different directory paths. This allows you to specify and configure each static directory separately. The other options are not valid syntax for serving multiple static directories.

You are developing a system where precision is critical, and you have to handle very large integers. Which data type would you use to ensure there is no loss of precision?

  • int
  • float
  • bigint
  • double
When handling very large integers with critical precision, you should use the bigint data type. Unlike int and float, bigint can represent arbitrarily large integers without loss of precision. double is a floating-point type, which may not preserve precision for very large integers.

In Express.js, which method is used to define a route that should respond to HTTP GET requests?

  • app.post()
  • app.get()
  • app.put()
  • app.delete()
In Express.js, the app.get() method is used to define a route that should respond to HTTP GET requests. It is used to handle GET requests for a specific URL path. The other options (app.post(), app.put(), and app.delete()) are used for different HTTP methods.

In a distributed NoSQL database, the ______ strategy can be used to resolve conflicts between different versions of the same document.

  • Conflict Resolution
  • Versioning
  • Consistency
  • Replication
In a distributed NoSQL database, versioning is a strategy used to resolve conflicts between different versions of the same document. It allows tracking changes and reconciling them when conflicts occur.

A well-designed schema in a relational database typically involves the use of ________ to ensure that relationships between tables are maintained.

  • Foreign Keys
  • Indexes
  • Stored Procedures
  • Triggers
A well-designed schema in a relational database typically involves the use of "foreign keys" to ensure that relationships between tables are maintained. Foreign keys establish referential integrity, ensuring that data in one table corresponds to data in another table, maintaining the integrity of the database relationships.

Which of the following HTTP headers is crucial for preventing Cross-site Scripting (XSS) attacks?

  • Content-Encoding
  • Access-Control-Allow-Origin
  • X-Frame-Options
  • User-Agent
The HTTP header crucial for preventing Cross-site Scripting (XSS) attacks is X-Frame-Options. This header prevents a web page from being embedded within an