Amazon Interview Question for Software Engineer / Developers






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

by declaring a method/variable static, we assign it to the entire class rather than any instance in specific.

as a result, such variables/methods are loaded in memory even before a class is instantiated.

- Anonymous November 08, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

No need to create instance, but you will have a restriction like you can create only one classmember variable or classmethod in a class?

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

May be volatile keyword in java is somewhat equivalent to static.

volatile variable is one whose value is always written to and read from "main memory". That means that different threads can access the variable.1.

- Shri June 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

May be volatile keyword in java is somewhat equivalent to static.

volatile variable is one whose value is always written to and read from "main memory". That means that different threads can access the variable.1.

- Shri June 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

well it has different meanings in different contexts..
when used with a member in a user-defined data structure such as a class, it specifies that the member is of that type itself rather than for every specific object of that class

when uses with a variable in a function, it retains its state between the function calls

for example:

void test(int current)
{
static int i; //initially will be zero if nothing is initailised
current = current + i;
print current;
}

int main()
{
for(int i=0;i<5;i++)
test(i);
}

the output should be 0 1 3 6 10

- veerun14 December 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Unlike C/C++, Java doesn't allow static variable inside a method. Only legal modifier for a local variable is "final".

- lohith December 25, 2010 | Flag


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