Apr 27

united health group java interview questions 2013|uhg interview process

UHG Interview process

United Health Group conducted  three rounds for java/j2ee developers on April 27th 2013.

For 2-5 years they conducted three rounds

1) Written test

2) Technical Round-1

3) Technical Round-2

Coming to written test,written test comprises of 20 questions .out of these 20 questions 10 questions are from exception handling and inheritance.

Technical interview is bit tough when compared to written test. In technical interview they asked in depth questions and unrelevant questions for java /j2ee developers with 0-3 years of experience.

Questions given here are posted by one of our visitors rajesh,attended interview on April 27th 2013. Lets say thanks to Rajesh.

United Health Group written test interview questions  and answers

1)      Which of the following type expressions  can be used in switch?

a)      int,byte

b)      int,byte,char,float,

c)       byte,short,int,char,enum

d)      int,char,String,float,double

e)      None of the above

Ans : C

Solution: In Switch statement only int ,char,byte,short expressions are allowed . float, double expressions are not allowed. From Java 6 even enums and Strings are allowed in Switch statements.

2) What is the output of the below program

[code lang=”java”]package UHG;

public class StringConcatDemo {

public static void main(String[] args) {
String s = "Hello";
s.concat("world");
System.out.println(s);
}

}
[/code]

a)      “Hello World”

b)      “World”;

c)       “Hello”

d)      Compilation error

e)      None of the above

3)  Which of the following are correct with regard to sleep() method?

a)      sleep() method suspends the current object for specified amount of time.

b)      sleep() will cause current thread to suspend for minimum amount of time specified in sleep method argument and releases the lock.

c)       sleep() will cause current thread to suspend for exact amount of time.

d)      Sleep() will cause current  thread to sleep for minimum amount of time specified in sleep() method argument. sleep() will not release any lock.

Ans : D

1) sleep() method supspends the current thread not current object for specified amount of time.

2) sleep() method does not releases any lock only wait(),notify() and notifyAll() method releases the lock.

3) Time specified in sleep method argument is the minimum amount of time current thread will sleep not the exact amount of time.

4) Choose the correct order of access modifiers

a) private,public,protected,default

b)public,private,default,protected

c)private,protected,public,default

d) private, default,protected,public

Ans : d

The correct order is d which is more restrictive private to least restrictive public

5) In JSP scope is associated with which object?

a) Session object

b) Servlet Context object

c) Servlet Config object

d) Page context object

Ans : D

Page context object is used to define different scopes such as SESSION_SCOPE, PAGE_SCOPE,REQUEST_SCOPE.

6)

[code lang=”java”]
package UHG;

public class ThreadExample implements Runnable {

public void start() {
System.out.println("Iam in start method");
}

public static void main(String[] args) {

Thread t = new Thread();
t.start();

}

}

[/code]

1)      Iam in start method

2)      Compile time error

3)      Runtime exception

4)      No output

5)      None of these

Explanation : whenever our class implements Runnable it should implement run() method but in the above code we don’t have run() we get compile time error.

2)      Compile time error

3)      Runtime exception

4)      No output

5)      None of these

7)

[code lang=”java”]

package UHG;

public class A {
A() {
System.out.println("Test started");
System.out.println("Iam in class A");
}

}

package UHG;

public class B extends A {

B() {
System.out.println("Iam in Class B");
}

}

package UHG;

public class C extends B {

public C() {
System.out.println("Iam in class c");
System.out.println("Test completed");
}

}

package UHG;

public class Test {

public static void main(String[] args) {

A a = new A();
B b = new B();
C c = new C();
}

}

[/code]

what is the output of the above program?

1) Test started

Iam in class A

Iam in Class B

Iam in class c

Test completed

2) Test started

Iam in class A

Test started

Iam in class A

Iam in Class B

Test started

Iam in class A

Iam in Class B

Iam in class c

Test completed

3) Test started

Iam in class A

Iam in Class B

Iam in class c

 

4)None of the above

Ans : 2