Face to Face Java Interview Series 47

Face to Face Java Interview Series 47

This is next face to face third and last round of interview in BNP Paribas for Sr. Java Developer. Interviewer was Sr. Developer in the team and asked below questions:

1. What Runtime.halt() does ?
Answer: Runtime.halt() method is from class Runtime which is inside java.lang.Object package. Below is detais:

public void halt(int status)
When call this method it forcibly terminates currently running JVM also please note this method never returns to normally.
When you planning to use this method take extreme caution and unlike exit method, this method will not cause shutdown hooks to be started and doesn’t run uninvoked finalizers if finalization-on-exit been enabled. If shutdown sequences is already initiated, this method doesn’t wait for any running shutdown hooks or finalizers to finish their work.

Parameters it takes:
status – Termination status. By convention, a nonzero status code indicates abnormal termination. If the exit (equivalently, System.exit) method has already been invoked then this status code will override the status code passed to that method.

SecurityException – If a security manager is present and its checkExit method does not permit an exit with the specified status

2. What is difference between Runtime.exit() and Runtime.halt()
Answer: Runtime.exit() method is from class Runtime which is inside java.lang.Object package.

public void exit(int status)
This method terminates currently running JVM by initiating its shut-down sequence and when call this method it never returns normally. The argument takes status code and by convention its a nonzero status code indicates abnormal termination of process.

The JVM machine shutdown sequence consists of two phases. In the first phase all registered shutdown hooks if exists are started in some unspecified order and allowed to run concurrently running program until they finished up. In the second phase all uninvoked finalizers are run if finalization on exit been enabled. Once this is done JVM halts.

If this method invoked after JMV begun it’s shut-down sequence then if shut-down hooks are being run this method will block indefinitely. If shut-down hooks already been run and on-exit finalization been enabled then this method halts JVM with given status code if status is non-zero otherwise it blocks indefinitely.

The System.exit method is conventional and convenient means of invoking this method.

Its parameters:
status – Termination status. By convention nonzero status code indicates abnormal termination.
SecurityException – If security manager is presence then its checkExit method doesn’t permit exiting with specified status


3. What is unique index
4. What is unique key in the data base
5. How do you find file in Linux
6. What is less and more command
7. Have you worked in any work flow which process trade in low latency
8. How do you process trade data what kind of system or work flow you have used
9. Have you used parser to parse XML data – She was interested to get explanation of JAXB
10. How you pass data back forth on trade system –> She was asking about what kind of protocol I have used
11. What is fix protocol have you used it
12. How do you exchange data between two system –> She was asking about data exchange in XML format
13. What is lazy loading in spring
14. What is lazy loading in hibernate
15. What is scope of object in Spring
15. How you handle transaction in hibernate
16. Have you done any reverse engineering how and what kind of tools you have used
17. How do you generate hibernate object or table what kind of tools you have used
18. Can you work on client side
19. Do you know HTML5
20. Can you tell me about AngularJS and have you worked on it

Leave a Reply

Your email address will not be published. Required fields are marked *