• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock Exam Queries from JDiscuss..

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I just had given the Mock Exam for SCWCD at www.jdiscuss.com..
I gave some wrong answers and some questions I am confused with..
Here are some of them, I need guidance for the correct answers with a brief summary..

Thanks in advance..

Question 1 : Assuming that the servlet container is distributed across multiple JVMs, which of the following statements are correct? (Select 2 correct options.)

1) A separate instance of a non-default servlet context will be available on each of the JVMs.
2) A separate instance of all servlet context will be avaible on each of the JVMs.
3) The default servlet context will be present only on one of the JVMs.
4) There is only one instance of servlet contexts across all the JVMs.
5) None of the above

Answers from JDiscuss : (1 & 3)

(Can anybody explain me what does Default Servlet Context means..? )


Question 2 : You are developing a web application which needs to store a lot of data in persistant storage. As of now, your company does not have any database and so you can only use the file system to store the data. But if the webapp goes well, the company may buy an industrial strength database. Which design pattern would be useful for you in this case which will help you reduce your work load later? (Select 1 correct option.)

1) MVC
2) Business Delegate
3) File DB pattern
4) Data Access Object
5) Data Store Pattern

Answers from JDiscuss : (4)
(Does the real exam will have questions of Design Patterns other than the 6 discussed in HFSJ..?)


Question 3 : Which of the following things may happen in the translation phase of a JSP page? (Select 2 correct options.)

1) Execution of _jspService() method.
2) Execution of jspInit() method.
3) Creation of the servlet class corresponding to the JSP file.
4) Instantiation of the servlet class.
5) Loading of the servlet class.

Answers from JDiscuss : (3 & 5)
But I think, Loading the Servlet Class is not part of Translation phase..?


Question 4 : Identify the techniques that can be used to implement 'sessions' if the client browser does not support cookies. (Select 3 correct options. )

1) Using Http headers.
2) Using https protocol.
3) Hidden form fields.
4) URL rewriting
5) It cannot be done without cookie support.

Answer from JDiscuss : (1, 3, 4)


Question 5 : You do not want multiple threads to be executing your servlet's methods because its methods are not thread safe. What is the right way to ensure this? (Select 2 correct options.)

1) Make its methods synchronized.
2) Make it implement MultiThreadModel.
3) Make it implement SingleThreadModel.
4) You don't need to do anything as the container automatically takes care of this.

Answer from JDiscuss : (1, 3)


Question 6 : You want to use a bean that is stored in com/enthu/GUI.ser file. Which of following statements correctly defines the tag that accesses the bean? (Select 1 correct option.)

1) <jsp:useBean id="pref" name="com/enthu/GUI.ser" />
2) <jsp:useBean id="pref" name="com.enthu.GUI" />
3) <jsp:useBean id="pref" type="com/enthu/GUI.ser" />
4) <jsp:useBean id="pref" beanName="com.enthu.GUI" type="com.enthu.GUI"/>
5) <jsp:useBean id="pref" class="com.enthu.GUI.ser" />

Answer from JDiscuss : (I selected 4 and was correct)
Query : Is this thing (Serialized Bean) covered in HFSJ or Real Exam..?


Question 7 : In which of the following situations will a session be definitely invalidated? (Select 2 correct options.)

1) The container is shutdown and brought up again.
2) No request comes from the client for more than "session timeout" period.
3) A servlet explicitly calls invalidate() on a session object.
4) If the session time out is set to 0 using setMaxInactiveInterval() method, the session will never be invalidated automatically.

Answer from JDiscuss : (2 & 3)
Query : Why Option 1 can not be the answer..?


Quesion 8 : Assuming that the Servlet Container has just called destroy() method of a servlet instance, which of the following statements are correct? (Select 2 correct options.)

1) Any resources that this servlet might hold have been released.
2) The servlet container time out has exceeded for this servlet instance.
3) The init() method has been called on this instance.
4) None of the requests can EVER be serviced by this instance.
5) All threads created by this servlet are done.

