
Infosys

10+ Infosys Software Developer Interview Questions and Answers for Freshers
Q1. Maximum Subarray Sum Problem Statement
Given an array ARR
consisting of N
integers, your goal is to determine the maximum possible sum of a non-empty contiguous subarray within this array.
Example of Subarrays:...read more
Find the maximum sum of a contiguous subarray in an array of integers.
Use Kadane's algorithm to find the maximum subarray sum in linear time.
Initialize two variables: maxEndingHere and maxSoFar to keep track of the current subarray sum and the maximum subarray sum seen so far.
Iterate through the array and update the variables accordingly.
Return the maxSoFar as the result.
Q2. Intersection of Linked List Problem
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine the data...read more
Find the node where two linked lists merge, return -1 if no merging occurs.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
Q3. Unival Trees Problem Statement
You are given a binary tree. Your task is to return the count of unival sub-trees in the given binary tree. In a unival tree, all nodes below the root node have the same value as ...read more
Count the number of unival sub-trees in a binary tree where all nodes below the root have the same value as the root node.
Traverse the binary tree recursively and check if each subtree is a unival tree by comparing values with the root node.
Keep track of the count of unival trees while traversing the tree.
Return the total count of unival trees at the end of traversal.
Q4. String Compression Problem Statement
Implement a program that performs basic string compression. When a character is consecutively repeated more than once, replace the consecutive duplicates with the count of r...read more
Implement a program to compress a string by replacing consecutive duplicates with the count of repetitions.
Iterate through the string and keep track of consecutive characters and their counts.
Replace consecutive duplicates with the count of repetitions.
Ensure the count of repetitions is ≤ 9.
Return the compressed string.
Q5. What is python and difference between java and python
Python is a high-level, interpreted programming language. Java is a compiled language.
Python is dynamically typed while Java is statically typed
Python has simpler syntax and is easier to learn than Java
Java is faster and more efficient than Python
Python is better suited for data analysis and machine learning while Java is better for enterprise applications
Python has a larger community and more libraries than Java
Q6. What is opp in java? What are concepts in opps
OOP stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.
OOP is a way of organizing and designing code around objects
It emphasizes encapsulation, inheritance, and polymorphism
Encapsulation is the practice of hiding data and methods within an object
Inheritance allows objects to inherit properties and methods from a parent object
Polymorphism allows objects to take on multiple forms or behaviors
Examples of OOP languages include Jav...read more
Q7. How to sort data in sql quiries
Sorting data in SQL queries
Use ORDER BY clause to sort data in ascending or descending order
Specify the column name to sort by
Can sort by multiple columns
Can use functions like COUNT, AVG, etc. in ORDER BY clause
Example: SELECT * FROM table_name ORDER BY column_name ASC/DESC
Example: SELECT * FROM table_name ORDER BY column1 ASC, column2 DESC
Q8. Why python is interpreted and easy
Python is interpreted and easy due to its dynamic nature and simple syntax.
Python code is executed line by line, making it easy to debug and test.
Python has a simple syntax that is easy to read and write.
Python is dynamically typed, meaning that variables can change types during runtime.
Python has a large standard library and many third-party modules, making it easy to accomplish complex tasks.
Python supports object-oriented, functional, and procedural programming paradigms.
Q9. What is the syntax of the main method?
The main method syntax is a standard entry point for Java programs.
The main method must be declared as public, static, and void.
The method name must be 'main'.
The method must accept an array of strings as an argument.
The method must be defined within a class.
Example: public static void main(String[] args) { }
Q10. what is abstract class, what is list, SQL,ADO.net
Abstract class is a class that cannot be instantiated, List is a collection of objects, SQL is a language used to manage databases, ADO.net is a framework for accessing databases.
Abstract class is used as a base class for other classes
List is a generic collection of objects
SQL is used to create, modify, and query databases
ADO.net provides a set of classes for accessing databases
Example: abstract class Animal { public abstract void MakeSound(); }
Example: List
names = new List (...read more
Q11. How to check Java version?
To check Java version, use command prompt/terminal and type 'java -version'.
Open command prompt/terminal
Type 'java -version'
Press enter
The installed Java version will be displayed
Q12. What is unit testing and what tools you use?
Unit testing is a software testing technique where individual units or components of a software are tested in isolation.
Unit testing helps in identifying bugs early in the development process.
It ensures that each unit of the software performs as expected.
Common unit testing tools include JUnit, NUnit, PHPUnit, and MSTest.
Q13. Why java is independent?
Java is independent because of its platform-independent nature.
Java code is compiled into bytecode which can run on any platform with a JVM installed.
This allows Java to be used on multiple operating systems without any changes to the code.
Java's platform independence is achieved through the use of the Java Virtual Machine (JVM).
Q14. History of python History of java
Python is a high-level, interpreted programming language. Java is a general-purpose, class-based, object-oriented programming language.
Python was created by Guido van Rossum in the late 1980s and released in 1991.
Java was developed by James Gosling and his team at Sun Microsystems in the mid-1990s.
Python is known for its simplicity, readability, and ease of use.
Java is known for its platform independence, security, and scalability.
Python is widely used in web development, sci...read more
Q15. What is the html
HTML stands for Hypertext Markup Language, used for creating and structuring web pages.
HTML is a markup language used to create the structure of web pages
It consists of elements enclosed in tags, such as <html>, <head>, <body>
Attributes can be added to elements to provide additional information or functionality, like <img src='image.jpg'>
Q16. What's this body
The question is unclear and lacks context.
Please provide more information or context for me to answer the question.
Without additional information, I cannot provide a meaningful answer.
Q17. What is the end tag
An end tag is used to mark the end of an HTML element.
It is written as
It is used to close an opening tag
It is important for proper HTML syntax and rendering
Q18. Generics in Java
Generics in Java allow for type safety and reusability of code.
Generics allow for the creation of classes, interfaces, and methods that can work with any data type.
They provide compile-time type safety, preventing runtime errors.
Examples include ArrayList
, HashMap , and Comparable . Wildcards can be used to allow for flexibility in generic types.
Generics can improve code readability and reduce the need for casting.
Generics were introduced in Java 5.
Top HR Questions asked in Infosys Software Developer for Freshers
Interview Process at Infosys Software Developer for Freshers

Top Software Developer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

