Premium Employer

i

This company page is being actively managed by Infosys Team. If you also belong to the team, you can get access from here

Infosys Verified Tick Work with us arrow

Compare button icon Compare button icon Compare

Filter interviews by

Infosys Java Developer Interview Questions and Answers

Updated 5 Jun 2025

79 Interview questions

A Java Developer was asked 2mo ago
Q. What is a hash collision?
Ans. 

A hash collision occurs when two different inputs produce the same hash value in a hash function, leading to potential data integrity issues.

  • Definition: A hash collision happens when two distinct inputs yield the same hash output, which can compromise data integrity.

  • Example: If both 'apple' and 'banana' hash to the same value, a collision occurs, making it difficult to distinguish between them.

  • Impact: Collisions c...

A Java Developer was asked 3mo ago
Q. What is inheritance in the context of programming?
Ans. 

Inheritance allows a class to inherit properties and methods from another class, promoting code reusability and organization.

  • Inheritance enables a new class (subclass) to inherit attributes and methods from an existing class (superclass).

  • Example: If 'Animal' is a superclass, 'Dog' can be a subclass that inherits properties like 'species' and methods like 'makeSound()'.

  • It supports the concept of 'is-a' relationship...

Java Developer Interview Questions Asked at Other Companies

asked in Deloitte
Q1. Sort 0 and 1 Problem Statement Given an integer array ARR of size ... read more
Q2. Parent class has run() and walk(). Parent run() calls walk(). Chi ... read more
asked in Infosys
Q3. Which should be preferred between String and StringBuffer when th ... read more
Q4. How do you sort a list of students based on their first name?
asked in Cognizant
Q5. What array list and linkedlist difference,how hashmap internally ... read more
🔥 Asked by recruiter 2 times
A Java Developer was asked 3mo ago
Q. What is a string pool?
Ans. 

A string pool is a special storage area in Java that optimizes memory usage by reusing immutable string objects.

  • Memory Efficiency: The string pool reduces memory consumption by storing only one copy of each distinct string literal.

  • String Interning: When a string is created, Java checks the pool first; if it exists, the reference is returned instead of creating a new object.

  • Example: String s1 = "Hello"; String s2 =...

🔥 Asked by recruiter 4 times
A Java Developer was asked 11mo ago
Q. What is the difference between an interface and an abstract class?
Ans. 

Interface is a blueprint for classes to implement, while abstract class can have both abstract and concrete methods.

  • Interface can only have abstract methods and constants, while abstract class can have abstract and concrete methods.

  • A class can implement multiple interfaces but can only extend one abstract class.

  • Interfaces are used to achieve multiple inheritance in Java.

  • Abstract classes can have instance variables...

🔥 Asked by recruiter 4 times
A Java Developer was asked
Q. What are the features of Java 8?
Ans. 

Java 8 introduced significant features like lambdas, streams, and new date/time APIs, enhancing productivity and code readability.

  • Lambda Expressions: Enable concise representation of functional interfaces. Example: (a, b) -> a + b.

  • Streams API: Allows processing sequences of elements (collections) in a functional style. Example: list.stream().filter(x -> x > 10).collect(Collectors.toList()).

  • Default Methods...

🔥 Asked by recruiter 6 times
A Java Developer was asked
Q. What is your expected CTC?
Ans. 

Expected CTC depends on various factors such as experience, skills, job role, and company policies.

  • CTC stands for Cost to Company and includes salary, bonuses, and other benefits.

  • It is important to research the industry standards and company policies before quoting a figure.

  • Factors such as location, job role, and experience can affect the expected CTC.

  • For example, a Java Developer with 2 years of experience can ex...

A Java Developer was asked
Q. String s=null; ?
Ans. 

Declaring a null String variable

  • The variable 's' is of type String and has a null value assigned to it

  • Attempting to use this variable without initializing it will result in a NullPointerException

  • The variable can be assigned a value later using the assignment operator '='

Are these interview questions helpful?
A Java Developer was asked 2mo ago
Q. How is a hashmap implemented and how does it work?
Ans. 

A HashMap is a data structure that stores key-value pairs, allowing for efficient data retrieval and storage using hashing.

  • Key-Value Pair Storage: HashMaps store data in pairs, where each key is unique and maps to a specific value, e.g., map.put('key1', 'value1').

  • Hash Function: A hash function computes an index based on the key, determining where to store the value in an underlying array.

  • Collision Handling: When t...

A Java Developer was asked 4mo ago
Q. Which is springboot default server and How to use another server in springboot?
Ans. 

