Goldman Sachs Interview Question for Software Engineer / Developers






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

Maintain a dependency graph. Each formula gives you the dependent and dependee.

Once you update the value of a cell, do a topological sort starting from that node, and update the values in that order.

- Anonymous August 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

More detail explain?

- Anonymous August 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Obsrever design pattern wiil feet here

- Maayan October 07, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good solution....

- Anonymous February 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Even I would make use of Observer Design Pattern. I think that was the expected answer.

- Bhinav December 26, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

We will have to use Observer pattern. Each cell is an Observable and will have a list of Observers.

Whenever the Observable object value is changed, the Observers will be notified and their value get changed and so on.

"The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems. "

- yesudas March 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

See: en.wikipedia.org/wiki/Topological_sorting

- Anonymous August 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi

I think below will also work

public class ExcelCellApp {
	
	//inner Class Cell to model Excel Cells
	public class Cell 
	{
	int data;
	
	public int getData()
	{
		return data;
	}
		
	}
	
	
	public static void main(String[] args) {
		
		ExcelCellApp app = new ExcelCellApp();
		Cell A1=app.new Cell();
		Cell B1=app.new Cell();
		Cell C1=app.new Cell();
		Cell D1=app.new Cell();
		//Here need to Set A1 cells data
		A1.data=2;
		System.out.println(" A1 cell data "+A1.getData());
		B1.data=A1.getData()+3;
		C1.data=A1.getData()*2;
		System.out.println(" B1 cell data "+B1.getData()+" C1 cell data "+C1.getData());
		D1.data=C1.getData()+B1.getData();
		System.out.println(" D1 cells Data "+D1.getData());
	}

}

- Anonymous January 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi,
I think we can use the concept of dictionary here.

With Key's as the cells unique name and value's as the actuall value for that cell.

- Danish March 21, 2012 | 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