i
Infosys
Filter interviews by
I appeared for an interview in Feb 2025.
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.
Offer...
JWT (JSON Web Token) is a compact, URL-safe means of representing claims to be transferred between two parties.
JWT consists of three parts: Header, Payload, and Signature.
Header typically contains the type of token (JWT) and the signing algorithm (e.g., HMAC SHA256).
Payload contains the claims, which can be user data or metadata (e.g., user ID, expiration time).
Signature is created by combining the encoded header, payl...
Filters and Segmentation in Spring Security manage request processing and user access control.
Filters are components that intercept requests and responses in the Spring Security filter chain.
Examples of filters include UsernamePasswordAuthenticationFilter and BasicAuthenticationFilter.
Segmentation refers to dividing users into roles or groups for access control.
Using @PreAuthorize or @Secured annotations allows method-
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 using...
A Functional Interface is an interface with a single abstract method, enabling lambda expressions in Java.
Functional interfaces are used primarily with lambda expressions.
They can have multiple default or static methods but only one abstract method.
Common examples include Runnable, Callable, and Comparator.
You can create your own functional interfaces using the @FunctionalInterface annotation.
Implementing Runnable using lambda expressions simplifies thread creation in Java.
Lambda expressions provide a clear and concise way to represent a functional interface.
Runnable is a functional interface with a single abstract method: run().
Example of Runnable using lambda: Runnable task = () -> System.out.println('Running in a thread');
To start a thread: new Thread(task).start();
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.
Profiles in Java are configurations that define specific settings for different environments.
Profiles allow you to customize application behavior based on the environment (e.g., development, testing, production).
You can define profiles in the application.properties or application.yml file using 'spring.profiles.active'.
Example: 'spring.profiles.active=dev' activates the 'dev' profile, loading specific configurations.
Pr...
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 select
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));
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.
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...
Upon discovering a bug near project completion, I would assess its impact, communicate with stakeholders, and prioritize a fix.
Assess the severity of the bug: Determine if it's a critical issue that affects functionality or a minor cosmetic issue.
Communicate with the team: Inform relevant stakeholders, including project managers and team members, about the bug.
Prioritize the fix: If the bug is critical, prioritize it f...
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 ...
Infosys interview questions for designations
I appeared for an interview in Sep 2024.
Demonstrate the flow of Spring MVC through code
Create a controller class with request mapping annotations
Define methods in the controller to handle different requests
Configure the dispatcher servlet in web.xml
Create a view resolver to map logical view names to actual views
Use stream api to find duplicates in an array of strings
Convert array to stream using Arrays.stream()
Use Collectors.groupingBy() to group elements by their occurrences
Filter the map to find elements with count > 1
Move all zeroes in an array to the end without changing the order of other elements.
Iterate through the array and keep track of the index where non-zero elements should be placed.
After the iteration, fill the remaining positions with zeroes.
Check if 2 strings are anagrams by comparing sorted characters
Sort the characters of both strings and compare if they are equal
Use a hashmap to store character frequencies and compare the maps
To check logs in an app, access log files or use logging frameworks like Log4j.
Access log files directly in the application directory
Use logging frameworks like Log4j to log messages at different levels
Analyze log files for errors or debugging information
Prioritize tasks, break down work into smaller chunks, communicate with team, utilize time management techniques
Prioritize tasks based on importance and urgency
Break down work into smaller, manageable chunks to make progress
Communicate with team members to ensure everyone is on the same page
Utilize time management techniques such as Pomodoro technique or Agile methodologies
Get interview-ready with Top Infosys Interview Questions
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.
List is an ordered collection that allows duplicate elements, while Set is an unordered collection that does not allow duplicates.
List maintains the insertion order of elements, while Set does not guarantee any specific order.
List allows duplicate elements, while Set does not allow duplicates.
Examples of List implementations in Java are ArrayList and LinkedList, while examples of Set implementations are HashSet and Tre
Annotations used in Spring to disambiguate beans when multiple beans of the same type are present
Used in Spring framework to specify which bean to inject when multiple beans of the same type are present
Can be used with @Autowired or @Resource annotations
Example: @Qualifier("beanName")
Yes, try and finally can be used without catch to handle exceptions.
try block is used to enclose the code that may throw an exception
finally block is used to execute code regardless of whether an exception is thrown or not
If catch block is not present, exceptions will not be caught and handled
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...
The @GetMapping annotation is used to map HTTP GET requests to specific handler methods, while @PostMapping is used for POST requests.
GetMapping is used for retrieving data from the server, while PostMapping is used for sending data to the server.
GetMapping is idempotent, meaning it should not have any side effects, while PostMapping can have side effects.
GetMapping should not be used for operations that modify data, w...
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...
Using stream api to find numbers less than 10 in an array list
Use stream() method on the array list to create a stream of elements
Use filter() method with a lambda expression to filter out numbers less than 10
Collect the filtered elements using collect() method to get the result
I applied via Naukri.com and was interviewed in Aug 2024. There were 3 interview rounds.
Using Java 8, we can find the smallest element in an array of strings by using the Stream API and the min() method.
Convert the array of strings to a Stream using Arrays.stream()
Use the min() method with a Comparator to find the smallest element
Return the smallest element found
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 114 interviews
4 Interview rounds
based on 113 reviews
Rating in categories
Technology Analyst
55.3k
salaries
| ₹3 L/yr - ₹11 L/yr |
Senior Systems Engineer
51k
salaries
| ₹2.8 L/yr - ₹7.9 L/yr |
System Engineer
31.6k
salaries
| ₹2.5 L/yr - ₹5.5 L/yr |
Technical Lead
31k
salaries
| ₹5.1 L/yr - ₹19.6 L/yr |
Senior Associate Consultant
28.5k
salaries
| ₹6.2 L/yr - ₹17 L/yr |
TCS
Wipro
Cognizant
Accenture