Merittrac Question Papers

Merittrac Online Test Questions

I took up a Java test with Merittrac (Chennai). I would like to put down the questions which might be helpful for others.

Others if have attended online test with Merittrac please add the questions you have faced in the comments below.

Section I : Apptitude - 20 Mins
Section I I: Java 15 Questions - 20 Mins
Section IIII : Java Programming - 2 of 3 gives questions - 20 Mins

Section I I:

1. How would garbage collection keep track on live objects and objects without reference

2. How would you enhance garbage collection ? (memory allocation or method of gc like single or gen...)

3. Name the super class of ArrayList and implemented interfaces

4. What is the output of the following code
public class Test {
public static void main(String a[]){
List li = new ArrayList();
li.add(46);
li.add(2);
li.add(new Integer(50));
li.add("List");
li.add(false);
li.add(1.025);
System.out.println(li);
}
}


5. Which of the following are unchecked exceptions (EOFException, NumberFormatException, FileNotFoundException, AssertionError)

6. Name the superclass of AssertionError ? (Thorwable, Error....)

7. Choose one of the option - A constructor cannot (Override, Overload, .....)

8. What will happen from the below code
public class Test {
public static void main(String a[]){
int x = 0;
int y = 50/x;
}
}

9. What will happen in the following code
public class Test {
static{
print(10);
}
public static void print(int x){
try {
System.out.println(x);
} catch (Exception e) {
} finally {
System.out.println("The End");
}
}
}

10. Name the super class of Java
(What a weird question)

11. Is it possible to throw exception from an overridden method

12. What is the output of the below code

public class Test {
public static void main(String a[]){
try {
if(a.length==0)
return;
System.out.println("Try Block...");
} catch (Exception e) {
System.out.println("Exception Block...");
} finally {
System.out.println("Final Block...");
}
}
}

Section III

Have to choose 2 out of 3 and write the program, compile, run and submit the code.

This is quite hard to finish in 20 mins. I completed only one question and the time was out !!!

Rather i would say the editor was too bad and slow. Even mouse provided dint work properly and was ridiculous. It would have been easy to write the code in a notepad rather than typing it in their wonderful test environment.

I choose "Inheritance" and was asked to write a program and compile which meets the below points
  • Write Employee class with id, name, salary, address with getter and setter
  • Override the toString() method and return employee details
  • Override the equals() method and check if same employee
  • Write a Manager class which extends the Employee class
  • This should have setSalary() method and increase the salary by 5% when called.

Thank You !!


No comments:

Post a Comment