A web application experiences uneven load distribution despite using a load balancer. What could be the reason?

  • Database Bottleneck
  • Improper Load Balancer Configuration
  • Inefficient Frontend Code
  • Network Latency
Uneven load distribution may occur due to improper load balancer configuration, where it fails to distribute incoming requests evenly among the server instances.

JSP is converted into a servlet for execution, which is known as ______.

  • JSP compilation
  • JSP execution
  • JSP translation
  • Servlet initialization
JSP is converted into a servlet during the JSP translation phase, making it ready for execution.

How does redirection differ from request dispatching in servlets?

  • Redirection happens on the client side
  • Redirection is done by forward()
  • Request dispatching involves changing the URL on the client side
  • Request dispatching is faster
Redirection in servlets is done using the sendRedirect() method, while request dispatching is done using the forward() method.

_________ tracking involves appending session ID information to every URL.

  • Cookie
  • Request
  • Session
  • URL
URL tracking involves appending session ID information to every URL. This method is used to manage sessions in servlets by including the session ID in the URL.

How can you retrieve a servlet's initialization parameters in the init method?

  • getInitParameter()
  • getParameters()
  • getServletConfig()
  • getServletContext()
In the init method, you can use getInitParameter() to retrieve a servlet's initialization parameters.

To retrieve all the parameter names sent in a request, you can use the __________ method of the HttpServletRequest object.

  • getParameterNames()
  • getParameterValues()
  • getRequestParameters()
  • retrieveParameters()
The getParameterNames() method of the HttpServletRequest object is used to retrieve all the parameter names sent in a request.

Can servlet initialization parameters be changed at runtime?

  • It depends on the servlet container
  • No
  • Only through a filter
  • Yes
No, servlet initialization parameters cannot be changed at runtime. They are set during the servlet's initialization and remain constant throughout the servlet's lifecycle.

How is a cookie sent from a client to the server in an HTTP request?

  • As a URL parameter
  • As a part of the request body
  • As a part of the request headers
  • As a separate HTTP request
Cookies are sent from a client to the server as a part of the request headers in an HTTP request.

What are the potential issues with the K-means clustering method?

  • It cannot handle non-spherical clusters
  • It does not work well with non-numeric data
  • It is sensitive to outliers
  • All the options
The K-means clustering method can have several issues: it doesn't work well with non-numeric data, it's sensitive to outliers (since outliers can significantly move the cluster centroids), and it has difficulty handling clusters that are non-spherical or have varying sizes and densities.

In the context of a scatter plot, what does a positive slope indicate?

  • The correlation between the variables is weak
  • The variables are negatively correlated
  • The variables are positively correlated
  • The variables are unrelated
A positive slope in a scatter plot suggests that the two variables are positively correlated. This means as one variable increases, the other variable also tends to increase.