Goldman Sachs Interview Question for Financial Software Developers






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

The parameters could be of type struct.

- Sameer Deshpande September 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This is a very elegant solution

- sraks January 13, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Not yet sure what works best, but here are some thoughts I can throw around:

1) If D has no other data members, consider collpasing into one class, get rid of other, either B or D.
2) If that's not desired, create a separate function(s) to process args. Make it the friend function of both B and D, thereby comitting first degree murder of OOP concepts. But, you've accomplished what you wanted (ONE place to update). Bad part is, friend function will need all the logic to differentiate betn B and D inside.... or would it?!
3) Your thoughts here.

- Nix September 23, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we can use the variable number arguments list. Something like printf function uses. As we know printf can take n number of arguments. We can use that facility here. Uee macro va_list, va_start etc...

- Hiten Parmar September 24, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

you could use the ellipsis ("...") as the last argument, representing any variable number of unspecified arguments for the function.

- zc October 09, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/

- Anonymous October 16, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think we can use templatized class and make T as a member of B.

- ac November 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use using B::B; in D's definition to inherit constructors.

- Anonymous December 05, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think Default arguments to the base class constuctor will solve this problem

- Ashok February 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

you could use the Builder design pattern. You could create a inner class named Builder or Buildable with setter methods for all the mandatory variables of the outer class and a build method. The caller calls each of the set methods on the Builder class and at the end calls the build method, which sets all the outer class variables and returns an instance of the outer class. You could also NOT provide any setter methods in the outer class, so that the outer class can be constructed only through the inner class build method

- Anonymous March 05, 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