Goldman Sachs Interview Question for Software Engineer / Developers






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

Use topologically sorted graph

- Abhijit Mehta June 20, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How will it be if we use a graph data structure? In this A->B,A->C,B->D. So you will probably have an array of nextNode in the data structure to hold as many as dependencies.

- Chinta April 05, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

yes I guess you can use a graph and so the data structure would be an adjcency list or an adj matrix. But the important thing to do here is Topological Sort. This will give us the order in which we should compile the jars.

- Varun Jobanputra December 23, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

by representing it in graph:
A-->B
| |
v v
C D ( v is actually arrow mark ! )

Apply topological sort:
We get 3 possible orderings:
A-->B-->C-->D
A-->B-->D-->C
A-->C-->B-->D

so, it can be either B or C

To compute a topological ordering of G:
Find a node v with no incoming edges and order it first
Delete v from G
Recursively compute a topological ordering of G-{v}
and append this order after v

- e=mc2 February 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

place the jar names in a tree; traverse the tree in post-order; the order traversed is the order in which the jars should be (e.g. can be legitimately) built.

- Gravometer September 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 3 vote

did not understand the question? sounds very stupid question

- dhrubo July 31, 2010 | 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