Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
In this round, I was first asked about the projects that I worked on in my previous company. I was also asked about the
various tech stacks that I was familiar with and then the interviewer started asking me questions around Java, Java Collections and Java 8.
What are the advantages of Packages in Java?
There are various advantages of defining packages in Java.
i) Packages avoid the name clashes.
ii) The Package provides easier access control.
iii) We can also have the hidden classes that are not visible outside and used by the package.
iv) It is easier to locate the related classes.
Why Java is platform independent and JVM platform dependent?
JVM is platform dependent because it takes java byte code and generates byte code for the current operating
system. So Java software is platform dependent but Java language is platform independent because different
operating system have different JVMs.
Why are Java Strings immutable in nature?
String objects in Java are immutable by definition. This signifies that the String object's state cannot be changed once
it has been created. As a result, if you try to update the value of that object rather than the values of that object, Java
creates a new string object.
Because String objects are often cached in the String pool, Java String objects are immutable. Because String literals
are frequently shared among numerous clients, one client's action may have an impact on the others. It improves the
application's security, caching, synchronization, and performance by doing so.
How would you differentiate between a String, StringBuffer, and a StringBuilder?
1) Storage area : In string, the String pool serves as the storage area. For StringBuilder and StringBuffer, heap
memory is the storage area.
2) Mutability : A String is immutable, whereas both the StringBuilder and StringBuffer are mutable.
3) Efficiency : It is quite slow to work with a String. However, StringBuilder is the fastest in performing operations. The
speed of a StringBuffer is more than a String and less than a StringBuilder. (For example appending a character is
fastest in StringBuilder and very slow in String because a new memory is required for the new String with appended
character.)
4) Thread-safe : In the case of a threaded environment, StringBuilder and StringBuffer are used whereas a String is
not used. However, StringBuilder is suitable for an environment with a single thread, and a StringBuffer is suitable for
multiple threads.
What do you know about JIT Compiler?
1) JIT stands for Just-In-Time and it is used for improving the performance during run time. It does the task of
compiling parts of byte code having similar functionality at the same time thereby reducing the amount of compilation
time for the code to run.
2) The compiler is nothing but a translator of source code to machine-executable code.
Working of JIT Compiler :
1) First, the Java source code (.java) conversion to byte code (.class) occurs with the help of the javac compiler.
2) Then, the .class files are loaded at run time by JVM and with the help of an interpreter, these are converted to
machine understandable code.
3) JIT compiler is a part of JVM. When the JIT compiler is enabled, the JVM analyzes the method calls in the .class
files and compiles them to get more efficient and native code. It also ensures that the prioritized method calls are
optimized.
4) Once the above step is done, the JVM executes the optimized code directly instead of interpreting the code again.
This increases the performance and speed of the execution.
Differentiate between ArrayList and Vector in Java.
Following are the differences between ArrayList and Vector in java :
1) Synchronization : Vector is synchronized, which means that only one thread can access the code at a time,
however, ArrayList is not synchronized, which means that multiple threads can operate on ArrayList at the same time.
2)Data Growth : Both ArrayList and Vector dynamically expand and shrink to make the most use of storage space,
but the manner they do it is different. If the number of elements in an array exceeds its limit, ArrayList increments
50% of the current array size, while vector increments 100%, thereby doubling the current array size.
3) Performance : ArrayList is faster than vector operations because it is non-synchronized, but vector operations are
slower since they are synchronized (thread-safe). When one thread works on a vector, it acquires a lock on it,
requiring any other threads working on it to wait until the lock is released.
4) Ease of Iteration : Vector can traverse over its elements using both Enumeration and Iterator, whereas ArrayList
can only traverse using Iterator.
Differentiate between HashSet and HashMap.
Hash Set :
1) It implements the Set Interface.
2) It does not allow duplicate values.
3) While adding an element it requires only one object as a parameter.
4) Internally, HashSet uses HashMap to add entries. The key K in a HashSet is the argument supplied in the
add(Object) method. For each value supplied in the add(Object) method, Java assigns a dummy value.
5) It is slower than HashMap.
Hash Map :
1) It implements the Map Interface.
2) The key needs to be unique while two different keys can have the same value.
3) While adding an entry, it requires two object values, the Key and the Value as the parameter.
4) There is no concept of duplicate values.
5) It is faster than HashSet.
What are the features of a lambda expression?
Below are the two significant features of the methods that are defined as the lambda expressions:
1) Lambda expressions can be passed as a parameter to another method.
2) Lambda expressions can be standalone without belonging to any class.
What are some standard Java pre-defined functional interfaces?
Some of the famous pre-defined functional interfaces from previous Java versions are Runnable, Callable,
Comparator, and Comparable. While Java 8 introduces functional interfaces like Supplier, Consumer, Predicate, etc.
Please refer to the java.util.function doc for other predefined functional interfaces and its description introduced in
Java 8.
Runnable : use to execute the instances of a class over another thread with no arguments and no return value.
Callable : use to execute the instances of a class over another thread with no arguments and it either returns a value
or throws an exception.
Comparator : use to sort different objects in a user-defined order
Comparable : use to sort objects in the natural sort order
This round had questions revolving around OOPS , Jenkins, Spring Boot and Docker. The questions were preety decent and
standard and can be answered if one has prior experience in the given tech stack.
What is Garbage collector in JAVA?
1) Garbage Collection in Java is a process by which the programs perform memory management automatically.
2) The Garbage Collector(GC) finds the unused objects and deletes them to reclaim the memory. I
3) In Java, dynamic memory allocation of objects is achieved using the new operator that uses some memory and the
memory remains allocated until there are references for the use of the object.
4) When there are no references to an object, it is assumed to be no longer needed, and the memory, occupied by
the object can be reclaimed.
5) There is no explicit need to destroy an object as Java handles the de-allocation automatically.
The technique that accomplishes this is known as Garbage Collection. Programs that do not de-allocate memory can
eventually crash when there is no memory left in the system to allocate. These programs are said to have memory
leaks.
Garbage collection in Java happens automatically during the lifetime of the program, eliminating the need to de-
allocate memory and thereby avoiding memory leaks.
In C language, it is the programmer’s responsibility to de-allocate memory allocated dynamically using free()
function.This is where Java memory management leads.
What does the @SpringBootApplication annotation do internally?
The @SpringBootApplication annotation is equivalent to using @Configuration, @EnableAutoConfiguration,
and @ComponentScan with their default attributes. Spring Boot enables the developer to use a single annotation
instead of using multiple. But, as we know, Spring provided loosely coupled features that we can use for each
annotation as per our project needs.
What is dependency Injection?
The process of injecting dependent bean objects into target bean objects is called dependency injection.
1) Setter Injection: The IOC container will inject the dependent bean object into the target bean object by calling the
setter method.
2) Constructor Injection: The IOC container will inject the dependent bean object into the target bean object by calling
the target bean constructor.
3) Field Injection: The IOC container will inject the dependent bean object into the target bean object by Reflection
API.
What Are the Basic Annotations that Spring Boot Offers?
The primary annotations that Spring Boot offers reside in its "org.springframework.boot.autoconfigure" and its sub-
packages. Here are a couple of basic ones :
@EnableAutoConfiguration – to make Spring Boot look for auto-configuration beans on its classpath and
automatically apply them.
@SpringBootApplication – used to denote the main class of a Boot Application. This annotation combines
@Configuration, @EnableAutoConfiguration, and @ComponentScan annotations with their default attributes.
What are the credential types supported by Jenkins?
In Jenkins, credentials are a set of information used for authentication with internal/external services to accomplish an action. Jenkins credentials are provisioned & managed by a built-in plugin called - Credentials Binding - plugin. Jenkins can handle different credentials as follows -
1) Secret text - A token such as an API token, JSON token, etc.
2) Username and password - Basic Authentication can be stored as a credential as well.
3) Secret file - A secret file used to authenticate some secure data services & security handshakes.
4) SSH Username with a private key - An SSH public/private key pair for Machine to Machine authentication.
5) Certificate - a PKCS#12 certificate file and an optional password.
6) Docker Host Certificate Authentication credentials.
And as we can guess, this can be extended to several other extensible credential types like - AWS credential, Azure secrets, etc. using commonly available plugins.
How to do Global Tools Configuration in Jenkins?
Global Tools are tools that need to be installed outside the Jenkins environment and need to be controlled from within the Jenkins environment. Hence it needs its corresponding Jenkins plugin as well. Steps to using a Global Tool generally include -
1) Install the tool Plugin into the Jenkins instance, to include the global tool into a list of global tools used by Jenkins.
2) Install the tool in the Jenkins instance or provide away (maybe a command to download and) install the tool during runtime.
3) Go to Manage Jenkins -> Global Tools Configuration and Scroll through the tool list and configure the global tool-specific configurations.
4) Make use of the installed global Tool in your job/pipeline.
What are the types of Jenkins pipelines?
1) Jenkins Pipelines can be either - a Declarative pipeline or a Scripted Pipeline.
2) Declarative pipeline makes use of numerous, generic, predefined build steps/stages (i.e. code snippets) to build
our job according to our build/automation needs.
3) Whereas, with Scripted pipelines, the steps/stages can be custom-defined & used using a groovy syntax which
provides better control & fine-tuned execution levels.
List the most commonly used instructions in Dockerfile.
1) FROM : This is used to set the base image for upcoming instructions. A docker file is considered to be valid if it
starts with the FROM instruction.
2) LABEL : This is used for the image organization based on projects, modules, or licensing. It also helps in
automation as we specify a key-value pair while defining a label that can be later accessed and handled
programmatically.
3) RUN : This command is used to execute instructions following it on the top of the current image in a new layer.
Note that with each RUN command execution, we add layers on top of the image and then use that in subsequent
steps.
4) CMD : This command is used to provide default values of an executing container. In cases of multiple CMD
commands the last instruction would be considered.
Describe the lifecycle of Docker Container?
The different stages of the docker container from the start of creating it to its end are called the docker container life
cycle.The most important stages are :
1) Created: This is the state where the container has just been created new but not started yet.
2) Running: In this state, the container would be running with all its associated processes.
3) Paused: This state happens when the running container has been paused.
4) Stopped: This state happens when the running container has been stopped.
5) Deleted: In this, the container is in a dead state.
How many Docker components are there?
There are three docker components, they are - Docker Client, Docker Host, and Docker Registry.
1) Docker Client: This component performs “build” and “run” operations for the purpose of opening communication with the docker host.
2) Docker Host: This component has the main docker daemon and hosts containers and their associated images. The daemon establishes a connection with the docker registry.
3) Docker Registry: This component stores the docker images. There can be a public registry or a private one. The most famous public registries are Docker Hub and Docker Cloud.
This was a Technical Cum HR round where I was first asked some basic Design Pattern related concepts and then we discussed about my expectations from the company , learnings and growth in the forthcomig years. I would suggest be honest and try to communicate your thoughts properly in these type of rounds to maximise your chances of getting selected.
Why should we hire you ?
What are your expectations from the company?
How was your overall interview experience?
What are your strengths and weakness according to you?
Where do you see yourself in the next 5 years?
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round,
like what are the projects currently the company is investing, which team you are mentoring. How all is the work
environment etc.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?