This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My interview questions

 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you answer on these questions?
 
arulk pillai
Author
Ranch Hand
Posts: 3385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you use datasources? The second question seems to be incomplete.
 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Marshal
Pie
Posts: 20907
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

lets assume A,B,C,D are trees

i think now all are in same distance
keep them in the corner of a square
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
Then AD and BC are more than AB BC etc.
 
Vinay Tj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48453
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course Henry is correct. The trees are planted around or atop a steep hill, hence the tetrahedral pattern.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or in the Sahara desert
 
Sandeep Awasthi
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Henry's answer is the only possibility.
 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic