Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets interview questions . . .

 
Jagdeep Singh
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys any suggestions about questions interviewer might ask on servlets. Thanks in advance
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • 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
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • 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
 
bharat nagpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved from Servlets -> Jobs Discussion
 
bharat nagpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you Bhart.
I understand beter now. If anyone has more information about my question, it would be appreciated.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Elizabeth King
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rufus: what is model 1? The classic MVC?
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • 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
 
Steve Chernyak
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • 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 ]
 
George Lawniczak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • 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.
 
Peewee Kochs
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Garann
I think I prefer break dancing over struts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic