Amazon Interview Question for Software Engineer / Developers






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

M: ....? ( I have no clue for last question, any idea?)

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

The only way is to redesign the application, keeping in mind the concurrency as a requirement.

- sachinvirgo February 24, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if you create the instance static you don't need to synchronize getInstance()

- alins March 20, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

there is no connection between static declaration and synchronization.
getInstance() method accesses non-local variable hence we have to synchronize it.

- Girish March 20, 2008 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

To synchronize without using synchronized method...

public class Singleton {
public final static Singleton instance = new Singleton();

private Singleton() {}

}

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

instead of synchronize the method you may synchronize a block of code to make it more efficient

- Amit April 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It says we can have private inner class.

http://www.builderau.com.au/program/java/soa/Using-the-Singleton-pattern-in-Java/0,339024620,339280992,00.htm

- check this out. August 02, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Double-Checked Locking is what they are looking for :).

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

I was asked this question ,My answer was locking & he told me that he was expecting the same.

- Ran November 22, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use volatile based implementation for better performance

- Akhil Chityal November 20, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the singleton object can be declared as a global variable and initialized by the main thread. and used by other thread.

it really depends on the actual program, i think. there might be other operations on the singleton object that requires synchronization.

- Anonymous February 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

en.wikipedia.org/wiki/Singleton_pattern

- running July 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ibm.com/developerworks/java/library/j-jtp11234/

- running July 27, 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