Spring Boot's default server is Tomcat, but you can easily switch to others like Jetty or Undertow.

  • Spring Boot uses Tomcat as the default embedded server.

  • To use Jetty, add the dependency: 'spring-boot-starter-jetty' in your pom.xml.

  • For Undertow, include 'spring-boot-starter-undertow' in your dependencies.

  • You can exclude Tomcat by adding 'exclude = {Tomcat.class}' in your @SpringBootApplication annotation.

A Java Developer was asked 4mo ago
Q. What is the default port of springboot and How to change?
Ans. 

Spring Boot's default port is 8080, and it can be changed via application properties or command line arguments.

  • Default port: 8080.

  • Change via application.properties: server.port=9090.

  • Change via command line: java -jar app.jar --server.port=9090.

  • Change via YAML: server: port: 9090

Infosys Java Developer Interview Experiences

155 interviews found

Interview experience
2
Poor
Difficulty level
Easy
Process Duration
2-4 weeks
Result
Selected Selected

I appeared for an interview in Feb 2025.

Round 1 - Technical 

(21 Questions)

  • Q1. Explain the Spring Security.
  • Q2. Expalin the flow of a Rest API call from frontend to backend and response from backend to frontend.
  • Q3. Explain JWT token.
  • Q4. Define Filters and Segmentation in Spring Security.
  • Q5. How one microservices authenticate another microservice with JWT?
  • Q6. What is a Functional Interface?
  • Q7. Give an example of a java interface which uses a functional interface.
  • Q8. Write a code to implement Runnable using lambda.
  • Q9. Which is springboot default server and How to use another server in springboot?
  • Ans. 

    Spring Boot's default server is Tomcat, but you can easily switch to others like Jetty or Undertow.

    • Spring Boot uses Tomcat as the default embedded server.

    • To use Jetty, add the dependency: 'spring-boot-starter-jetty' in your pom.xml.

    • For Undertow, include 'spring-boot-starter-undertow' in your dependencies.

    • You can exclude Tomcat by adding 'exclude = {Tomcat.class}' in your @SpringBootApplication annotation.

  • Answered by AI
  • Q10. What are profiles and how to use them?
  • Q11. How is bean Injection working?
  • Q12. How to inject a specific bean of the same object?
  • Q13. How to set up a discovery server for microservices?
  • Q14. What is the use of @Primary annotation?
  • Q15. Which method can be used to check if a service is up or not?
  • Q16. How would you externalize a microservice?
  • Q17. What is the default port of springboot and How to change?
  • Ans. 

    Spring Boot's default port is 8080, and it can be changed via application properties or command line arguments.

    • Default port: 8080.

    • Change via application.properties: server.port=9090.

    • Change via command line: java -jar app.jar --server.port=9090.

    • Change via YAML: server: port: 9090

  • Answered by AI
  • Q18. What is an optional class and its use?
  • Ans. 

    The Optional class is a container that may or may not hold a non-null value, helping to avoid NullPointerExceptions.

    • Introduced in Java 8 to represent optional values.

    • Helps in avoiding null checks and NullPointerExceptions.

    • Methods include isPresent(), ifPresent(), orElse(), and orElseGet().

    • Example: Optional<String> name = Optional.ofNullable(getName());

    • Example: name.ifPresent(n -> System.out.println(n));

  • Answered by AI
  • Q19. Optional.Of() vs Optional.ofNullable()
  • Ans. 

    Optional.of() throws an exception for null, while Optional.ofNullable() allows null values, returning an empty Optional.

    • Optional.of(T value): Requires a non-null value; throws NullPointerException if value is null.

    • Example: Optional<String> opt = Optional.of('Hello'); // valid

    • Optional.ofNullable(T value): Accepts null values; returns Optional.empty() if value is null.

    • Example: Optional<String> opt = Optional....

  • Answered by AI
  • Q20. Write SQL query to find highest salary.
  • Q21. What is a Rest template?
Round 2 - Technical 

