Amazon Interview Question for Software Engineer / Developers






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

Interface should be preferred over inheritance because interfaces increase code reusibility, decreases coupling and reduces the chances of breaking of sublasses dude to change in superclass

- ashwini manny August 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we use inheritance to extend the behavior of an object while interfaces are used to implement behaviors from one or more than one object (multiple inheritance in c++)

- mnemonique June 05, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the primary reason for making a choice between inheritance and interface is to make the distinction of having default behavior of the object.

In inheritance, the child class extends the parent class's behavior as the default and this is the case for all other subclasses of that parent class.

In interface, you are simply defining a common set of operations that may be entirely different depending on the implementation.

- nunbit romance June 05, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface should be preferred over inheritance because interfaces increase code reusibility, decreases coupling and reduces the chances of breaking of sublasses dude to change in superclass

- ashwini manny August 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what is "subclass dude" ??? @ashwini manny on August 14, 2009

- maddy October 02, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

he wanted to say 'due'.

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

inheritance is more useful over interface when it comes to reusability , isn't it?

- akshaycmpn January 16, 2011 | 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