Tip 1 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 2 : 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.
The interviewer asked me questions majorly from J2EE and OOPS followed by some questions from Operating System (Unix).
Difference between save and saveorupdate
save() – This method in Hibernate is used to stores an object in the database. It inserts an entry if the record doesn’t exist, otherwise not.
saveorupdate () -This method in the hibernate is used for updating the object using identifier. If the identifier is missing this method calls save(). If the identifier exists, it will call update method.
Differentiate between .ear, .jar and .war files.
.jar files : These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.
.war files : These files are with the .war extension. The .war file contains JSP, HTML, javascript and other files necessary for the development of web applications.
.ear files : The .ear file contains the EJB modules of the application.
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.
How does an exception propagate in the code?
When an exception occurs, first it searches to locate the matching catch block. In case, the matching catch block is located, then that block would be executed. Else, the exception propagates through the method call stack and goes into the caller method where the process of matching the catch block is performed. This propagation happens until the matching catch block is found. If the match is not found, then the program gets terminated in the main method.
What do you know about the Secure Socket Layer (SSL) ?
The technology that is used to communicate between the web server and the web browser is called Secure Socket Layer (SSL). More specifically, SSL is a protocol that describes how algorithms are to be used in encryption.
The technology establishes an encrypted link between two parties and this link is allowed to secure transmission of sensitive information such as login credentials, credit/debit card information and social security numbers.
Explain any 5 essential UNIX commands .
1) ls -> Lists files in current directory
2) cd -> Change directory to tempdir
3) mkdir -> Make a directory called graphics
4) rmdir -> Remove directory (must be empty)
5) cp -> Copy file into directory
Explain Piping in Unix/Linux
1) A pipe is a form of redirection (transfer of standard output to some other destination) that is used in Linux and other
Unix-like operating systems to send the output of one command/program/process to another command/program/process for further processing.
2) The Unix/Linux systems allow stdout of a command to be connected to stdin of another command. We can make it
do so by using the pipe character ‘|’.
3) Pipe is also used to combine two or more commands, and in this, the output of one command acts as input to
another command, and this command’s output may act as input to the next command and so on.
4) It can also be visualized as a temporary connection between two or more commands/ programs/ processes. The
command line programs that do the further processing are referred to as filters.
Examples :
1) Listing all files and directories and give it as input to more command.
$ ls -l | more
2) Use sort and uniq command to sort a file and print unique values.
$ sort record.txt | uniq
3) Use head and tail to print lines in a particular range in a file.
$ cat sample2.txt | head -7 | tail -5
In this round , I faced questions from Hibernate and Spring Boot. The interviewer also asked me if I was comfortable with DBMS to which I replied Yes and so he also asked me some basic questions related to DBMS.
When is merge() method of the hibernate session useful ?
Merge() method can be used for updating existing values. The specialty of this method is, once the existing values are updated, the method creates a copy from the entity object and returns it. This result object goes into the persistent context and is then tracked for any changes. The object that was initially used is not tracked.
How do you create an immutable class in hibernate?
Immutable class in hibernate creation could be in the following way. If we are using the XML form of configuration, then a class can be made immutable by markingmutable=false. The default value is true there which indicating that the class was not created by default.
In the case of using annotations, immutable classes in hibernate can also be created by using @Immutable annotation.
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.
Explain the concept of ACID properties in DBMS.
ACID properties are a combination of Atomicity, Consistency, Isolation, and Durability properties. These properties
prove to be very helpful in allowing a safe and secure way of sharing the data amongst multiple users.
Atomicity: When changes are being done to the data it feels as though a single operation is performed. In other
words, either all the changes are performed, or none of them is performed.
Consistency: Data must be in a consistent state at the beginning of the transaction as well as the end of the
transaction.
Isolation: As the name itself suggests, this ensures that each transaction that occurs is in isolation from others.
Simply put a transaction that has started but not yet completed should be in isolation with others, this is done so that
the other transaction does not get impacted with this transaction.
Durability: In the event of system failure, after the transaction is completed, changes to the data persist and are not
undone. Hence, due to this property data is always in a durable state.
What is Self-Join and Cross-Join ?
Self-Join : A self JOIN is a case of regular join where a table is joined to itself based on some relation between its
own column(s). Self-join uses the INNER JOIN or LEFT JOIN clause and a table alias is used to assign different
names to the table within the query.
Cross-Join : Cross join can be defined as a cartesian product of the two tables included in the join. The table after join
contains the same number of rows as in the cross-product of the number of rows in the two tables. If a WHERE
clause is used in cross join then the query will work like an INNER JOIN.
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 is the @Controller annotation used for? How can you create a controller without an annotation?
The @Controller is a Spring MVC annotation to define Controller but in reality, it's just a stereotype annotation. You
can even create a controller without @Controller by annotating the Spring MVC Controller classes using
@Component annotation. The real job of request mapping to the handler method is done using @RequestMapping
annotation.
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.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you write a single-line comment in C++?
I am interested. Please provide more details in this mail: ketan.kanoje17@vit.edu