Goldman Sachs Interview Question for Software Engineer / Developers






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

Interface is used in scenarios where a class needs to implement all the functionality(methods) defined in the interface.
eg: If you have to design a car you have to implement methods like steering(), wheels(), brake(), gearbox(). These are the essential methods when you have to design a car. So these methods has to be in an interface if you are designing a car.

Abstact class can be used when you need to implement some part of the functionalities defined.
Eg: There are some feature which may or may not be present in a car like powersteering() , Airbag(), musicSystem() these details can be present in an abstact class as non abstract methods. The abstact methods can be steering(), wheels(), brake(), gearbox(). So every class has to implement these abstract methods and can or cannot implement those non abstract methods when you extend an abstract class.

- Srikanth May 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface is like a contract, in C++ it may or may not have any implementation. in Java there is keyword , interface
Abstract class can be called as interface,

- Vijay June 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

basically interface helps in bringing in oop concept of multiple inheritance in java which is otherwise not possible

- jango January 04, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface = establish contract, but no generic functions required, no is a relation
abstract class = establish contract, generic functions required, is - a relation exist

- 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