(7 Questions)

  • Q1. Tell me about your project and what is your day-to-day work?
  • Q2. If a bunch of freshers joined your projects, they are not very competent about the skills you required in your project then how do you handle this situation?
  • Q3. If you get negative feedback from your manager then how will you tackle this situation?
  • Ans. 

    Receiving negative feedback is an opportunity for growth; I approach it with an open mind and a willingness to improve.

    • Listen actively to the feedback without interrupting, showing respect for the manager's perspective.

    • Ask clarifying questions to fully understand the feedback and the areas needing improvement.

    • Reflect on the feedback and identify specific actions I can take to address the concerns raised.

    • Create a plan t...

  • Answered by AI
  • Q4. If you project is going to end and you found a bug in the application then what actions will you take?
  • Q5. What is your long term and short term goals?
  • Ans. 

    My short-term goal is to enhance my Java skills, while my long-term goal is to lead projects and mentor junior developers.

    • Short-term: Master advanced Java frameworks like Spring and Hibernate to improve my development efficiency.

    • Short-term: Contribute to open-source projects to gain real-world experience and collaborate with other developers.

    • Long-term: Aim for a leadership role where I can guide teams in best practices...

  • Answered by AI
  • Q6. Why are you leaving your current organization?
  • Q7. If you have been assigned to a project and you're not compatible with required skills then what will you do? Will you reject the project?
Round 3 - HR 

(1 Question)

  • Q1. Current and Expected Salary?

Interview Preparation Tips

Interview preparation tips for other job seekers - Learn indepth of core java and springboot.
Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Company Website and was interviewed in Nov 2024. There were 2 interview rounds.

Round 1 - Technical 

(7 Questions)

  • Q1. Create one Spring boot controller from end to end. No need to create a spring boot project we just want to see the structure and end to end implementation.
  • Ans. 

    Creating a Spring Boot controller involves defining endpoints, handling requests, and returning responses.

    • 1. Set up a Spring Boot project using Spring Initializr or your IDE.

    • 2. Add necessary dependencies in 'pom.xml' or 'build.gradle'. Example: 'spring-boot-starter-web'.

    • 3. Create a controller class annotated with '@RestController'.

    • 4. Define request mapping using '@RequestMapping' or specific annotations like '@GetMappi...

  • Answered by AI
  • Q2. Write a java 8 program to get the characters from a string whose count is 2 or more than 2 e.g. input: baseball , output: b, a, l.
  • Ans. 

    This program identifies and extracts characters from a string that appear two or more times using Java 8 features.

    • Use a Map to count occurrences of each character. Example: 'baseball' -> {b=1, a=2, s=1, e=1, l=2}

    • Filter the Map to find characters with a count of 2 or more. Result: ['a', 'l']

    • Use Java Streams to simplify the process and collect results into a List.

    • Convert the List to a String format with characters sep...

  • Answered by AI
  • Q3. Why you left your previous organization.
  • Q4. What is the functional interface
  • Q5. What are the OOPS concepts. and some questions related to inheritance.
  • Q6. Asked about the project mentioned in CV (Client project) and asked its architecture.
  • Q7. Various SQL join types
Round 2 - HR 

(3 Questions)

  • Q1. Are you ready to relocate to job location
  • Ans. 

    Yes, I am open to relocating for the right opportunity to advance my career and contribute effectively to the team.

    • Relocation can provide new experiences and professional growth.

    • I have previously relocated for a job, which helped me expand my network.

    • I am adaptable and can quickly adjust to new environments.

    • I understand the importance of being present in the workplace for collaboration.

  • Answered by AI
  • Q2. Why are you leaving your previous organization.
  • Ans. 

    I am leaving my previous organization to seek new challenges and opportunities for professional growth in a dynamic environment.

    • Desire for career advancement: I am looking for a role that offers more opportunities for growth and learning.

    • Seeking new challenges: I want to work on more complex projects that push my skills further.

    • Cultural fit: I believe that a different organizational culture may align better with my val...

  • Answered by AI
  • Q3. Expectation about salary

Interview Preparation Tips

Interview preparation tips for other job seekers - Do your basics strong, and keep hands on problems.

Skills evaluated in this interview

Interview experience
1
Bad
Difficulty level
Easy
Process Duration
2-4 weeks
Result
Not Selected
Round 1 - Technical 

(2 Questions)

  • Q1. Core Java questions
  • Q2. 3 Coding problems to solve
Round 2 - Behavioral 

(2 Questions)

  • Q1. Worst thing was he started asking Devops questions to a Java Developer.
  • Q2. Why is your current company not utilizing a technology that I am familiar with, despite my ability to answer all related questions accurately?
  • Ans. 

    Current company may have different priorities, budget constraints, existing systems, or may not see the immediate need for the technology.

    • Different priorities: Company may be focusing on other projects or technologies that are deemed more important at the moment.

    • Budget constraints: Implementing new technology can be costly and the company may not have the budget for it.

    • Existing systems: Company may already have systems...

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - Please prepare well not all peoples are same but yes really worried that such peoples are there who asks you anything and will suggests that convince current employer to use a silly technology which is not used in 80% of companies.
Interview experience
2
Poor
Difficulty level
Easy
Process Duration
2-4 weeks
Result
Not Selected
Round 1 - Behavioral 

