Computer Associates Placement: Sample Questions 1 - 2 of 18

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 1

Appeared in Year: 2004

Question

MCQ▾

Which is true about Servlets.

Choices

Choice (4)

a.

Only one instance of Servlet is created in memory

b.

Multi-Threading is used to service multiple requests

c.

Both a. and b. are correct

d.

Question does not provide sufficient data or is vague

Answer

c.

Explanation

The Web - Server
  • Web-server creates only one instance per servlet, if multiple request is going to a servlet then each request will processed in a separate thread, so container creates a thread per request for the single servlet instance, so the servlet should be thread-safe.
  • But web-server doesn՚t create thread per request, there is a pool of threads to process the request.
  • For example , If there are 1000 request , and the maximum threads that can be generated by servlet is 100, then there will be performance degradation.
  • In order to avoid this problem , we can use load balancer by putting multiple servers behind a load balancer.

Question 2

Appeared in Year: 2004

Question

MCQ▾

Why beans are used in J2EE architecture in stead of writing all the code in JSPs?

Choices

Choice (4)

a.

Allows integration with Content Management tools.

b.

Allows separation of roles between web developers and application developers.

c.

None of the above

d.

Question does not provide sufficient data or is vague

Answer

b.

Explanation

  • JB is a server-side web component.
  • It depends on other java technologies for proper functionality such as Remote Method Invocation (RMI) .
  • RMI is used as a two protocol enterprise beans between an enterprise bean and its client.
  • All JBs are developed, deployed and run only in an JB container.
  • This is similar to servlets and JSP run in a web container.
  • JB applications are easy to develop because the applications developer can concentrate on business logic.
  • The developer can utilize the services provided by the JB container, like connection pooling and transactions.

Developed by: