Java technical interview questions for senior java developer for investment bank. This is first round of telephonic interview with one of major investment bank and the interview was taken by non-java person.
1) Tell me about yourself?
2) Your day to day activities?
3) Tell about your current project?
4) How you do integration testing?
5) What is your development and release cycle?
6) What is cluster index and non cluster index?
7) when to you cluster index or non cluster index?
8) Query optimisation ?
9) Design the Carom board in oops concept?
10) What are your current responsibility as team lead?
Another first round of interview with investment bank:
1) What is immutable objects?
Immutable Object Strategy:
- Don't provide "setter" methods — methods that modify fields or objects referred to by fields.
- Make all fields
- Don't allow subclasses to override methods. The simplest way to do this is to declare the class as
final. A more sophisticated approach is to make the constructor
privateand construct instances in factory methods.
- If the instance fields include references to mutable objects, don't allow those objects to be changed:
- Don't provide methods that modify the mutable objects.
- Don't share references to the mutable objects. Never store references to external, mutable objects passed to the constructor; if necessary, create copies, and store references to the copies. Similarly, create copies of your internal mutable objects when necessary to avoid returning the originals in your methods.
Comparable : Implements compareTo (Object obj)
Comparator : Implements compare (Object obj1, Object obj2)
Best use of comparator is where we are using library classes and we want to write our own way of object comparison.
3) HashMap vs TreeMap?
HashMap : Key and Value storage but no ordering.
TreeMap : Key and Value storage but provides ordering
4) What is caching?
This is strategy to reuse earlier created objects.
5) How to analysis prod/uat performance issue?
Use Thread Dump and analyze objects creation and stats. Use VisualVM tool to connect server directly using jmx and do analysis of memory.
6) Application raw query vs store procedure?
If we have more database centric logic then we should use store procedure.
7) Design the external feed update and one feed supersede the other source?
First of all design table with timestamp and once new data is coming update the table new data. Define the feed hierarchy in other table and basis of that do updates.
8) Cluster and non cluster index?
Cluster index sort the physical rows in the database and this is not the case with non cluster index.
Due to this physical sorting we can have only one cluster index.
9) What is Data partition?
This strategy generally used with very heavy volume tables where we want to separate the data on basis of some key. Data partition can be on basis of range, hash or list of keys.
10) Difference Between Static and Volatile ?
This is one way of knowing the information programmatically.
12) What is BFS and DFS ?
BFS : Breadth first search
DFS : Depth first search
13) Explain Hibernate second level of caching?
1) Object Model : We can manage Database Entity as object model.
2) Performance: Hibernate is fine tune for data insert and loading.
3) Configuration : Its configuration bases so it it easy to implement.
4) Transaction : Transaction is managed by hibernate session on basis of configuation
15) How AOP works?
AOP works on compile type weaving and it generates byte code which enable aop execution.
Details: AOP Execution.
16) On creating threading we should implements Runnable or extends Thread class?
This primarily depends on class responsibility if its main responsibility is to execute job independently then we can extends Thread class. As we know we can only extend one class in java so if we are implementing Runnable interface, we always have option to implement multiple interface and extend a class.
17) Confirm if this code will compile ?
Answer : No , the reason is child class overridden method can not throw exception which is higher in hierarchy compare to parent's method.