How does hoisting behave in function declarations in JavaScript?

  • Function declarations are moved to the top of their containing scope during compilation.
  • Function declarations are not affected by hoisting.
  • Hoisting only applies to variables, not functions.
  • Function declarations are moved to the bottom of the code.
In JavaScript, hoisting is the mechanism by which variable and function declarations are moved to the top of their containing scope during compilation. This means that you can call a function declared with function before it appears in your code, and it will still work. However, it's important to note that only the declarations are hoisted, not the initializations. Understanding hoisting is crucial for writing clean and maintainable JavaScript code.

A _________ object is used to perform HTTP requests in AJAX.

  • XMLHttpRequest
  • JSON
  • DOM
  • Fetch
In AJAX (Asynchronous JavaScript and XML), the XMLHttpRequest object is used to perform HTTP requests asynchronously. It allows you to send and receive data from a server without refreshing the entire web page.

Which property of the event object is commonly used to prevent the default action of the event?

  • event.stopPropagation()
  • event.preventDefault()
  • event.cancelBubble()
  • event.halt()
To prevent the default action of an event in JavaScript, you commonly use the event.preventDefault() method. It stops the default behavior associated with the event, such as preventing a form from submitting or a link from navigating to a new page. This method is crucial for controlling the behavior of events.

You have an object containing user data and need to create an array of strings containing user details in a "key: value" format. Which loop might be most suitable for this task?

  • for...in loop
  • for...of loop
  • while loop
  • forEach() method
The for...of loop is most suitable for iterating over object properties when you want to create an array of strings. It directly iterates over iterable values like arrays and works well for this task by extracting key-value pairs from the object.

How does the Min-Max scaling differ from standardization when it comes to handling outliers?

  • Both handle outliers in the same way
  • Min-Max scaling is more sensitive to outliers than standardization
  • Min-Max scaling removes outliers, while standardization doesn't
  • Standardization is more sensitive to outliers than Min-Max scaling
Min-Max scaling is more sensitive to outliers than standardization. In Min-Max scaling, if the dataset contains extreme values or outliers, then the majority of the data after scaling could end up within a small interval. On the other hand, standardization does not have a bounding range, which makes it more suitable for handling outliers.

Suppose you have a model with a high level of precision but low recall. You notice that missing data was handled incorrectly. How might this have affected the model's performance?

  • Missing data could have affected the model's complexity.
  • Missing data might have introduced false negatives.
  • Missing data might have introduced false positives.
  • Missing data might have skewed the distribution of the data.
Incorrect handling of missing data may result in the model being trained on a biased dataset, leading to false negatives and subsequently a lower recall.

Why is it important to deal with outliers before conducting data analysis?

  • To clean the data
  • To ensure accurate results
  • To normalize the data
  • To remove irrelevant variables
Dealing with outliers is important before conducting data analysis to ensure accurate results, as outliers can distort the data distribution and statistical parameters.

Which visualization library in Python is primarily built on Matplotlib and provides a high-level interface for drawing attractive statistical graphics?

  • NumPy
  • Pandas
  • SciPy
  • Seaborn
Seaborn is a Python data visualization library based on Matplotlib. It provides a high-level interface for creating attractive graphics and comes with several built-in themes for styling Matplotlib graphics.

Which plot uses kernel smoothing to give a visual representation of the density of data?

  • Box plot
  • Histogram
  • Kernel Density plot
  • Scatter plot
A Kernel Density Plot uses kernel smoothing to give a visual representation of the density of data. It is used for visualizing the Probability Density of a continuous variable. It depicts the probability density at different values in a continuous variable.

Regression imputation can lead to biased estimates if the data is not __________.

  • All of the above
  • Missing completely at random
  • Normally distributed
  • Uniformly distributed
Regression imputation can lead to biased estimates if the missingness of the data is not completely at random (MCAR). If there is a systematic pattern in the missingness, regression imputation could lead to bias.