Monday, 29 February 2016

HSBC Java Experience - Written + Interview

They have a typical pattern. There are 4 rounds-
1. Written - Verbal+Analytical+Technical
2. Values Round - Questions that tests values of HSBC
3. Technical Round
4. HR Round

Below are some test questions-
Round 1
2 passages with with fill in the blanks with closest synonym.

5 questions on set theory
A survey of 100 students produced the following statics: 32 study mathematics, 20 study physics, 45 study Biology, 15 study mathematics and biology, 7 study mathematics and physics, 10 study physics and Biology, 30 do not study any of the three subjects .
Q1 Find the number of students who study all the three subjects.
Q2 Find the number of students who study exactly two subjects.

In a class 40% of the students enrolled for Math and 70% enrolled for Economics. If 15% of the students enrolled for both Math and Economics
Q3 What % of the students of the class did not enroll for either of the two subjects?

Q4 Find the next alphabet in series
B F J _

3 Data Sufficiency Questions

Q5 Find the median if b is greater than a, c is greater than b and d is greater than c and e is the greatest of all.

Blood Relation Question
Q6 She is the child of my fathers wife's only son.

Q7 Identify the valid XML tag from below

Q8 The document that is used by XSLT to indicate how to transform the elements of the XML document to another format is a(n):
a)HTML page.
b)DOCTYPE procedure.
d)stored procedure.

Q9 One question on XPath

Q10 Which of the following driver is slowest
a. Type 1
b. Type 2
c. Type 3
d. Type 4

Q11 When is ServletConfig called?
The servlet container calls the init method exactly once after instantiating the servlet. The init method must complete successfully before the servlet can receive any requests. ServletConfig object contains initialization and startup parameters for this servlet. The ServletConfig object returned is the one passed to the init method.

Q12 Which of the following is a serialization pattern?
a. Memento Pattern
b. Factory

Q13 Which of the following is not a method of Thread class.
a. getName()
b. isAlive()
c. wait()

Q14 Some question of exception thrown when DriverManager is calling getConnection and data source is not found.

Round 2 - Values Round
Online round where you have to select appropriate option - most likely and least likely to follow.
There was not correct answer, it was just to check how your thinking aligns with that of the company.

Round 3 - Technical Interview
Q1 Is finally method always called in Java. Tell me an instance where the finally method is not called.
  1. If you call System.exit() the program exits immediately without finally being called.
  2. A JVM Crash e.g. Segmentation Fault, will also prevent finally being called. i.e. the JVM stops immediately at this point and produces a crash report.
  3. An infinite loop would also prevent a finally being called.

Q2 Can you tell a way is which finally is related to garbage collection. What role do you see of finally during garbage collection

Q3 What is Auto boxing and auto unboxing. How does it helps after being introduced in Java.

Q4 What is serialization. What happens when subclass is serializable and superclass in not serializable.
  1. In case super class is Serializable than all its subclasses will be serializable by default. No need to implement serializable interface in subclass explicitly
  2. In case super class is not Serializable than to serialize the subclass’s object we must implement serializable interface in subclass explicitly. In this case the superclass must have a no-argument constructor in it. Thus all values of the instance variables inherited from super class will be initialized by calling constructor of Non-Serializable Super class during deserialization process. They will be basically set to null.
  3. To prevent subclass from being serialized we must implement writeObject() and readObject() method and need to throw NotSerializableException from these methods.

No comments :

Post a Comment