Amazon Interview Question for Software Engineer / Developers






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

Dosent makes sense if you make them private because interface has no method bodies so who will then use these variables ......

- abid January 22, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

public- need to accessed outside the interface.
final- like a constant. need to be same for all class.
static- we need to have same copy for all the classes.

- Neel August 04, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

public: So you can use in polymorphic variables...Use as composition and call all public methods...Use case when you do not implement the interface but contain it.
static: Since with an interface, you do not associate an instance...instance is more implementation specific
final: Again, if some app modifies members of the interface, you cannot track down whom else it may affect

- King_K July 02, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Its an interface, hence can have only constants. Hence the final.

First of all interface by its name should have abstract methods. Only set of method signature that's all. Hence all the variables are made static as they are not really a part of the class.

As the variables are static they should be accessible from anywhere to any client. Hence they are made public.

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

Because anything else is part of the implementation, and interfaces cannot contain any implementation.

- master January 03, 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