Amazon Interview Question for Development Support Engineers






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

Though I know the answer I got it wrong then. I said a lock will be acquired on the method which is wrong. Lock will only be acquired on Object in question but not the method.

I succumbed to the trap.

- perllove January 19, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Synchronized methods enable a simple strategy for preventing thread interference and memory consistency errors: if an object is visible to more than one thread, all reads or writes to that object's variables are done through synchronized methods.

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

When one thread is accessing the shared variable in a synchronized method, all other threads that are accessing the same object's variable should wait until the method exits.

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

When one thread is accessing the shared variable in a synchronized method, all other threads that are accessing the same object's variable should wait until the method exits.

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

Synchronized keyword in a method make it sure that the particular method is accessed by one and only one thread at a time. This is possible because in order to access a synchronized method, a thread need to acquire the lock associated with the method. In case of synchronized method, the lock is the same object on which the method is invoked. Now, as one lock can be acquired by only one thread at a time, the synchronized methods can be accessed by only one thread at a time.

- gadha November 30, 2015 | 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