is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
Let’s take up this question in design point of view. Usually go for an abstract class when you have a set of classes having a common behavior. That abstract class can contain methods which are common for all the concrete classes which extend from it and have other methods implemented in their own way. For example, consider an abstract class Person; this class can be inherited by Jerry, Thompson and Verica. Because all three are human beings, they have certain features common to all human beings like hands, legs, head, neck etc, and they also differentiate themselves from others in terms of their own behavior (character). Go for interfaces when you want role specific behavior. In the above example, a person may perform multiple roles. For instance, Jerry may have roles such as Doctor (by profession), Father (to his children), Husband (to his wife) etc. Now we can have Doctor, Father and Husband as interfaces implemented by Jerry.
- ChandraValli January 03, 2012Code to an interface than an implementation
You would have come across the above quote many times. Here the word interface doesn't actually mean the interface in java. It just means coding to a super type than to the concrete sub type. It may be implemented either using interface or abstract class based on requirement.
To conclude, use abstract class and interface based on requirement (or design) and not for sake. Always think in terms of design than implementation. When they are used effectively, it improves code maintenance and re usability.