aspose file tools*
The moose likes Jobs Discussion and the fly likes My interview questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Careers » Jobs Discussion
Bookmark "My interview questions" Watch "My interview questions" New topic
Author

My interview questions

Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
Hello Friends,
I have attended recently one interview.In that they asked some questions, please post your answers....
Q1: Without using coding/hard coding, how the Application server communicate with database server?

Q2: 4 trees placed in same distance with any combination.How it is?(Non IT question)
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
How did you answer on these questions?
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3253
Did you use datasources? The second question seems to be incomplete.


500+ Java Interview Questions and Answers | Java job hunting know how & Java resumes
Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
@Misha Ver:
I told answer for 1st question: Using data sources/Using JDBC.
I told answer for 2nd question: I tried to tell Square,Circle, but I did not find proper answer.
I am waiting for your valuable answers.

@arulk pillai
I told him(interviewer) by using datasources we can do that,but he was not agree.He was expecting without using java code.
Is it possible with XML?


My 2nd Question:
He wants to place the 4 trees(A,B,C,D) in same distance with any combination(AB=AC=AD=BC=BD=CD).
What can be the design(like Square,Rectangle,Circle)? (Non IT question)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18978
    
  40

shree dhara wrote:My 2nd Question:
He wants to place the 4 trees(A,B,C,D) in same distance with any combination(AB=AC=AD=BC=BD=CD).
What can be the design(like Square,Rectangle,Circle)? (Non IT question)


Use a Tetrahedron.... aka. a pyramid, with a triangle base.

Put one tree at each corner. And one tree on top.

Henry
Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
Use a Tetrahedron.... aka. a pyramid, with a triangle base.

Put one tree at each corner. And one tree on top.

Dear Henry,
Your answer may be right for other things, but we can't place trees in pyramid design.They should be place on earth....right...
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

shree dhara wrote:
Use a Tetrahedron.... aka. a pyramid, with a triangle base.

Put one tree at each corner. And one tree on top.
but we can't place trees in pyramid design.They should be place on earth....right...

But we can dig some space around the earth, right?

I told him(interviewer) by using datasources we can do that,but he was not agree.He was expecting without using java code.
Is it possible with XML?

Straight forward .properties file will work, if that comes in "without using java code"


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
But we can dig some space around the earth, right?


you may right, but any alternatives?


Straight forward .properties file will work, if that comes in "without using java code"


We should not use JDBC code like DriverManager.getConnection(...);Statements,Resultsets....

As of your suggestion,we have to place all properties in one propeties file and then using java code we have to use it...right...

Even if it is right....interviewer did not accept this logic also..

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

shree dhara wrote:
But we can dig some space around the earth, right?
you may right, but any alternatives?

No, I can't think of any other alternatives.
shree dhara wrote:
Straight forward .properties file will work, if that comes in "without using java code"

As of your suggestion,we have to place all properties in one propeties file and then using java code we have to use it...right...
Yes
shree dhara wrote:Even if it is right....interviewer did not accept this logic also..

Then say, "Sorry Sir, I don't know the better approach than this"
Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
Then say, "Sorry Sir, I don't know the better approach than this"


Finally I told sorry!...no idea...

Can we do persistence using XML regarding 1st Question?
harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221

lets assume A,B,C,D are trees

i think now all are in same distance
keep them in the corner of a square


SCJP 1.5
"A candle looses nothing by lighting another candle"
itechmentors.com
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10519
    
    9

No.
Then AD and BC are more than AB BC etc.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Vinay Tj
Greenhorn

Joined: Feb 22, 2010
Posts: 3
Hi shree dhara,

I can able to answer for the 2nd question.
Consider a pyramid having triangular base, it will be having 4 corners.
In pyramid base, you can place 3 trees at each corners and 1 at the top corner

Now all four will be at equal distance.

Thanks,
Vinay


Regards,
Vinay TJ
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

shree dhara wrote:Can we do persistence using XML regarding 1st Question?

Thats make me to ponder your orignal question.
Q1: Without using coding/hard coding, how the Application server communicate with database server?

Here, coding and hard-coding are 2 different things.
w/o coding: May be he expect some JNDI code. I don't have nay idea about persistent API here.
w/o hardcoding: Here I can bet, he don't want a code where JDBC URL and user/password settings is given in the Java code itself, but in some external setting file.

And Vinay Tj, you are late, Henry already suggested the same approach.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10519
    
    9

Vinay Tj wrote:Hi shree dhara,

I can able to answer for the 2nd question.
Consider a pyramid having triangular base, it will be having 4 corners.
In pyramid base, you can place 3 trees at each corners and 1 at the top corner

Now all four will be at equal distance.

Thanks,
Vinay


That is what Henry said in his reply isn't it?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39800
    
  28
Of course Henry is correct. The trees are planted around or atop a steep hill, hence the tetrahedral pattern.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
shree dhara wrote:Hello Friends,
I have attended recently one interview.In that they asked some questions, please post your answers....
Q1: Without using coding/hard coding, how the Application server communicate with database server?

Q2: 4 trees placed in same distance with any combination.How it is?(Non IT question)


It impossible to correctly answer on the first question without nothing the detail. These kind of questions require some the collaboration between interviewer and interviewee. You should ask interviewer to explain the question, so you could answer properly. I suspect that interviewer wanted you to explain how any two servers would communicate with each other.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Campbell Ritchie wrote:Of course Henry is correct. The trees are planted around or atop a steep hill, hence the tetrahedral pattern.


The trees could be planted on the different levels of the building.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3253
or in the Sahara desert
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
I think Henry's answer is the only possibility.


Sandeep
Sri Dharan
Ranch Hand

Joined: Aug 21, 2008
Posts: 74
It impossible to correctly answer on the first question without nothing the detail. These kind of questions require some the collaboration between interviewer and interviewee. You should ask interviewer to explain the question, so you could answer properly. I suspect that interviewer wanted you to explain how any two servers would communicate with each other.

I asked the interviewer to explain the question, but he did not explain properly,thats why I posted here. If any body understand the question , it can be helpful to us.

The trees could be planted on the different levels of the building.

2nd question's answer Henry answer may correct.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
shree dhara wrote:I asked the interviewer to explain the question, but he did not explain properly,thats why I posted here. If any body understand the question , it can be helpful to us.


Perhaps the interviewer wanted from you something like http://java.sun.com/javaee/5/docs/tutorial/doc/bnaay.html or http://en.wikipedia.org/wiki/Internet_Protocol_Suite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My interview questions