(2 Questions)

  • Q1. Why is your company not utilizing XYZ technology, and what implications does that have for my qualifications, considering I am knowledgeable about that technology and addressed relevant questions during th...
  • Ans. 

    The company has chosen not to utilize XYZ technology due to budget constraints and compatibility issues.

    • Budget constraints may have limited the company's ability to invest in new technologies.

    • Compatibility issues with existing systems may have prevented the adoption of XYZ technology.

    • The company may have determined that the benefits of XYZ technology do not outweigh the costs of implementation.

    • There may be alternative ...

  • Answered by AI
  • Q2. You should know Devops as Java Developer

Interview Preparation Tips

Interview preparation tips for other job seekers - If you encounter an interviewer with a strong ego, respond to their questions by indicating that you are learning the technology and make an effort to answer to the best of your ability.

Java Developer Interview Questions & Answers

user image Uddipon Duara

posted on 29 Oct 2024

Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Selected Selected

I appeared for an interview in Sep 2024.

Round 1 - Technical 

(6 Questions)

  • Q1. Core java basics - ConcurrentHashMap, Immutable class, Singleton
  • Q2. Write code to demonstrate the flow of Spring MVC
  • Q3. Java Stream API
  • Q4. Find duplicates using stream api
  • Q5. Write code to put all the zeroes of an array to the end
  • Q6. Find if 2 given strings are anagrams
Round 2 - Behavioral 

(5 Questions)

  • Q1. Discussion regarding my current work
  • Q2. How to check logs in an app
  • Q3. 1 Problem solving question
  • Q4. How to manage during strict deadlines
  • Q5. Basic Hibernate and Java questions

Skills evaluated in this interview

Interview experience
3
Average
Difficulty level
-
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Company Website and was interviewed in Nov 2024. There were 2 interview rounds.

Round 1 - Technical 

(2 Questions)

  • Q1. Basic spring boot questions
  • Q2. Diff btw interface and abstract
Round 2 - Technical 

(2 Questions)

  • Q1. Agile ,sprints,
  • Q2. Details about project
Interview experience
4
Good
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
-

I applied via Company Website and was interviewed in Aug 2024. There were 2 interview rounds.

Round 1 - Technical 

(7 Questions)

  • Q1. Difference between list and set
  • Q2. Explain about @qualifiers
  • Q3. Can we use try and finally without catch?
  • Q4. Annotations in @springbootApplication
  • Ans. 

    Annotations in @SpringBootApplication are used to configure the Spring Boot application.

    • Annotations like @SpringBootApplication are used to enable auto-configuration and component scanning in a Spring Boot application.

    • Other commonly used annotations include @RestController, @Service, @Repository, and @Component for defining different types of Spring beans.

    • Annotations like @Autowired are used for dependency injection in...

  • Answered by AI
  • Q5. @getmapping vs @postmapping
  • Q6. Features of Java 8
  • Ans. 

    Java 8 introduced several new features including lambda expressions, streams, functional interfaces, and default methods.

    • Lambda expressions allow for more concise code and easier parallel programming.

    • Streams provide a way to work with sequences of elements and perform operations such as filtering, mapping, and reducing.

    • Functional interfaces enable the use of lambda expressions and method references.

    • Default methods allo...

  • Answered by AI
  • Q7. Code in stream api - to find all the numbers less than 10 in a given array list
Round 2 - HR 

(2 Questions)

  • Q1. Talked about expected salary
  • Q2. Preferred location asked

Interview Preparation Tips

Topics to prepare for Infosys Java Developer interview:
  • Java 8
  • Exception handling
  • Spring Boot
  • Collections
Interview preparation tips for other job seekers - Code in stream api is given very importance in Infosys .

Skills evaluated in this interview

Java Developer Interview Questions & Answers

user image Khushi Sahay

posted on 22 Sep 2024

Interview experience
5
Excellent
Difficulty level
Easy
Process Duration
Less than 2 weeks
Result
Selected Selected

I applied via Naukri.com and was interviewed in Aug 2024. There were 3 interview rounds.

Round 1 - Technical 

(2 Questions)

  • Q1. Question on collection framework and java 8, whatever you have written on your cv, question will be asked from that
  • Q2. Question related to micro service, maven, git, azure or anything else related to that
Round 2 - One-on-one 

(2 Questions)

  • Q1. This was the managerial round in which it mainly focused on what i have worked
  • Q2. Question related to my project and how i faced challenges in my previous company
Round 3 - HR 

