Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Infosys interview experience Real time questions & tips from candidates to crack your interview

Java Developer

Infosys
upvote
share-icon
3 rounds | 15 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Java , OOPS , Spring , MVC , Hibernate , Aptitude
Tip
Tip

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.

Application process
Where: Referral
Eligibility: 1+ years of experience
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Medium
Video Call
Duration60 Minutes
Interview date28 Jul 2021
Coding problem7

The interviewer asked me questions majorly from J2EE and OOPS followed by some questions from Operating System (Unix).

1. Java Question

Difference between save and saveorupdate

Problem approach

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.

2. Java Question

Differentiate between .ear, .jar and .war files.

Problem approach

.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.

3. OOPS Question

Difference between Abstract class and Interface.

Problem approach

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.

4. OOPS Question

How does an exception propagate in the code?

Problem approach

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.

5. Technical Question

What do you know about the Secure Socket Layer (SSL) ?

Problem approach

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.

6. OS Question

Explain any 5 essential UNIX commands .

Problem approach

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

7. OS Question

Explain Piping in Unix/Linux

Problem approach

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

02
Round
Medium
Video Call
Duration60 Minutes
Interview date28 Jul 2021
Coding problem7

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.

1. Hibernate Question

When is merge() method of the hibernate session useful ?

Problem approach

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.

2. Hibernate Question

How do you create an immutable class in hibernate?

Problem approach

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.

3. Hibernate Question

What is hibernate caching?

Problem approach

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.

4. DBMS Question

Explain the concept of ACID properties in DBMS.

Problem approach

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.

5. DBMS Question

What is Self-Join and Cross-Join ?

Problem approach

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.

6. Spring Boot Question

What Are the Basic Annotations that Spring Boot Offers?

Problem approach

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.

7. Spring Boot Question

What is the @Controller annotation used for? How can you create a controller without an annotation?

Problem approach

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.

03
Round
Easy
HR Round
Duration30 Minutes
Interview date28 Jul 2021
Coding problem1

This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my
role.

1. Basic HR Question

Why should we hire you ?

Problem approach

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

Skill covered: Programming

How do you write a single-line comment in C++?

Choose another skill to practice
Join the Discussion
3 replies
profile
21 Jul 2023

I am interested. Please provide more details in this mail: ketan.kanoje17@vit.edu

0 upvotes
0 replies
Reply
profile
16 Jul 2023

I am interested 

0 upvotes
0 replies
Reply
profile
S Muradjan |Level 2
15 Jun 2023

I am interested 

0 upvotes
0 replies
Reply
Similar interview experiences
company logo
Java Developer
3 rounds | 14 problems
Interviewed by Infosys
4430 views
1 comments
0 upvotes
company logo
Java Developer
3 rounds | 16 problems
Interviewed by Infosys
17085 views
1 comments
0 upvotes
company logo
Digital Specialist Engineer
3 rounds | 5 problems
Interviewed by Infosys
607 views
0 comments
0 upvotes
company logo
Power Programmer
4 rounds | 5 problems
Interviewed by Infosys
403 views
0 comments
0 upvotes
Companies with similar interview experiences
Java Developer
3 rounds | 20 problems
Interviewed by Ernst & Young (EY)
4095 views
2 comments
0 upvotes
company logo
Java Developer
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
7915 views
0 comments
0 upvotes
company logo
Java Developer
2 rounds | 2 problems
Interviewed by HCL Technologies
205 views
0 comments
0 upvotes