Bloomberg LP Interview Question for Software Engineer / Developers






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

finally

is NOT executed in only 2 cases: JVM crash and a System.exit() call before it can be reached.

In this case, first the return value of 10 will be encountered but when the finally block is executed, the return there will provide the actual return value.

In short, 20 will be returned, not 10.

P.S. Bad practice and should not ever be used except as a thought exercise.

- TY February 04, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If it is C#, this would be a compile error. Control should not leave from a finally block.

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

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("The return value is : " + returnTest() );
	}

	public static int returnTest() {
		try {
			return 10;
		} finally {
			return 20;
		}
	}
}

It prints 20..

- Initrd February 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good work...

- Roshan December 16, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Padmanabha Reddy Kolagatla for bloomberglaw.com
I do not know how Pinky Deewani became manager
They make you work 10 to 12 hours and pay only 8 hrs, crappy architecture, any one line of code you change, you have using free jetty and it takes 30 minutes.
I wonder the great mayor M. Doomsberg knows about his shitty company

- Anonymous April 18, 2010 | 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