i
Infosys
Work with us
Filter interviews by
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...
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...
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 =...
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...
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...
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...
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 '='
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...
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.
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
I appeared for an interview in Feb 2025.
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.
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
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));
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....
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...
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...
I applied via Company Website and was interviewed in Nov 2024. There were 2 interview rounds.
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...
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...
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.
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...
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...
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 ...
I appeared for an interview in Sep 2024.
I applied via Company Website and was interviewed in Nov 2024. There were 2 interview rounds.
I applied via Company Website and was interviewed in Aug 2024. There were 2 interview rounds.
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...
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...
I applied via Naukri.com and was interviewed in Aug 2024. There were 3 interview rounds.
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.
I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.
What people are saying about Infosys
Some of the top questions asked at the Infosys Java Developer interview -
The duration of Infosys Java Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 127 interview experiences
Difficulty level
Duration
based on 135 reviews
Rating in categories
Technology Analyst
54.7k
salaries
| ₹4.8 L/yr - ₹10 L/yr |
Senior Systems Engineer
53.9k
salaries
| ₹2.5 L/yr - ₹6.3 L/yr |
Technical Lead
35.1k
salaries
| ₹9.4 L/yr - ₹16.4 L/yr |
System Engineer
32.6k
salaries
| ₹2.4 L/yr - ₹5.5 L/yr |
Senior Associate Consultant
31.4k
salaries
| ₹8.2 L/yr - ₹15 L/yr |
TCS
Wipro
Cognizant
Accenture