Highbridge Capital Interview Question for Java Developers


Team: Risk Metrics
Country: United States
Interview Type: Phone Interview




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

When u should n't use FINAL
Variable:When you know u r gonna change the value of the variable.
Method:If you wanna override the method in child class dnt use FINAL.
Class:If want to inherit the class dnt use FINAL

- sarthakiter July 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

"Class:If want to inherit the class dnt use FINAL"
What if you were inheriting a class that had a variable that wouldn't change for all child classes?
Example: Course Class.
There can be many different courses, but each course MUST have an enrollment maximum of 20. This could be a static final variable, right?

- Adam August 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
3
of 3 vote

final cannot be used for
1. methods inside interface (by default all the methods are public abstract)
2. abstract class
3. abstract methods
Reason : abstract means the class/method need to be extended/overridden. Which is opposite of final. Hence compiler will throw exception

- pratap.raavi July 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>

void main()
{
int a=10,b=2;

b=a+(++a);
printf("%d",b);

}


wht wll be the output this ques??

- Anonymous July 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The output will be compiler dependent.. The value of a is ambiguous

- uma trika August 02, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

22

- suhas meena July 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

why we should not use final keyword....??
General:when we dont want to override the class member
for class:when we dont want to create a sub class for a class or to inherit
for method:when we dont want to define the method in the sub class
for field:when we dont want the field to be define the field in the sub class

- Anonymous September 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Final :
Avoid using when you class is opening for inheritance. It can not use in interface n abstruct method.

With in class you should be not if member variable is changing values during processing and it can be reassigned.

- http://javadecodedquestions.blogspot.sg/2012/03/java-interview-with-investment-bank-4.html February 20, 2013 | 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