CoverPhoto
Infosys logo
Premium Employer

Infosys

Verified
3.6
based on 39.5k Reviews
Filter interviews by
Software Developer
Fresher
Experienced
Skills
Clear (2)

10+ Infosys Software Developer Interview Questions and Answers for Freshers

Updated 25 Apr 2024

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

Ans.

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.

Add your answer
right arrow

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

Ans.

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

Add your answer
right arrow

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

Ans.

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.

Add your answer
right arrow

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

Ans.

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.

Add your answer
right arrow
Discover Infosys interview dos and don'ts from real experiences

Q5. What is python and difference between java and python

Ans.

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

Add your answer
right arrow

Q6. What is opp in java? What are concepts in opps

Ans.

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

Add your answer
right arrow
Are these interview questions helpful?

Q7. How to sort data in sql quiries

Ans.

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

View 1 answer
right arrow

Q8. Why python is interpreted and easy

Ans.

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.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. What is the syntax of the main method?

Ans.

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) { }

View 1 answer
right arrow

Q10. what is abstract class, what is list, SQL,ADO.net

Ans.

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

Add your answer
right arrow

Q11. How to check Java version?

Ans.

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

View 3 more answers
right arrow

Q12. What is unit testing and what tools you use?

Ans.

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.

Add your answer
right arrow

Q13. Why java is independent?

Ans.

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).

Add your answer
right arrow

Q14. History of python History of java

Ans.

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

Add your answer
right arrow

Q15. What is the html

Ans.

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'>

Add your answer
right arrow

Q16. What's this body

Ans.

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.

Add your answer
right arrow

Q17. What is the end tag

Ans.

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

Add your answer
right arrow

Q18. Generics in Java

Ans.

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.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Infosys Software Developer for Freshers

based on 9 interviews
4 Interview rounds
Technical Round
HR Round
Aptitude Test Round
Personal Interview1 Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

Chetu Logo
3.3
 • 36 Interview Questions
Meesho Logo
3.7
 • 11 Interview Questions
View all
Recently Viewed
SALARIES
Bosch Global Software Technologies
INTERVIEWS
TCS
Fresher
60 top interview questions
SALARIES
Sutherland Global Services
INTERVIEWS
Raja Software Labs
10 top interview questions
INTERVIEWS
Infosys
10 top interview questions
INTERVIEWS
HexaView Technologies
No Interviews
INTERVIEWS
Accenture
20 top interview questions
INTERVIEWS
Infosys
100 top interview questions
INTERVIEWS
Coforge
10 top interview questions
SALARIES
Ernst & Young
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter