Goldman Sachs Interview Question for Java Developers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

i didnt get your question what is the capacity of Y containers? and what is fixed cost C is it directly proportional to something??

- Joey September 02, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

I believe your question is incomplete.

- Krishna.bitmca September 09, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Make a binary search tree of the empty containers with their capacities.
Traverse the incoming litres to these accordingly !

- Balu July 12, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I believe your question is incomplete.

- Krishna.bitmca September 09, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The goal should be , put empty the biggest jar into biggest jar in another set so that you dnt hv to pour a jar from initial container set twice.

To Achieve this , make a max heap of both container sets ,
pop out 1 container from each heap.
pour the water from a to b.
Now if both empty , discard them or if either of them has some water left , put them back in heap again. Increase a counter to C.
Complexity - X*(Logx+ LogY)

- Geek July 20, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Please explain the question properly!

- Nomad July 20, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think question is saying
we have two type of containers
let x and y,
let total are 5 containers in each type
x type has 1,2,3,4,5 capacities containers
y has 1,2,3,4,5 capacities containers
let cost to transfer from x to y is given as

y1 y2 y3 y4 y5
x1 3 4 2 1 0
x2 * 2 3 1 4
x3 * * 1 3 2
x4 * * * 2 1
x5 * * * * 3

* indicates that transfer from bigger container to smaller not possible

Answer:-
i think we can solve it by using dp
that transfer content of X1 into Y1 and proceed further, find total cost, then x1 to y2 for each such case find total cost and find min of these total costs.

- erkejriwal June 19, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More