Goldman Sachs Interview Question


Country: United States




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

An interface has a number of usages.
1. We will adopt the great principle of P2I - program to interface. By which we will not adhere to the concrete implementation of rather to the interface, which will give a room for change later on
2. They act as contract for management. Any class which claims that it is implementing the interface shall adhere to the contract so that we are sure whenever we are using that class, the contract is satisfied - even without looking into the actual code

Real time examples - collection classes of Java -

- ethioer July 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Sorry . I forgot to mention . They're asking in terms of java .

- Shobhit July 11, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Interface:-- Simply we can say that interface is the contract among the Technology and devloper and we cmply we can say that Interface is the standards which implements by programmers...

Real life Example:-- Simply real life ex of intreface is Credit card how-- if there is any market in india which has all country shop
if u hv only rupss u cn soping only india's shop by credit card u can sopping from any country'shop means by interface we can implements according to u(programmers)

- sumeetmca1988 August 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

As i understand it, Interfaces are the minimum contract that helps manage classes that extend them. On windows systems, all plugins extend IUnknown interface of windows. This way of contractual programming makes it possible to develop applications in future as long as all the components in future are guaranteed to agree to the interface.

- Yoda July 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Sorry . I forgot to mention . They're asking in terms of java .

- Shobhit July 11, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Class always implements interface.

- Harish Arora May 03, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

real time example of interfaces are so many like the one very common IDisposable interface to dispose off the non managed resources..

- deepika July 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

An interface (in Java) is used to for inheritance i.e to create a super class sub class relationship. Any class that implements this interface will inherit all the methods of the interface .

- nk July 25, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

The real importance of interfaces in Java can be explained by looking at the Collections API.

Lets take an example of interface List. It defines a contract that every implementing class must implement, while giving them the independence of implementing it the way they want. The main advantage of using an interface over here as opposed to using an abstract class is that a single implementation can bind to multiple contracts.
For example, the class LinkedList implements interface Queue as well as List. If they would've been abstract class, LinkedList wouldnt have been able to extend both of them at the same time.

Another example i would like to add is interface Serializable. This is called a marker interface as it doesnt contain any method that the implementing classes needs to define. It is solely used by the JVM to identify whether the state of the class can be saved or not.

- chandershivdasani August 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Real Time Example : calculate area of circle, and create an interface that holds value of PI =3.14 etc. Also add relevant parameters, and implement in class.

- hmmm December 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

Not knowing about Java so much... But in general for the programming wise, if you want to implement some sort logic, disposal logic by your own, if you implement appropriate interfaces to your class e.g.) IComparator, IDisposal or etc..., you can define your own behavior for the corresponding methods and that's the most beneficial cases for using built-in interfaces.

Maybe, I'm describing about polyrhythm and bit pointless as an answer...

- TS July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 votes

There seems to be a lot of (probably self-) promotion of these saurabhschool videos going on on this website.

I did check out the collection of videos at some point. In terms of the algorithmic stuff, they are by no means comprehensive of what you need to know for tech interviews, but the quality and depth of discussion on the questions that are covered is decent.

But I don't recall anything there that discussed interfaces or OO. If you're going to promote some other website, can you at least include a link to the specific video that covers the material?

- Anonymous July 11, 2012 | Flag


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