jQuery in Action, 2nd edition*
The moose likes Jobs Discussion and the fly likes Servlets interview questions . . . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Careers » Jobs Discussion
Bookmark "Servlets interview questions . . ." Watch "Servlets interview questions . . ." New topic
Author

Servlets interview questions . . .

Jagdeep Singh
Ranch Hand

Joined: Oct 14, 2002
Posts: 106
Guys any suggestions about questions interviewer might ask on servlets. Thanks in advance


Jagdeep Singh<br />SCJP;SCWCD;IBM Certified XML Solution Developer;SCBCD1.3
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
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

Joined: Jun 18, 2001
Posts: 351
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


[SCJP2, SCWCD1.3, SCBCD]
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
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

Joined: Jun 18, 2001
Posts: 351
Hmm, Jagdeep u r a SCWCD also. Post answers to all these questions now. It will be your preparation !
Leena
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
hi Bhart ...
Then can you tell me when use servlet and when use jsp ? thank you
Jagdeep Singh
Ranch Hand

Joined: Oct 14, 2002
Posts: 106
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

Joined: Feb 20, 2001
Posts: 3695

Moved from Servlets -> Jobs Discussion
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
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

Joined: Feb 09, 2002
Posts: 174
Thank you Bhart.
I understand beter now. If anyone has more information about my question, it would be appreciated.
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
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

Joined: Jun 18, 2001
Posts: 351
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

Joined: Jul 11, 2002
Posts: 191
Rufus: what is model 1? The classic MVC?
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
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

Joined: Oct 19, 2000
Posts: 113
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

Joined: Aug 12, 2002
Posts: 27
What is the purpose of a "Front Controller?"
Which of the following scopes are thread-safe?
Application
Session
George Lawniczak
Greenhorn

Joined: Aug 12, 2002
Posts: 27
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

Joined: Jan 28, 2002
Posts: 214
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

Joined: Nov 26, 2002
Posts: 2
Garann
I think I prefer break dancing over struts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets interview questions . . .
 
Similar Threads
Marathon testing tool
Completed SCWCD 1.4
Question about ant
mySql connection
BEA web logic 8.1