Goldman Sachs Interview Report
- 0of 0 votes
AnswersIf a java class has methods declared
as followsclass A public synchronized void m1() { //whatever code } public synchronized void m2 { // whatever code } // note that return type is not relevant here.
if a class is created with A a = new A() and
- SoMiE July 11, 2013 in India
if a thread T1 is executing a.m1 and another thread T2 wants to execute a,m2 - what will happen?| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - -3of 3 votes
Answersclass Test { public void m1(String arg1){ arg1 = "Am I going to disappear?"; } public static void main (String[] args) { Test test = new Test(); String iAmOfAnArgumentativeNature = "I am born new"; m1(iAmOfAnArgumentativeNature); System.out.print(iAmOfAnArgumentativeNature); } }// end class
What is the output?
- SoMiE July 11, 2013 in India| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - -3of 3 votes
AnswersA set of milk containers has capacities of 5, 4, 3, 2 , 1 etc . Lets say X containers
- SoMiE July 11, 2013 in India
There is another set of Y containers
If you are going to transfer water from one to the other and each transfer has a fixed cost C, evaluate and state the complexity of the algorithm to achieve a least cost transfer.| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Algorithm - 1of 1 vote
AnswersImplement Object Pool for database connections in the following interface
interface Pool{ public Connection get() public void put(Connection c) }
It should have object pool characteristics.
- SoMiE July 11, 2013 in India
Hint - The emphasis is on which data structure you will use to achieve this.| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Data Structures