Thread: Interview Questions - Technical Round

Forum : Java EE FAQ?s and Interview Questions   11 Feb, 2018 07:26
User Image


Joined: 25 Jun, 2017

Points: 100

Threads: 7

Posts: 21

Interview Questions - Technical Round

| Quote Date : 11 Feb, 2018    Views:1244    

Date 10/02/2018

1.if i have a object then how to get Class type of that object?
2.if i have an object how to check whether the object is belongs to which class?
3.what are OOPs principles? explain them? where you found them in jdk provided classes?
Set<Test> set=new HashSet<>();
Test t=new Test();
how many objects will be added to Hashset and what is the size of the Hashset? explain
5. what are the differences b/n set and list
6.if i add 2 different objects to set by using same referance variable, how many objects will be added to set?
Test t=new Test();
HashSet<Test> tests=new HashSet<>();
t=new Test();
7.i have list of employees i want to remove a employee whos id is 1 write the logic? 
wrote for each loop and removed one object..
is there any problem with in this code? do we get any exception?
List<Test> tests=new ArrayList<>();
tests.add(new Test());
tests.add(new Test());
tests.add(new Test());
tests.add(new Test());
tests.add(new Test());
for(Test test:tests){
} add() and long add() are in same class are they overloaded or duplicate methods? if i have long add() in super class int add() in sub class is it valid overriding?
9.In a class i have void add(Employee) void add(Student) and i called add(null) in main method which method will be called?
10.parent method is throwing checked-exception is it mandatory that child class method should also throw?
11.what are checked and unchecked exceptions? to create checked and how to create un-checked exception?
13.parent method is throwing both Checked and unchecked exceptions then what child should be throwing?
14.what is cascade in hibernate?
15.what is many-many relationship, how many tables we need to have in many-many relationship?
16.what are default methods in interfaces? what is the purpose of them?
17.If i have 100 methods in an Interface if i want to provide implementaion is it mandatory that i need to override 100 methods?

Coding Round Question
1.if i have an int[] which has some values, i have an index place called (Breaking point) which fulfills below features
Sum of all the elements less than breaking point sum is
exactly equals to the
product of all the elements grater than breaking point to end of that array
Sum is ZERO

find all such breaking points and put them in a Set and write test cases
case-1:- if given array is empty or null then throw IllegalArgumentException
case 2: [1,2,1] has break point at index 1
case 3:[5,0,-5,-4] has 0,3 as breaking points
Write JUnit test cases for all possibilities including exception paths?


User Image


Joined : 27 Jun, 2017

Points : 130

Threads: 8

Posts: 16

Re: Interview Questions - Technical Round

Reply Date : 22 Feb, 2018


User Image


Joined : 20 Apr, 2017

Points : 100

Threads: 0

Posts: 1

Re: Interview Questions - Technical Round

Reply Date : 20 Feb, 2018

Hi can u provide a solution for breaking point program

User Image


Joined : 15 Jul, 2016

Points : 1000

Threads: 645

Posts: 201

Re: Interview Questions - Technical Round

Reply Date : 11 Feb, 2018

Thanks for sharing the questions

Load More

No More Comments