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 3 : Do at-least 2 good projects and you must know every bit of them.
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 a simple coding question related to stack and recursion followed by an SQL query. After this, I was grilled on some fundamental concepts of Java, OOPS and Java 8.


Input: [1,2,3,4,5]
Output: [5,4,3,2,1]

Approach : We will be using two recursive methods -
1) ReverseStack(stack)
i) If the stack is empty, then return
ii) Pop the top element from the stack as top
iii) Reverse the remaining elements in the stack, call reverseStack(stack) method
iv) Insert the top element to the bottom of the stack, call InsertAtBottom(stack, top) method
2) InsertAtBottom(stack, ele)
i) If the stack is empty, push ele to stack, return
ii) Pop the top element from the stack as top
iii) Insert the ele to the bottom of the stack, call InsertAtBottom(stack, ele) method
iv) Push top to the stack.
TC : O(N^2), where N = total number of elements in the given stack
SC : O(N)
Combine Two Tables
Approach : Since the PersonId in table Address is the foreign key of table Person, we can join this two table to get the
address information of a person. Considering there might not be an address information for every person, we should
use outer join instead of the default inner join.
Query :
select FirstName, LastName, City, State
from Person left join Address
on Person.PersonId = Address.PersonId ;
What is the difference between JDK, JRE, and JVM?
JVM :
1) JVM is an acronym for Java Virtual Machine; it is an abstract machine which provides the runtime environment in
which Java bytecode can be executed.
2) It is a specification which specifies the working of Java Virtual Machine. Its implementation has been provided by
Oracle and other companies. Its implementation is known as JRE.
3) JVMs are available for many hardware and software platforms (so JVM is platform dependent). It is a runtime
instance which is created when we run the Java class.
4) There are three notions of the JVM: specification, implementation, and instance.
JRE :
1) JRE stands for Java Runtime Environment. It is the implementation of JVM.
2) The Java Runtime Environment is a set of software tools which are used for developing Java applications.
3) It is used to provide the runtime environment. It is the implementation of JVM.
4) It physically exists. It contains a set of libraries + other files that JVM uses at runtime.
JDK :
1) JDK is an acronym for Java Development Kit. It is a software development environment which is used to develop
Java applications and applets.
2) It physically exists.
3) It contains JRE + development tools.
4) JDK is an implementation of any one of the below given Java Platforms released by Oracle Corporation:
Standard Edition Java Platform
Enterprise Edition Java Platform
Micro Edition Java Platform
How many types of memory areas are allocated by JVM?
1) Class(Method) Area: Class Area stores per-class structures such as the runtime constant pool, field, method data,
and the code for methods.
2) Heap: It is the runtime data area in which the memory is allocated to the objects
3) Stack: Java Stack stores frames. It holds local variables and partial results, and plays a part in method invocation
and return. Each thread has a private JVM stack, created at the same time as the thread. A new frame is created
each time a method is invoked. A frame is destroyed when its method invocation completes.
4) Program Counter Register: PC (program counter) register contains the address of the Java virtual machine
instruction currently being executed.
5) Native Method Stack: It contains all the native methods used in the application.
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 are some standard Java pre-defined functional interfaces?
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
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 the advantages of using the Optional class?
It encapsulates optional values, i.e., null or not-null values, which helps in avoiding null checks, which results in
better, readable, and robust code. It acts as a wrapper around the object and returns an object instead of a value,
which can be used to avoid run-time NullPointerExceptions.
This round was majorly inclined towards Spring Boot and Hibernate and the questions can be answered only if you have some prior experience in working with these tech stacks.
Explain Spring Actuator and its advantages.
1) Spring Actuator is a cool feature of Spring Boot with the help of which you can see what is happening inside a running application.
2) So, whenever you want to debug your application, and need to analyze the logs you need to understand what is happening in the application.
3) In such a scenario, the Spring Actuator provides easy access to features such as identifying beans, CPU usage, etc.
4) The Spring Actuator provides a very easy way to access the production-ready REST points and fetch all kinds of information from the web.
5) These points are secured using Spring Security’s content negotiation strategy.
What is the use of @Transactional annotation in spring JPA ?
The @Transactional annotation is the metadata that specifies the semantics of the transactions on a method. We have two ways to rollback a transaction: declarative and programmatic.
In the declarative approach, we annotate the methods with the @Transactional annotation. The @Transactional annotation makes use of the attributes rollbackFor or rollbackForClassName to rollback the transactions, and the attributes noRollbackFor or noRollbackForClassName to avoid rollback on listed exceptions.
In the programmatic approach, we rollback the transactions using TransactionAspectSupport.
The declarative rollback strategy should be favored over the programmatic rollback strategy.
What is Spring Batch?
1) Spring Boot Batch provides reusable functions that are essential in processing large volumes of records, including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management.
2) It also provides more advanced technical services and features that will enable extremely high-volume and high performance batch jobs though optimization and partitioning techniques.
3) Simple as well as complex, high-volume batch jobs can leverage the framework in a highly scalable manner to process significant volumes of information.
What are the @RequestMapping and @RestController annotation in Spring Boot used for?
@RequestMapping :
1) This annotation is used to provide the routing information and tells to Spring that any HTTP request must be mapped to the respective method.
2) To use this annotation, you have to import org.springframework.web.
"bind.annotation.RequestMapping;"
@RestController :
1) This annotation is used to add the @ResponseBody and @Controller annotation to the class
2) To use this annotation, you have to import org.springframework.web.
"bind.annotation.RestController;"
Can you tell the difference between setMaxResults() and setFetchSize() of Query?
setMaxResults() the function works similar to LIMIT in SQL. Here, we set the maximum number of rows that we want
to be returned. This method is implemented by all database drivers.
setFetchSize() works for optimizing how Hibernate sends the result to the caller for example: are the results buffered,
are they sent in different size chunks, etc. This method is not implemented by all the database drivers.
What are the concurrency strategies available in hibernate?
Concurrency strategies are the mediators responsible for storing and retrieving items from the cache. While enabling
second-level cache, it is the responsibility of the developer to provide what strategy is to be implemented to decide for
each persistent class and collection.
Following are the concurrency strategies that are used:
1) Transactional: This is used in cases of updating data that most likely causes stale data and this prevention is most
critical to the application.
2) Read-Only: This is used when we don't want the data to be modified and can be used for reference data only.
3) Read-Write: Here, data is mostly read and is used when the prevention of stale data is of critical importance.
4) Non-strict-Read-Write: Using this strategy will ensure that there wouldn't be any consistency between the database
and cache. This strategy can be used when the data can be modified and stale data is not of critical concern.
Explain brief about Session interface used in hibernate?
Session interface is primarily used by hibernate application. Session is light weight,short lived objects which are
inexpensive to create and destroy. It allows you to create query objects to retrieve persistent objects.It wraps JDBC
connection Factory for Transaction.It holds a mandatory (first-level) cache of persistent objects, used when navigating
the object graph or looking up objects by identifier .
This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my
role.
Tell me something not there in your resume.
If you get this question, it's an opportunity to choose the most compelling information to share that is not obvious from
your resume.
Example :
Strength -> I believe that my greatest strength is the ability to solve problems quickly and efficiently, which makes me
unique from others.
Ability to handle Pressure -> I enjoy working under pressure because I believe it helps me grow and become more
efficient.
Tip : Emphasize why you were inspired to apply for the job. You can also explain that you are willing to invest a great
deal of energy if hired.
These are generally very open ended questions and are asked to test how quick wit a candidate is. So there is
nothing to worry about if you have a good command over your communication skills and you are able to propagate
your thoughts well to the interviewer.
Why should we hire you?
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.
Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical
questions. No coding in most of the cases but some discussions over the design can surely happen.

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