Search This Blog

Sunday 25 November 2012

CA Placement Paper 1



CA Placement Paper :-

1. How multiple EJB instances are managed ?

(a) Connection Pooling
(b) Caching of EJB instances
(c) EJB Passivation
(d) All the above

ANS: I think answer is (d)


2. At what stage, the life cycle of a CMP bean can be assumed to be started ?

(a) before ejbCreate() method is executed
(b) after ejbCreate() method is executed
(c) in postCreate() method
(d) after executing ejbStore()


3. In JSP, how can you know what HTTP method (GET or POST) is used by client request ?

(a) by using request.getMethod()
(b) by using request.setMethod()
(c) impossible to know

ANS: (a)


4. What is legal about JSP scriplets

(a) A loop can begin in one Scriptlet and end in another
(b) Statements in Scriptlets should follow Java Syntax
(c) Semicolon is needed at the end of each statement in a Scriptlet
(d) All the above

ANS: (d)


5. Which method is called first each time a Servlet is invoked ?

(a) Start()
(b) Run()
(c) Servive()
(d) init()

ANS: (d)


6. The time between Command Execution and Response is called ______

(a) Granularity
(b) Latency
(c) Lag time

ANS: (c)


7. Difference between <jsp:forward> and <jsp:include> tags

ANS:
<jsp:forward> transfers the control to the mentioned destination page.
<jsp:include> tag substitutes the output of the destination page. Control remains on the same page.


8. Which of the following is true ?

(a) Unlimited data transfer can be done using POST method
(b) Data is visible in Browser URL when using POST method
(c) When large amounts of data transfer is to be done, GET method is used.

ANS: (a)


9. EJB class should implement

(a) javax.ejb.EntityBean
(b) javax.ejb.rmi
(c) javax.ejb.EJBHome
(d) javax.ejb.EJBObject

ANS: I think the answer is (a)

10. what does " calloc" do?

Ans :  A memory allocation and initialising to zero.

11 what does exit() do?

Ans : come out of executing programme.

12. what is the value of 'i'?

i=strlen("Blue")+strlen("People")/strlen("Red")-strlen
("green")

Ans : 1

13. i=2
    
printf("%old %old %old %old ",i, i++,i--,i++);
    Ans : check the answer.

14.Using pointer, changing A to B and B to A is Swapping the function using two address and one temperory variable. a,b are address, t is temporary variable. How function look like?

Ans : swap(int *, int *, int )

15. In  'o' how are the arguments passed?

ans : by value.

16. Find the prototype of sine function.

Ans : extern double sin(double)

17. Scope of a global variable which is declared as static?

ans : File

18. ASCII  problem
     i=..
 ans : 6


19. Generally Servlets are used for complete HTML generation. If you want to generate partial HTMLs that include some static text (This should not be hard coded in Servlets) as well as some dynamic text, what method do you use ?

(a) Serverside includes
(b) JSP code in HTML
(c) Not possible to generate incomplete HTMLs using Servlets


20. Which of the following can not be used as the scope when using a JavaBean with JSP?

(a) session
(b) application
(c) request
(d) response

ANS: (d)

21. Which is true about Servlets

(a) Only one instance of Servlet is created in memory
(b) Multi-Threading is used to service multiple requests
(c) Both (a) & (b)

ANS: I think the answer is (c)

22. what is the o/p
    printf(" Hello \o is the world ");
   Ans : Hello is the world.

23. Clarifying the concept addresses used over array ; ie changing the address of a base element produces what error?

24. child process  -- fork
    child shell    -- sh

25. Answer are lex 7 yacc & man read these things in UNIX

26. What is
    int *p(char (*s)[])
    Ans : p is a function which is returning a pointer to

27. What exception is thrown when Servlet initialization fails ?

(a) IOException
(b) ServletException
(c) RemoteException

ANS: (b)

28. How can a Servlet call a JSP error page ?

(a) This capability is not supported.
(b) When the servlet throws the exception, it will automatically be caught by the calling JSP page.
(c) The servlet needs to forward the request to the specific error page URL. The exception is passed along as an attribute named "javax.servlet.jsp.jspException".
(d) The servlet needs to redirect the response to the specific error page, saving the exception off in a cookie.

ANS:
 (c)

29. What is the key difference between using a <jsp:forward> and HttpServletResponse.sendRedirect()?

(a) forward executes on the client while sendRedirect() executes on the server.
(b) forward executes on the server while sendRedirect() executes on the client.
(c) The two methods perform identically.

ANS: (b)

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

(a) Allows separation of roles between web developers and application developers
(b) Allows integration with Content Management tools

ANS
: (a)

31.
 Why DB connections are not written directly in JSPs ?

(a) Response is slow
(b) Not a standard J2EE architecture
(c) Load Balancing is not possible
(d) All the above
(e) Both (b) and (c)

32. What is Temporary Servlet ?

(a) Servlet that is destroyed at run time
(b) Servlet that exists for a session
(c) Servlet that is started and stopped for each request

ANS: (c)


33. |x-a|=a-x    Ans: (c) x<=a

34. There is six letter word VGANDA . How many ways you can arrange the letters in the word in such a way that both the A's are together.

Ans : 120    (5x4!)

35. If two cards are taken one after another without replacing from a pack of 52 cards what is the probability  for the two cards be queen.     Ans : (4/52)*(3/51)       (1/17)*(1/13)

36. 51 x 53 x ... x 59 ; symbols ! - factorial ^ - power of 2

(a) 99!/49! (b)  (c)   (d) (99! x 25!)/(2^24 x 49! x 51!)

37
. The ratio fo Boys to Girls is 6:4. 60% of the boys and 40% of girls take lunch in the canteen. What % of class takes lunch in canteen.

Ans : 52%    (60/100)*60 + (40/100)*40

Data Sufficiency :


a) only statement A is sufficent , B is not
b) only statemnet B
c) both are necessary
d) both are not sufficient.

38. X is an integer. Is X dvisible by 5?
   A) 2X is divisible by 5.
   B) 10X is divisible by 5.

   Ans : A)

39. (A) Anna is the tallest girl
   (B) Anna is taller than all boys.
  (Q) . Is Anna the tallest in the class

 Ans : c

40. How many Zulus are there ?

41. Who must be a Zulu ?

No comments:

Post a Comment