# Infosys Interview Questions with Answers

8 previously-asked interview questions from Infosys's hiring process, each with the correct answer and a worked explanation. Written against the company's actual test pattern.

_Source: Astra (https://useastra.in). Updated 2026-09-05._

### 1. What is OOP and what are its main principles?

**Answer:** Object Oriented Programming models software as objects that combine data and behaviour. Its four principles are encapsulation, inheritance, polymorphism, and abstraction. It improves reusability, maintainability, and modularity.

**Explanation:** Four pillars: encapsulation, inheritance, polymorphism, abstraction.

### 2. What is the difference between a primary key and a unique key?

**Answer:** A primary key uniquely identifies each row and cannot be null; a table has only one. A unique key also enforces uniqueness but can accept one null value and a table can have several. Both create constraints and indexes.

**Explanation:** Primary key: one, not null. Unique key: many, allows a null.

### 3. What is a join in SQL and what are its types?

**Answer:** A join combines rows from two or more tables based on a related column. Common types are inner join (matching rows), left join and right join (all rows from one side plus matches), and full outer join (all rows from both). Cross join gives the Cartesian product.

**Explanation:** Combine tables on a related column; inner, left, right, full, cross.

### 4. In Java, what is the difference between == and the equals method?

**Answer:** The == operator compares references (whether two variables point to the same object) for objects, and values for primitives. The equals method compares the actual content and can be overridden, as String does, to check logical equality.

**Explanation:** == compares references; equals compares content.

### 5. What is recursion and when would you use it?

**Answer:** Recursion is when a function calls itself to solve smaller subproblems until a base case stops it. It suits problems with self-similar structure such as factorial, Fibonacci, tree traversal, and divide and conquer. Watch for a correct base case to avoid stack overflow.

**Explanation:** Function calling itself with a base case; good for divide and conquer.

### 6. What is the difference between DELETE, TRUNCATE and DROP in SQL?

**Answer:** DELETE removes selected rows and can be rolled back (DML). TRUNCATE removes all rows quickly and resets the table but is DDL. DROP removes the entire table including its structure. Choose based on whether you need row-level control or a full reset.

**Explanation:** DELETE rows (DML), TRUNCATE all rows (DDL), DROP whole table.

### 7. Tell me about yourself.

**Answer:** Give a crisp 60 to 90 second overview: your background and degree, key technical skills, a standout project or internship with its impact, and why you are keen on Infosys. Keep it structured and relevant to the role.

**Explanation:** Structured pitch: background, skills, project, fit.

### 8. Why do you want to join Infosys?

**Answer:** Highlight the renowned Mysore training program (one of the largest corporate training campuses), strong learning culture, global client work, and brand value for a fresher. Connect it to your goal of building strong fundamentals early.

**Explanation:** Mysore training, learning culture, brand, growth.

More Infosys preparation, including the full recruitment process: https://useastra.in/campus/infosys
