Featured

Capgemini Java Interview questions and Answers for experienced Candidate Oct 2022| @Code Decode



Published
Experienced Java Developer Interview for Capegemini. In this video of code decode we have Capegemini Java Interview for experienced developer

The first Java Questions asked in Capegemini Interview was
Describe, in general, how java's garbage collector works ?
The Java runtime environment deletes objects when it determines that they are no longer being used. This process is known as garbage collection.

JVM has the code written for Garbage collection that periodically frees the memory used by objects that are no longer needed. It is an automatic process. The programmer does not need to explicitly mark objects to be deleted.

The Java garbage collector is a generational mark-sweep garbage collector which involves three phases:

Mark - Mark objects as alive

Sweep - phase releases the memory fragments with dead (unmarked) objects.

The next Java Questions asked in Capegemini Interview was
What is an immutable class ?
Immutable class means once the object of the class is created its fields cannot be modified or changed. In Java, all the wrapper classes like Boolean, Short, Integer, Long, Float, Double, Byte, Char, and String classes are immutable classes.


The object’s hash code can easily be cached.
These objects are a good choice for keys for Maps.
These objects are good for a multi-threaded environment as the object's state won’t change.
An immutable object’s state won’t change, so the same object can be used at multiple places and hence saving the memory.

The next Java Questions asked in Capegemini Interview was
Difference between load and get ?
load() will throw an exception(ObjectNotFound) if an object with id passed to them is not found, but get() will return null.

load can return proxy(a blank dependent) without hitting the database unless required (when you access any attribute other than id) but get() always go to the database, so sometimes using load() can be faster than the get() method.

Use the load() method, if you know the object exists, and get() method if you are not sure about the object's existence.

The next Java Questions asked in Capegemini Interview was
What are the ways to break singleton pattern ?
Through Reflection.

If multiple class loaders are loading the class.

If the class is serializable or cloneable.

If we don't have double checked locking, it can be broken easily through multi threaded access.


Most Asked Core Java Interview Questions and Answers: https://youtube.com/playlist?list=PLyHJZXNdCXscoyL5XEZoHHZ86_6h3GWE1

Advance Java Interview Questions and Answers: https://youtube.com/playlist?list=PLyHJZXNdCXsexOO1VQ4vs-BM2-8CKrixd

Java 8 Interview Questions and Answers: https://youtube.com/playlist?list=PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy

Hibernate Interview Questions and Answers:
https://youtube.com/playlist?list=PLyHJZXNdCXsdC-p2186C6NO4FpadnCC_q

Spring Boot Interview Questions and Answers:
https://youtube.com/playlist?list=PLyHJZXNdCXsexOO1VQ4vs-BM2-8CKrixd

Angular Playlist: https://www.youtube.com/watch?v=CAl7RQSdq2Q&list=PLyHJZXNdCXsfxRtDwtGkDD_lLfTWc1g0i


SQL Playlist: https://www.youtube.com/playlist?list=PLyHJZXNdCXse86eLuwy5uZohd_bddE9Ni

GIT: https://youtube.com/playlist?list=PLyHJZXNdCXscpl6pxOnL2lRWJlzvzjyZE

Subscriber and Follow Code Decode
Subscriber Code Decode: https://www.youtube.com/c/CodeDecode?sub_confirmation=1
LinkedIn : https://www.linkedin.com/in/codedecodeyoutube/
Instagram: https://www.instagram.com/codedecode25/

#capegeminiInterview #JavaInterviewQuestions #codedecode
Category
Job
Be the first to comment