Amazon Interview Question for Software Engineer / Developers






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

Finally is invoked after every try catch block instead of whether exception is caught or not. We can right any execution statement in finally whose execution is must, whether exception is caught or not ... example :
closing of database connection, rollback of the complete transaction of a particular session, setting of the response object as per the required customized error to be shown.

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

Finally is invoked after the try-catch whether or not exception is caught

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

Finally is invoked in whatever the case may be. It will be executed for sure; even if the exception occurs.

For example, Closing the DataSource Connection Object [database object]

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

Only case when finally block will not be executed is.. if jvm exits abruptly before completing try block and if thread executing try block is killed.

- Amol March 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a bit nasty but

try{
}catch{
} finally{
  closeConnection();
  doStuff();
  otherStuff();
}

if doStuff throws an exception otherStuff won't be executed.

- Anonymous March 29, 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