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

Interview Question

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Recently i attended an interview with a MNC. I was asked few questions as below which made me to confuse and think

Question 1: How do you get the db connection and in what way you communicate to database from your project

I said, am using datasource that is registered with JNDI service and hence on look up i am getting the connection. However for the second part in the question, i was confused.

Please let me know how should be the good and professional answer for this question. I am also using EJB 2.0 in the application.

Question 2: In struts 1.x can i call the controller from model

I said, the action servlet will invoked on user request and hence the servlet will decide the forward path, form to be used, relative beans etc and also i drew a diagram representing the architecture of struts mvc model.

The diagram i drew was as similar in the below link

http://www.ibm.com/developerworks/websphere/techjournal/0304_barosa/images/image002.jpg

Please let me know by asking the above question, what does the interviewer expecting and how should my answer be more convincing

Question 3: What is the difference between doget and dopost request

I said, in

doget: user entered data is appended to the URL as query String. It can send only limited amount of data.

dopost: the user entered is not appended to the URL.It can send any amount of data.

The interviewer said that he wants more good answer and professional answer. Also asked me to think answer based on JVM.

I was confused. Please let me know how should i have convinced him.

Thanks in advance







 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prakash Kumar M wrote:
Question 1: How do you get the db connection and in what way you communicate to database from your project



you are using Connection Pooling. thats fine. i think he expect exactly at what place you are getting the connection from Connection Pooling

Prakash Kumar M wrote:
Question 2: In struts 1.x can i call the controller from model



Normally, Controller should called by the Container . Programmer expected to code in the Controller by using Model(POJO).So Answare to this question is No.

Prakash Kumar M wrote:
Question 3: What is the difference between doget and dopost request



your anware was fine. Additionally, any updation Operation for the DB should call by doPost and querying[Fetching] the DB should call by doGet since doPost is a non-idempotent according to the Http 1.1 Specification.


Hope this helps
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way:what is your interview result
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prakash Kumar M wrote:Question 3: What is the difference between doget and dopost request

I said, in

doget: user entered data is appended to the URL as query String. It can send only limited amount of data.

dopost: the user entered is not appended to the URL.It can send any amount of data.

The interviewer said that he wants more good answer and professional answer. Also asked me to think answer based on JVM.


For this question, I'll go with seetharaman answer and what does he mean by "think answer based on JVM." How JVM plays role in HTTP Request types ?
 
Prakash Kumar M
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

seetharaman and sagar thanks for your suggestion.

seetharaman wrote: i think he expect exactly at what place you are getting the connection from Connection Pooling



seetharaman, from the above information, you guess that the interviewer has expected me to tell if i have retrieved connection through any class file or dao. I did not understand please elaborate. Sorry if this is too basic

Also, as sagar said, even i was confused when the interviewer asked me to think the difference between doget,dopost with reference to jvm.

My interview results are not yet informed.

 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic