Amazon Interview Question for Software Engineer / Developers


Country: United States




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

1. Abstract classes cannot not be instantiated.
2. Abstract classes can be used to represent generic types like Animal
3. Abstract class can be extended by a concrete class in such a case, it must implement all the abstract methods of the abstract class that it is extending, if not, then it this class must be marked as abstract.
4. Abstract class can have abstract as well as non abstract methods.

- mageshkhanna March 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A normal class is a complete class where as abstract class is not a complete class, you can declared the contract as per the requirement in incomplete class, later you can fulfill the contract as defined. loose coupling is provided by abstract class but abstract class is not 100% abstract thats the reason Interface concept came into the picture.

- Aavesh March 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I would like to answer the second part of the question regarding the usage of the abstract class Lets say class A contains methods a1 , a2 and a3. Now a1 is a method which should be implemented specific to the subclass and it has no relevance if implemented in the parent class, and methods a2 and a3 use a1.

The best real time example that uses Abstract class is the InputStream class, here the read method is overloaded and all the overloaded methods depend on the one abstract read method, which is implemented by the specific child classes like FileInputStream , ZipFileInputStream

- goutham467 April 12, 2012 | 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