Search This Blog

Wednesday, May 22, 2019

Banking Domain interview Questions on Java Part-5

Lets do more questions in java for banking domain companies preparations -

Set A:
1) There are two table t1 and t2 , t2 contains null element . will the inner join contains the null elements as well.
2) There is class A{
Can constructor call it recursively?

3) There is class A {
Class B extends class A{
Class a functionaly has some code ( common + different ) and class b has some code( common + different ) . without using interface / class . we don’t want to use the common functionality in the derived class.

4) Design parking lot with design patterns using motorcycle( 1 spot ) , car ( 2spot) , bus ( 3 spot) . What will happen when the spot of motorcycle get exhausted . how will you accommodate further motorcycle.
5) There are two table t1 and t2 . t1 contains composite primary key ( a,b,c ) . can foreign key be allowed on single column ( a ) .
6) interface has default method . how to call that method from the derived class?
7) Can we call abstract class method from the derived class?
8) What is super key , candidate key , composite key?
9) What is composition?
10) With keyword in the sql?
11) Use enum in switch case . what does return ?
12) Integer pa = null.
Int i = pa;
What is the value of i ?
13) Class Test {
int a , b;
static sum(){

Will it work?
14) Internal working of concurrenthashmap? Why hashmap can have null and concurrenthashmap is not null?
15) Try block with three catch1 , catch2, catch3 . how will you throw exception from catch1 and should be caught in catch3.
16) Whats the new feature in exception class of java 1.8 ?
17) String s = NULL ( capital without quotes ). What will happen?
18) How to create immutable object in java?
19) How to handle diamond problem having two interface with same default method ?
20) What will concurrenthashmap return when we call clear() method simultaneously with threads( reading and writing ) ?
21) How will you handle high memory issue in java application. Please provide all the steps?

Set B:
1) Overview and architecture of previous project.

2) Having a list of 0s and non-zeros like -
7 0 2 8 0 0 5 0
Algo for getting below output
7 2 8 5 0 0 0 0

Scenario A - using same array
Scenario B - using different array.

3) Intra-day stock prices are present in a list -
e.g. [ 30, 40, 75, 60, 100, 10, 25, 65, .....]
Algo to find the buy and selling values in order to make maximum profit.
Buy order should be before Sell order.

Scenario A - You can buy stock only once and sell only once.
Scenario B - You can buy and sell as many times as possible.

4) A module matches the buy and sell orders to carry out a transaction whenever price matches.
We have to add another module which keeps track of the total traded value (in Dollars) of the stock in the day till current time.
What will be the features of the new module. (In terms of concurrency)

5) Messaging Techniques - Synchronous / Asynchronous.
Features and usage of JMS, Web Services, REST, JSON, XML, etc.

6) I we have to design an email server. What will the different classes and its attributes.
(Mail, User, Views, DLs, Attachments and relationship between them.)

7) 2 database Tables-
Employee (Name, Dept_ID, Salary),
and Dept(Dept_Name, Dept_ID)
SQL query to get the name of employees who have salary more than the average salary in their department.

8) Some questions related to Agile methodology - Capacity planning, Sprint Meetings, Task Allocation, etc.

9) Advantages of Spring Boot over normal Spring Applications.

Set C:
1. What is Encapsulation
2. Composition vs Inheritence
3. Any example in which we can use both composition and inheritence
4. What is polymorphism
5. What do mean by final
6. How we can override final method
7. Can we call non static method from static method. If not then what we will have do to call non static method from static method.
8. How we call static method from non static method
9. Do constructor can have return type
10. Can we call constructor from another constructor
11. Static String variable in Interface and it’s accessibility through implementing/Extending class
12. Java 8 default method.
13. Difference between abstract class and interface after java8 default feature
14. Diamond problem
15. What do you mean by immutable object. How can we create immutable object
16. What if use clone method to clone object while creating immutable object
17. What happen if we clone string
18. try with 3 catch, if first catch throws exception then what will happen
19. What is transient
20. What is volatile
21. Swap string without any third variable
22. What are marker interfaces
23. What is inner join.
24. Difference between primary key and unique key
25. Why concurrenthaspmap not allow null key. What happens if 3 threads are reading concurrenhashmap and we call clear method. How clear works internally

I hope all questions are relevant to banking domain companies interview questions in Java.
Feel free to comment in comment box for any query or concerns.

1 comment :