• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Servlets interview questions . . .

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys any suggestions about questions interviewer might ask on servlets. Thanks in advance
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey...where are those SHERIFFs...this question has to be transferred to JOBs DISCUSSION...
anyway...well jagdeep...many of them do ask the basic questions first..like..
1. Diff. between GET & POST.
2. Diff. Form methods like doGet, doPost, service, doPut, doTrace...
3. Adv. of Servlet over CGI.
4. Database connectivity...
n many more...depends on wat level you are being interviewed for..as in advanced level they may ask you questions related to j2ee...
hth
MB
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recently one of my friend got these also..
Can u call a,
1. servlet from a servlet
2. a jsp from a servlet
3. a jsp from a jsp
4. a servlet from a jsp
well, I feel all combinations are possible. any comments from anyone ?
Leena
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most common question :
1) servlet life cycle
...and based on this...what do u do in init method, and something about service method
These are my favorites , I ask people these days
2) when to use servlet, when to use jsp
3) singleThread model
others
4) sharing beans between servlet and JSP
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, Jagdeep u r a SCWCD also. Post answers to all these questions now. It will be your preparation !
Leena
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Bhart ...
Then can you tell me when use servlet and when use jsp ? thank you
 
Jagdeep Singh
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Leena,
I have to interview couple of people in next week. I don't want to be a terminator but just looking for some latest questions!! ((:-
Thanks for your help guys...
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved from Servlets -> Jobs Discussion
 
bharat nagpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hie Engin
I'm very much sure about the use of JSP:
JSP is used (rather essential) in multi-tier environment...it clearly seperates the Presentation
from business logic , designers can easily modify prsentation layer, and developers need not to worry
about presentation...
what I understand is that , JSP will become servlet in the end.
so 1) there is some extra (compilation) time , first time or whenever page is modified
2) Container may add some code, that could otherwise be avoided
so we use Servlets where its not related to presentation , and the part is handled by java development team
only not by the designers, like the controllers in MVC architecture.
please guide me if there is something else?
thanx
 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Bhart.
I understand beter now. If anyone has more information about my question, it would be appreciated.
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is model 1 vs model 2.
Which do you like better Struts or JSTL?
Which do you like better and why: Tomcat or
Jetty?
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gosh ! Rufus, I donno anything about model1 or model2. What are they ? And jetty and JSTL also !
If you know, pls share it.
JagDeep, if you are to take interviews, take it on what is important to your projects, if any. Do not end up discarding a person who might have a capacity to grasp things during the course of the project, but know a lil less at this time.
Did I make sense here ?
Thanks and Regards,
Kirti
 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rufus: what is model 1? The classic MVC?
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this site:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html

Model 1 and Model 2 simply refer to the absence or presence (respectively) of a controller servlet that dispatches requests from the client tier and selects views.


Model 2 is better because you can put all your entitlements/security code in one place.
In my opinion MVC != Model 1 since MVC is a term for a pattern. People sometimes call Model 2 'MVC2' it's not right or wrong to do that (IMO) but it does make things quite confusing.
As for interview tips: Don't get onto subjects that your not 100% confident with!
Simon
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't there such a thing as MVC and MVC2?
I thought the difference between the two was that in MVC2 the model did not notify the presentation layer after state changes?
[ November 07, 2002: Message edited by: Steve Chernyak ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the purpose of a "Front Controller?"
Which of the following scopes are thread-safe?
Application
Session
 
George Lawniczak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops, accidently hit submit.
Which scopes are considered thread-safe?
What happens when you implement the SingleThreadModel interface on a servlet?
Can a ServletContext be shared between multiple JVMs?
What's the difference between the javax.servlet.SevletContext.getRequestDispatcher and the javax.servlet.ServletRequest.getRequestDispatcher
methods?
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rufus BugleWeed:
Which do you like better Struts or JSTL?


Is that supposed to be a trick question? I understood Struts and JSTL to address entirely different needs (Struts is an MVC architecture and JSTL is a collection of useful tags for speeding up development?).. is that wrong? Why would someone like one better than the other - what parts of their usefulness dovetail?
Thanks,
g.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Garann
I think I prefer break dancing over struts.
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic