[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Placement Questions & Answers :: Virtusa

21. You wish to store a small amount of data and make it available for rapid access. You do not have a need for the data to be sorted, uniqueness is not an issue and the data will remain fairly static Which data structure might be most suitable for this requirement?

Answer: an array

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

22. class Test {
public static void main(String[ ] args) {
try {
String s = "5.6";
Integer.parseInt(s); // Cause a NumberFormatException
int i = 0;
int y = 2 / i;
System.out.println("Welcome to Java");
} catch (Exception ex) {
System.out.println(ex);
}
}
}

Answer: NumberFormatException

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

23. What will be the output of the program?
public class TestDogs
{
public static void main(String [] args)
{
Dog [][] theDogs = new Dog[3][];
System.out.println(theDogs[2][0].toString());
}
}
class Dog { }

Answer: An exception is thrown at runtime

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

24. Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.

Answer: public static void main(String args[])

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

25. If we do
ArrayList lst = new ArrayList();
What is the initial capacity of the ArrayList lst ?

Answer: 10

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

26. "Software engineers should not use their technical skills to misuse other people's computers."Here the term misuse refers to:

Answer: All of the mentioned

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

27. Explain what is meant by PRODUCT with reference to one of the eight principles as per the ACM/IEEE Code of Ethics ?

Answer: Software engineers shall ensure that their products and related modifications meet the highest professional standards possible.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

29. Which of these classes implement the Collection interface SortedMap. Select the one correct answers.

Answer: TreeMap

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

30. Which of these are core interfaces in the collection framework. Select the one correct answer.

Answer: Map

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa