Amazon Interview Question for Software Engineer / Developers


Country: United States




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

One thing to add is that if exception occur and you return something from catch block, but still the function will return value from finally block if any.

- Muhammad Khojaye April 10, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks Muhammad nice point.

- Varma May 07, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks Muhammad nice point.

- Varma May 07, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks Muhammad nice point.

- Varma May 07, 2012 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

Java uses finally keyword while we use "try{} catch{}" to catch exceptions. "Finally" keyword ensures the code block after finally can always be executed no matter exceptions were found or not.

- cs.Wang.Yiping March 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

It is generally used to close any db connections or remove any object references that are no longer used after the method exits.

Finally block is executed even if there is an exception in the method.

The only time 'finally' block is not executed is if System.exit(0) is called in the try/catch block.

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

finally block are executed irrespective of whether there are an exception or not.this ensures that all the opened files are properly closed and all the running threads are properly terminated.so the data in the files will not be corrupted and the user is at the safe side.

- masoom 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