Faster and better experience!
i
Infosys
Work with us
Filter interviews by
Java 21 introduces new features enhancing performance, developer productivity, and language capabilities for modern applications.
Pattern Matching for Switch: Simplifies coding by allowing patterns to be used in switch statements, improving readability. Example: 'switch (obj) { case String s -> ...; }'
Record Patterns: Enhances the use of records by allowing destructuring in pattern matching, making it easier to ...
A class in Java is a blueprint for creating objects, encapsulating data and methods to define their behavior.
Classes encapsulate data (attributes) and methods (functions) that operate on the data.
Example: class Car { String color; int year; void drive() { ... } }
Classes can inherit from other classes, promoting code reuse.
Example: class ElectricCar extends Car { int batteryLife; }
Objects are instances of classes, ...
The volatile keyword in Java ensures visibility of changes to variables across threads.
Volatile variables are stored in main memory, ensuring visibility across threads.
It prevents caching of the variable in thread-local memory.
Example: 'volatile int counter;' ensures all threads see the latest value of counter.
Volatile does not guarantee atomicity; use synchronized for compound actions.
To find the highest salary in a table, use the SQL MAX() function on the salary column.
Use the SQL query: SELECT MAX(salary) FROM employees;
Ensure the 'employees' table contains a 'salary' column.
The MAX() function returns the maximum value from a specified column.
RestTemplate is a synchronous client to perform HTTP requests in Spring applications.
Simplifies interaction with RESTful web services.
Supports various HTTP methods: GET, POST, PUT, DELETE.
Example: RestTemplate.getForObject(url, responseType) retrieves data.
Can handle JSON/XML responses automatically.
Easily configurable with message converters for different content types.
Microservices use JWT for secure authentication, enabling them to verify each other's identity without centralized control.
Microservices issue a JWT after user authentication, containing claims about the user.
The JWT is signed with a secret key, ensuring its integrity and authenticity.
When one microservice needs to call another, it includes the JWT in the request header.
The receiving microservice verifies the JWT ...
The @Primary annotation in Spring indicates a preferred bean when multiple candidates are available for autowiring.
@Primary is used in Spring Framework for dependency injection.
It helps resolve ambiguity when multiple beans of the same type exist.
Example: If you have two beans of type 'DataSource', marking one with @Primary will make it the default choice.
It can be combined with @Qualifier for more specific bean s...
Setting up a discovery server for microservices involves using tools like Eureka or Consul for service registration and discovery.
Choose a discovery service tool (e.g., Spring Cloud Eureka, Consul).
Add the discovery server dependency in your project (e.g., for Eureka: 'spring-cloud-starter-netflix-eureka-server').
Annotate the main application class with @EnableEurekaServer to enable the discovery server.
Configure ...
Injecting a specific bean of the same type in Spring can be achieved using qualifiers or by defining unique bean names.
Use @Qualifier: When you have multiple beans of the same type, use the @Qualifier annotation to specify which bean to inject. Example: @Autowired @Qualifier("beanName")
Define Unique Bean Names: You can define beans with unique names in your configuration. Example: @Bean(name = "specificBean") publ...
Spring Security is a powerful framework for securing Java applications, providing authentication and authorization features.
Provides comprehensive security services for Java applications.
Supports authentication via various methods like form-based, basic, and OAuth.
Allows fine-grained access control using annotations like @PreAuthorize.
Integrates seamlessly with Spring applications, leveraging the Spring ecosystem.
...
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....
To find the highest salary in a table, use the SQL MAX() function on the salary column.
Use the SQL query: SELECT MAX(salary) FROM employees;
Ensure the 'employees' table contains a 'salary' column.
The MAX() function returns the maximum value from a specified column.
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.
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 124 interview experiences
Difficulty level
Duration
based on 131 reviews
Rating in categories
Technology Analyst
55.8k
salaries
| ₹3 L/yr - ₹11.5 L/yr |
Senior Systems Engineer
52.4k
salaries
| ₹2.5 L/yr - ₹8.1 L/yr |
System Engineer
32.1k
salaries
| ₹2.3 L/yr - ₹5.3 L/yr |
Technical Lead
31.4k
salaries
| ₹7.3 L/yr - ₹20 L/yr |
Senior Associate Consultant
29.9k
salaries
| ₹6.3 L/yr - ₹16.9 L/yr |
TCS
Wipro
Cognizant
Accenture