Java Questions
Java Questions
3: use of java design pattern and what is , Abstract , factory , builder , proxy
4: what is use of Externalisation and what is use of it
5: What is serialisation
6: What is atomic integers any use case of it.?
7: what is use Comparator and what is use of equals and hascode..
8:Suppose if you have Student class so do you need to overwrite equals and hascode.
, if yes why or if not why not ?
9: what is sigma four
10 what is coundownlach
11 what is cyclic barrier
12 : What is executorframwork ? and how to create ?
13: explain producer and consumer problem and use of synchronisation wait notify
notifyall
14 : What is dedlock in multithreading and how to prevent from thi
15: what is new in java 8 in terms of hasmap?
16: Any practical scenario when we will use Array list , Linked list , Hasmap and
Concurrent hash map,hashset,
RMQ Question:
Output required : max number per subject and total no of exams that the student
attended.
1) I have two class Human and Heart, Whenever a human class is created Heart class
should be created. what kind of association is this represent and how to implement
it.
2) internal structure of Hashmap
3) I have a class
Employee {
name,
doj
}
i store an object with name="sachin" & dob. and stored it as a key. later on i
changed that name="somthing else" what would happen,
if a do get, set in map and how to prevent it.
which collection you use to print all the students with highest marks (consider
space and time complexity)
Employee {
name,
doj
}
Have you ever faced OutOfMemory exception? How to analyse and fix it?
What is difference between Heap Dump and Thread Dump?
Difference between PermGen and MetaSpace.
What are different java command line arguments to tune JVM?
There are multiple tasks A, B, C .. Y, which can run in parallel and there is a
task Z which need to be started after all the tasks are completed. How to achieve
this?
How CompletableFuture works? Write Code.
Ways to Create Thread. What is executorService.shutdown()?
How to stop a Thread?
What tools you have used for code management and building the projects?
In HashMap, id will remain same and shouldn�t be modified but name should keep
changing as per the requirement.
So how will you manage Employee class in HashMap?
1.Consider you have 9 batteries 1,2,3....9. It contains mix of 5 working and 4 dead
batteries.
what will be the approach so that combination of two working batteries can be
find out in minimum no. of steps?
3. Which Design pattern you recently used ? Cross Questioning on Singleton Design
Pattern. How to make it work
well in multi-threaded environment ?
what is preferrable whether to synchronize getInstance method or using
synchronize block?
Then cross questioning on that again.
12. What are enums? Can we have our own methods in enums? Can enums be passed as
keys in HashMaps?
19. Is java call by value / call by reference? Then an output question was given
based on this concept only.