Answer from JDiscuss : (3 & 4)


Question 9 : Which of the following XML elements should be present in a deployment descriptor of a web application so that it can be distributed accross multiple JVMs? (Select 1 correct option.)

1) <distributable/>
2) <distributable>true</distributable>
3) <distributed/>
4) <distributed>true</distributed>
5) <distribute>true</distribute>

Answer from JDiscuss : 1

Need help for answers & Clarification..
Thanks..!
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vaibhav Potter:
(Does the real exam will have questions of Design Patterns other than the 6 discussed in HFSJ..?)



My post from ScwcdFaq:
Why am I seeing Design Patterns in mock exams that aren't in the objectives?
Mock exams, as well as the real exam, contain answer options other than the 6 Design Patterns from the objectives. Some are real and some are not. "Composite Delegate" is an option in HFSJ but was something we think Bert made up because he likes to play jokes. Patterns other than the Big 6 are never the correct answer on the real exam. Ever. Use this knowledge to your advantage.

The 6 you need to know are: * Transfer Object * MVC * Front Controller * Business Delegate * Service Locator * Intercepting Filter (sometimes just called Filter)

Also note that in previous versions of the exam, the following patterns were covered (and so you may see them more frequently in older mock exams): * Value Object - (now more commonly called Transfer Object) * Model-View-Controller - (aka MVC) * Data Access Object (DAO) * Business Delegate * Front Controller


I also have some notes on Design Patterns under Rancher Notes in the ScwcdLinks page!

I'll let the other folks here address your other questions.
 
Manwatkar Vaibhav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the clarification Marc..
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Question 4 : Identify the techniques that can be used to implement 'sessions' if the client browser does not support cookies. (Select 3 correct options. )

1) Using Http headers.
2) Using https protocol.
3) Hidden form fields.
4) URL rewriting
5) It cannot be done without cookie support.

Answer from JDiscuss : (1, 3, 4)



As I understand it....

1) Using headers, you could pass in a session id. I think that's even how cookies work - using a header.
3) You could store the session id (or some other identifying value) within a form field which was no displayed to the user. It will be automatically resubmitted by the browser on form submission.
4) The old favourite backup for when cookies fail.

HTH
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Question 5 : You do not want multiple threads to be executing your servlet's methods because its methods are not thread safe. What is the right way to ensure this? (Select 2 correct options.)

1) Make its methods synchronized.
2) Make it implement MultiThreadModel.
3) Make it implement SingleThreadModel.
4) You don't need to do anything as the container automatically takes care of this.

Answer from JDiscuss : (1, 3)



1) Making methods synchronized means that only one thread can execute them at once.
3) This interface achieves something similar as above.

Just don't let the authors of HFSJ hear us talking about this, or they'll cry.
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I just know that is the correct answer.
I think it's one of those unfortunate things that you just have to learn, like those nasty ejb refs I spent so much time on!
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 6 : You want to use a bean that is stored in com/enthu/GUI.ser file. Which of following statements correctly defines the tag that accesses the bean? (Select 1 correct option.)

1) <jsp:useBean id="pref" name="com/enthu/GUI.ser" />
2) <jsp:useBean id="pref" name="com.enthu.GUI" />
3) <jsp:useBean id="pref" type="com/enthu/GUI.ser" />
4) <jsp:useBean id="pref" beanName="com.enthu.GUI" type="com.enthu.GUI"/>
5) <jsp:useBean id="pref" class="com.enthu.GUI.ser" />

Answer from JDiscuss : (I selected 4 and was correct)
Query : Is this thing (Serialized Bean) covered in HFSJ or Real Exam..?



Hi the beanName attribute is not coverd in HFSJ? I read regarding this in other books..
 
Manwatkar Vaibhav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hanumadeepak,

I also answered correctly because I read about the beanName attribute from Hanumant Deshmukh's book..
 
Yeah, but is it art? What do you think tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic