You're writing a function that removes an element from an array without mutating the original array and returns the new array. Which array method could help you achieve this?

  • filter()
  • splice()
  • pop()
  • push()
The filter() method creates a new array with all elements that pass the test implemented by the provided function, making it a suitable choice for removing elements from an array without changing the original array. The splice() method can be used for removing elements but mutates the original array. pop() and push() are used for adding/removing elements from the end of an array.

How might the use of immediately-invoked function expressions (IIFE) impact the performance of a JavaScript application?

  • IIFE can significantly improve performance by reducing global variable usage.
  • IIFE has no impact on performance; it's purely a coding style choice.
  • IIFE can slow down performance due to excessive function calls.
  • IIFE can lead to memory leaks in JavaScript applications.
The use of IIFE in JavaScript can have a positive impact on performance. By encapsulating code within an IIFE, you reduce the use of global variables, which can lead to fewer naming conflicts and better performance. IIFE is commonly used for encapsulating code safely and efficiently. It's not a performance bottleneck but rather a coding pattern for better code organization.

When different classes have methods of the same name, this is referred to as method _________.

  • overriding
  • overloading
  • overloading
  • overriding
When different classes have methods of the same name with different parameters, this is referred to as "method overloading." Method overloading allows a class to have multiple methods with the same name but different parameter lists.

How can the issues related to memory leaks due to closures be mitigated in JavaScript?

  • Using WeakMaps
  • Increasing Closure Scope
  • Avoiding Closures
  • Garbage Collection
Memory leaks due to closures can be mitigated by using WeakMaps in JavaScript. WeakMaps are a data structure that allows objects to be held weakly, meaning they won't prevent objects from being garbage collected. This helps in preventing memory leaks that can occur when closures hold references to objects longer than necessary.

What challenge is commonly associated with callback functions in asynchronous JavaScript?

  • Synchronous execution
  • Callback hell
  • Memory leaks
  • Variable scope
Callback hell is a common challenge in asynchronous JavaScript. It occurs when you have multiple nested callbacks, making the code hard to read and maintain. This situation can lead to callback hell, where code becomes difficult to manage and understand.

To check for equality without considering the type in JavaScript, you should use ______.

  • === (Triple Equals)
  • == (Double Equals)
  • #NAME?
  • !== (Not Equals)
In JavaScript, the "===" operator, known as the triple equals operator, is used to check for equality without considering the data types of the operands. It ensures both the value and the type of the operands are identical.

You've been given a new device without any documentation. You want to check if Linux has automatically loaded a driver for it. Which command would help you determine this?

  • lspci
  • dmesg
  • lsusb
  • udevadm
The dmesg command would help you determine if Linux has automatically loaded a driver for the new device. dmesg displays kernel messages, and you can look for entries related to the device to see if a driver has been loaded or if there are any issues with it.

The _________ directory in Linux contains device nodes and is crucial for the system's interaction with hardware.

  • /dev
  • /lib
  • /mnt
  • /var
The /dev directory in Linux contains device nodes and is crucial for the system's interaction with hardware. Device nodes represent physical and virtual devices, allowing the system to communicate with and control hardware components.

What is the primary purpose of the netstat command?

  • Display network statistics and connections
  • List all installed packages
  • Check system resource usage
  • Create a new network interface
The primary purpose of the netstat command is to display network statistics and connections. It provides valuable information about network interfaces, routing tables, and active network connections. It's a crucial tool for network troubleshooting and monitoring.

When working with file permissions, the ________ command is used to modify the special permissions like setuid, setgid, and sticky bit.

  • chattr
  • chmod
  • chown
  • lsattr
When working with file permissions, the chmod command is used to modify the special permissions like setuid, setgid, and the sticky bit. These special permissions can change the behavior of files and directories, and chmod is used to set or remove them.

While debugging a long script, you realize that a specific section of the script is causing an error. Which command can you temporarily add to halt the script's execution and inspect variables at that point?

  • break
  • pause
  • halt
  • debug
You can temporarily add the break command to halt the script's execution at a specific point during debugging. This allows you to inspect variables, control flow, and identify the source of the error. Once the debugging is complete, you can remove the break statement to resume normal script execution.

When working with Docker, the Dockerfile is used to define and configure the container's _________.

  • Behavior
  • Networking
  • Environment
  • Parameters
When working with Docker, the Dockerfile is used to define and configure the container's environment. This includes specifying the base image, installing software, setting environment variables, and other container-specific configurations.