(2 Questions)

  • Q1. Normal salary discussion and negotiation
  • Q2. Location discuss

Java Developer Interview Questions & Answers

user image Pooja Babar

posted on 2 Jan 2025

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Technical 

(2 Questions)

  • Q1. Java 8 questions, OOPS,spring
  • Q2. Find the smallest element in array using java8
Round 2 - HR 

(2 Questions)

  • Q1. Salary discusssion
  • Q2. What is your expected CTC
  • Ans. 

    My expected CTC is based on my experience, skills, and the market rate for Java Developers.

    • My expected CTC is in line with industry standards for Java Developers.

    • I have considered my years of experience and expertise in Java development when determining my expected CTC.

    • I am open to negotiation based on the overall compensation package offered by the company.

  • Answered by AI
Interview experience
3
Average
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Selected Selected

I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.

Round 1 - One-on-one 

(2 Questions)

  • Q1. Coding question on arrays
  • Q2. Core java programming related questions

What people are saying about Infosys

View All
yedabhai
1w
works at
Hyperpure
Are we not even safe in our own workplaces?
An Infosys employee was arrested for secretly recording women in the office washroom. Over 30 videos were found on his phone. This isn't just shocking, it's horrifying. Offices are meant to be safe, respectful spaces. 🙎 When will companies truly prioritize safety and surveillance in all corners, not just the visible ones?
FeedCard Image
Got a question about Infosys?
Ask anonymously on communities.

Infosys Interview FAQs

How many rounds are there in Infosys Java Developer interview?
Infosys interview process usually has 1-2 rounds. The most common rounds in the Infosys interview process are Technical, One-on-one Round and HR.
How to prepare for Infosys Java Developer interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Infosys. The most common topics and skills that interviewers at Infosys expect are Java, Microservices, Spring Boot, Hibernate and SDLC.
What are the top questions asked in Infosys Java Developer interview?

Some of the top questions asked at the Infosys Java Developer interview -

  1. 1.What is Singleton in java and create your own singleton class countering all ...read more
  2. write a code to filter out loans with incomplete status using java 8 featur...read more
  3. Difference Between Comparator and Comparable. What is fully qualified domain na...read more
What are the most common questions asked in Infosys Java Developer HR round?

The most common HR questions asked in Infosys Java Developer interview are -

  1. What are your strengths and weakness...read more
  2. What are your salary expectatio...read more
How long is the Infosys Java Developer interview process?

The duration of Infosys Java Developer interview process can vary, but typically it takes about less than 2 weeks to complete.

Tell us how to improve this page.

Overall Interview Experience Rating

4.1/5

based on 127 interview experiences

Difficulty level

Easy 34%
Moderate 59%
Hard 7%

Duration

Less than 2 weeks 58%
2-4 weeks 31%
4-6 weeks 6%
6-8 weeks 5%
View more
Join Infosys Creating the next opportunity for people, businesses & communities
Infosys Java Developer Salary
based on 1.6k salaries
₹4 L/yr - ₹9 L/yr
At par with the average Java Developer Salary in India
View more details

Infosys Java Developer Reviews and Ratings

based on 135 reviews

3.7/5

Rating in categories

3.7

Skill development

3.7

Work-life balance

3.1

Salary

3.8

Job security

3.8

Company culture

2.9

Promotions

3.5

Work satisfaction

Explore 135 Reviews and Ratings
Java Developer-- Bangalore(Infosys)

Hyderabad / Secunderabad,

Chennai

+1

3-5 Yrs

₹ 3-11.5 LPA

Hiring For Java Developer -Pan India

Hyderabad / Secunderabad,

Chennai

+1

3-8 Yrs

Not Disclosed

Java Developer (pan India).-H

Pune,

Chennai

+1

3-8 Yrs

Not Disclosed

Explore more jobs
Technology Analyst
54.7k salaries
unlock blur

₹4.8 L/yr - ₹10 L/yr

Senior Systems Engineer
53.9k salaries
unlock blur

₹2.5 L/yr - ₹6.3 L/yr

Technical Lead
35.1k salaries
unlock blur

₹9.4 L/yr - ₹16.4 L/yr

System Engineer
32.6k salaries
unlock blur

₹2.4 L/yr - ₹5.5 L/yr

Senior Associate Consultant
31.4k salaries
unlock blur

₹8.2 L/yr - ₹15 L/yr

Explore more salaries
Compare Infosys with

TCS

3.6
Compare

Wipro

3.7
Compare

Cognizant

3.7
Compare

Accenture

3.7
Compare
write
Share an Interview