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.
This round had questions from Java, OOPS and MVC. More emphasis was given on the fundamentals of the subject rather than the advanced topics.
Explain the use of final keyword in variable, method and class.
In Java, the final keyword is used as defining something as constant /final and represents the non-access modifier.
1) final variable :
i) When a variable is declared as final in Java, the value can’t be modified once it has been assigned.
ii) If any value has not been assigned to that variable, then it can be assigned only by the constructor of the class.
2) final method :
i) A method declared as final cannot be overridden by its children's classes.
ii) A constructor cannot be marked as final because whenever a class is inherited, the constructors are not inherited.
Hence, marking it final doesn't make sense. Java throws compilation error saying - modifier final not allowed here
3) final class :
No classes can be inherited from the class declared as final. But that final class can extend other classes for its
usage.
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.
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.
Explain the Singleton pattern?
Singleton pattern in Java is a pattern which allows a single instance within an application. One good example of the
singleton pattern is java.lang.Runtime.
Singleton Pattern states that define a class that has only one instance and provides a global point of access to it.
In other words, it is the responsibility of the class that only a single instance should be created, and all other classes
can use a single object.
Explain in brief the role of different MVC components?
The different MVC components have the following roles -
1) Presentation: This component takes care of the visual representation of a particular abstraction in the application.
2) Control: This component takes care of the consistency and uniformity between the abstraction within the system
along with their presentation to the user. It is also responsible for communicating with all other controls within the
MVC system.
3) Abstraction: This component deals with the functionality of the business domain within the application.
How is the routing carried out in MVC?
1) The RouteCollection contains a set of routes that are responsible for registering the routes in the application.
2) The RegisterRoutes method is used for recording the routes in the collection.
3) The URL patterns are defined by the routes and a handler is used which checks the request matching the pattern.
4) The MVC routing has 3 parameters.
4.1) The first parameter determines the name of the route.
4.2) The second parameter determines a specific pattern with which the URL matches.
4.3) The third parameter is responsible for providing default values for its placeholders.
Difference between Abstract class and Interface.
The differences between Abstract Class and Interface are as follows :
Abstract Class:
1) Abstract classes have a default constructor and it is called whenever the concrete subclass is instantiated.
2) It contains Abstract methods as well as Non-Abstract methods.
3) The class which extends the Abstract class shouldn’t require the implementation of all the methods, only Abstract
methods need to be implemented in the concrete sub-class.
4) Abstract class contains instance variables.
Interface:
1 )It doesn’t have any constructor and couldn’t be instantiated.
2) The abstract method alone should be declared.
3) Classes that implement the interface should provide the implementation for all the methods.
4) The interface contains only constants.
What is meant by Interface?
Multiple inheritances cannot be achieved in java. To overcome this problem the Interface concept is introduced. An interface is a template which has only method declarations and not the method implementation.
Some imp. points about Interface :
1) All the methods in the interface are internally public abstract void.
2) All the variables in the interface are internally public static final that is constants.
3) Classes can implement the interface and not extends.
4) The class which implements the interface should provide an implementation for all the methods declared in the
interface.
This round had questions from Spring Boot , SQL and Hibernate.
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.
Explain @RestController annotation in Sprint boot?
It is a combination of @Controller and @ResponseBody, used for creating a restful controller. It converts the
response to JSON or XML. It ensures that data returned by each method will be written straight into the response
body instead of returning a template.
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.
Mention a few features of Spring Boot.
Few important features of Spring Boot are as follows :
1) Spring CLI – Spring Boot CLI allows you to Groovy for writing Spring boot application and avoids boilerplate code.
2) Starter Dependency – With the help of this feature, Spring Boot aggregates common dependencies together and
eventually improves productivity
3) Auto-Configuration – The auto-configuration feature of Spring Boot helps in loading the default configurations
according to the project you are working on. In this way, you can avoid any unnecessary WAR files.
4) Spring Initializer – This is basically a web application, which can create an internal project structure for you. So,
you do not have to manually set up the structure of the project, instead, you can use this feature.
5) Spring Actuator – This feature provides help while running Spring Boot applications.
6) Logging and Security – The logging and security feature of Spring Boot, ensures that all the applications made
using Spring Boot are properly secured without any hassle.
How MVC works in Spring?
Here is how MVC works in Spring :
1) DispatcherServlet receives a request.
2) After that, the DispatcherServlet communicates with HandlerMapping. It also revokes the controller associated with
that specific request.
3) The Controller processes this request by calling the service methods, and a ModelAndView object is returned by
the DispatcherServlet.
4) The view name is sent to a ViewResolver to find the actual View to invoke.
5) After that, DispatcherServlet is passed to View to render the result.
6) By using the model data, the View renders and sends back result back to the user.
Write a query that joins two tables A and B having common attribute ID and selects records(ID_NAME) that have
matching ID values in both tables .
SELECT A.ID_Name, B.ID_Name
FROM A
INNER JOIN B ON A.ID=B.ID;
Given an Employee Table, find the Nth highest salary from it.
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
DECLARE M INT;
SET M=N-1;
RETURN (
SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT M, 1
);
END
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 .
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 is hibernate caching?
Hibernate caching is the strategy for improving the application performance by pooling objects in the cache so that
the queries are executed faster. Hibernate caching is particularly useful when fetching the same data that is executed
multiple times. Rather than hitting the database, we can just access the data from the cache. This results in reduced
throughput time of the application.
Types of Hibernate Caching
First Level Cache :
1) This level is enabled by default.
2) The first level cache resides in the hibernate session object.
3) Since it belongs to the session object, the scope of the data stored here will not be available to the entire
application as an application can make use of multiple session objects.
Second Level Cache :
1) Second level cache resides in the SessionFactory object and due to this, the data is accessible by the entire
application.
2) This is not available by default. It has to be enabled explicitly.
3) EH (Easy Hibernate) Cache, Swarm Cache, OS Cache, JBoss Cache are some example cache providers.
This is a cultural fitment testing round .HR was very frank and asked standard questions. Then we discussed about my role.
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.
Why are you looking for a job change?
Tip : For an experienced professional seeking a change, this is a common question. The easiest method to respond
to this question is to state that you are leaving your current work in order to advance your career. Make sure you don't
criticize or speak poorly about the company where you now work.

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