Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / April 2007

Tip: Looking for answers? Try searching our database.

URGENT need soln to this problem.. for PROJECT interview...

Thread view: 
Aditi - 25 Apr 2007 13:13 GMT
Hi everyone!
PLEASE suggest a solution for this problem i need to submitt it in 3
hrs... for my project interview..thanks

Following is the problem, You need to come up with a solution for it
in PL/SQL, Write a working stored proc for the same.

Consider the following table:

    Person A    Person B       Relationship

       1               3               a
       3               2               b
       4               6               c
       4               5               d
       6               2               e
       4               7               f
    8               9               g
    9               4               h
    2               6               i
    7               1               j
    2               3               p
    1               7               k
    3               6               l
    7               5               m
    5               4               n
    8               3               o
    9               3               p
    4               6               q

What is needed to be done is:

Recursively loop through this table given 2 arguments Person A and
Person B. Find all unique paths which lead from A to B and keep
concatenating the relationship in the output .

Take this example for reference:
------------------------------------------------------------------------------------------------------------------------
Relation 1:

Anil  is brother of  Seema,
Seema is friend  of  Meena and
Meena is child   of  Teena

Relation 2:

Anil  is  friend  of Guru
Guru  is  brother of Ram
Ram   is  father  of Sham
Sham  is  child   of Reema and
Reema is  friend  of Teena

Then find out the all the relationships b/w Anil and Teena.

Anil, Teena are the input parameters.

First output: Anil - brother of - Seema- friend of - Meena - child of
- Teena

Second output: Anil - friend of - Guru - brother of - Ram - father of
- Sham -child of - Reema - friend of - Teena

-------------------------------------------------------------------------------------------------------------------------

Likewise, you have to find all the unique relations that can exist
between A and B without getting into an infinite loop.

Please follow standards and naming conventions followed in your last
project.

Please send the solution as an attachment.
EricF - 26 Apr 2007 06:03 GMT
>Hi everyone!
>PLEASE suggest a solution for this problem i need to submitt it in 3
[quoted text clipped - 69 lines]
>
>Please send the solution as an attachment.

So if I help you do I get the job? Or are we just helping you with your
homework? And we want to do this because ....
David Harper - 26 Apr 2007 06:17 GMT
>> Hi everyone!
>> PLEASE suggest a solution for this problem i need to submitt it in 3
>> hrs... for my project interview..thanks
>>
>> Following is the problem, You need to come up with a solution for it
>> in PL/SQL, Write a working stored proc for the same.

[SNIP]

>> Please follow standards and naming conventions followed in your last
>> project.
[quoted text clipped - 3 lines]
> So if I help you do I get the job? Or are we just helping you with your
> homework? And we want to do this because ....

Nobody posted a solution, so I guess that Aditi didn't get the job.

I hear that McDonalds is still hiring, and they don't set Java coding tests.

David Harper
Cambridge, England


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.