Infosys is one of India’s top technology companies. Its headquarters are in Bengaluru, Karnataka, and it trades under Infosys Technologies Limited. Infosys offers various services, including consulting, information technology, and outsourcing.
Table of Content
Basic Infosys Interview Questions for Freshers
1. What are Java’s four main OOP concepts? How do they work?
The four main OOP concepts in Java are Polymorphism, Inheritance, Abstraction and Encapsulation. Below are the workings of these concepts.
- Polymorphism is made up of two words: Poly, which means many, and morphism, which means forms. It allows the same method name to perform different tasks depending on the object that calls it.
- Inheritance: It allows a class to inherit properties like attributes and methods from another class. A class from which other classes inherit is called a Base class. The class created from an existing class is called a Derived class.
- Abstraction allows us to hide unnecessary complex details and show only the necessary parts. We can perform abstraction using the keyword abstract, which helps us create abstract classes.
- Encapsulation allows us to create a capsule to bundle data and methods into one unit. We can use access specifiers (private and protected) to restrict access to attributes and methods.
2. Is it possible to implement multiple inheritance in Java, and if so, how?
Java doesn’t allow multiple inheritance with classes because it can lead to problems like the Diamond Problem. If two parent classes have the same method, the child class wouldn’t know which one to use, creating confusion.
Java solves this with interfaces. An interface is a blueprint for methods. It only says what needs to be done, not the actual code. A class can then implement multiple interfaces and define its versions of those methods.
3. What is the difference between Method Overloading and Method Overriding in Java?
Method overloading is a static polymorphism that occurs in the same class. It is like having the same method name but different parameters. For example, You could have an area() method that can calculate the area of a rectangle, circle, or even triangle because each will have different input parameters.
Method Overriding is a dynamic polymorphism that occurs during inheritance. In this case, a child class inherits a method from its parent class and provides its implementation.
Method Overloading:
- It happens in the same class.
- It uses the same method name but with different parameters or return types.
- It has the same name but performs different tasks based on input.
- It is compile-time polymorphism (static polymorphism).
Method Overriding:
- It happens between parent and child classes.
- It has exactly the same name, parameters, and return type
- It helps us to modify the behavior of a parent method in the child class
- It is runtime polymorphism (dynamic polymorphism).
4. How do Classes and Interfaces differ in Java?
Class:
- It defines objects and their behaviour.
- We need to write complete methods and their bodies.
- It supports single inheritance.
- It can have variables with any access modifier.
- It is used to create objects (real-world entities).
Interface:
- It sets rules that classes should follow.
- We only need to declare the methods (without the body).
- It can support both single and multiple inheritance.
- Variables are always public static final interfaces.
- It defines behaviour (methods) that we can share between classes.
5. What are DDL and DML commands in SQL, and how do they differ?
DDL (Data Definition Language) commands in SQL allow us to structure the database by creating, modifying, or deleting tables and columns.
The common DDL commands that we have in SQL are:
- CREATE: It allows us to create a new table or database.
- ALTER: It allows us to modify an existing table, like removing a few columns or adding.
- DROP: It allows us to delete entire tables or any database permanently
- TRUNCATE: It allows us to delete all the data from a table but keeps the table structure.
DML (Data Manipulation Language) commands in SQL allow us to interact with the database’s content by adding, updating, or deleting rows.
The common DML commands that we have in SQL are:
- INSERT : It allows us to add new data to a table
- UPDATE : It allows us to change the existing data in a table
- DELETE : It allows us to remove any rows from a table
DDL (Data Definition Language):
- These are the commands to create and modify the structure of a database.
- It allows us to design or change the layout of a house.
DML (Data Manipulation Language):
- These are the commands to change data within a database.
- It allows us to add or rearrange furniture inside a house.
Get 100% Hike!
Master Most in Demand Skills Now!
6. What is the difference between the TRUNCATE and DELETE commands in SQL?
DELETE |
TRUNCATE |
It removes particular rows |
It removes all rows |
It can specify a WHERE condition |
It does not support conditions |
It is slower because it removes rows one by one |
It is faster because it removes all rows at once |
It can be rolled back (DML operation) |
It cannot be rolled back (DDL operation) |
7. What is the purpose of indexing in SQL, and why is it useful?
Indexing is like a shortcut that allows us to find data faster in a table. It is mainly used to speed up queries when searching, sorting, or filtering data. To get particular data, the database must search all entries in the table. Rather than doing this, we can use an index to move straight to the needed data.
It improves the performance of operations like SELECT, ORDER BY, JOIN, and WHERE. For example, if a table has millions of rows and we want to search for specific data in a column, indexes can help us retrieve that data directly.
8. What are the Left outer join and the Right outer join in SQL?
Left Outer Join:
- The left outer join retains all rows from the left table and checks whether any rows from the right table are common.
- If the right table does not have common rows, we will still get the rows from the left table, and the right-side columns will be null.
- For example:
Left Table:
ID |
Name |
1 |
Pranav |
2 |
Ayush |
3 |
Vivek |
Right Table:
After Left Outer Join
Name |
Grade |
Pranav |
A |
Ayush |
B |
Vivek |
NULL |
Right Outer Join:
- It is the opposite of the Left-Outer Join, which keeps all rows from the right table and the common rows from the left table.
- If the rows are absent in the left table, it will be null.
- For example:
Left Table:
ID |
Name |
1 |
Pranav |
2 |
Ayush |
3 |
Vivek |
Right Table:
After Right Outer Join
Grade |
Name |
A |
Pranav |
B |
Ayush |
9. What is a Database Schema, and how does it work?
A Database Schema is like a database layout. It builds the structure of how the data is organized, including the number of tables, the columns in each table, and the relationships between them.
Below are the workings of the Database Schema:
- It starts by defining the database’s tables and columns, including their data types, such as number, text, and date. Check if there are any constraints applied, such as NOT NULL or PRIMARY KEY.
- If we have multiple tables, the schema shows how they are related to each other using FOREIGN KEY.
- It also ensures data integrity By using constraints like UNIQUE, NOT NULL, on a column.
10. What are Clustered indexes in SQL, and how do they differ from Non-Clustered indexes?
Both Clustered and Non-Clustered indexes organize data in SQL, making it easier and faster to find what we are looking for.
Clustered index:
- It rearranges the actual data in the table to match the index
- The rows are stored in sorted order on the disk so that the database can access and retrieve the data easily.
- We can have only one cluster in a table.
- For example, if we apply a primary key constraint to any column, it will become a clustered index.
Non-Clustered index:
- Instead of rearranging the data in the table, it creates a separate reference table with pointers that point to the actual rows, just like the book, which has topic names and page numbers.
- Multiple non-clustered indexes can be in a table, as the data and the index are stored in separate memory locations.
Intermediate Infosys Interview Questions
11. Explain the Agile model.
The agile model is a way of breaking large projects into smaller deliverable chunks, which we can easily manage and increase the flexibility of adapting new features fluently. Below are the steps on how the agile model works:
- Instead of building the entire project at once, we first create a miniature working version called iterations or sprints. Each sprint usually takes 1-4 weeks to complete.
- After each sprint, the developer team communicates with the client to get continuous feedback so the next sprint will be more refined and optimized than the previous working version.
12. Explain pointers with examples.
Pointers are variables that hold the memory location of another variable. Unlike storing values like a standard variable, a pointer points to the address where the value is stored in memory. This allows us to interact directly with memory, which helps in allocating memory dynamically (during runtime).
For example:
int x = 10;
int* ptr = &x;
-
- Here, X holds the value 10
- ptr holds the address of x
cout << *ptr;
*ptr = 20;
-
- If we print the value of *ptr, we will get the output of 10.
- We can also change the value of x with the help of pointers.
13. What is a View in SQL?
A View in SQL is like a virtual table that does not have its data. It retrieves the data dynamically from the original table through a pre-defined query each time it is accessed. It can fetch the data from more than one or more tables and display it in a customized way.
For Example:
CREATE VIEW ActiveLearners AS
SELECT Name, Email FROM Intellipaat_learners WHERE Status = 'Active';
SELECT *FROM ActiveLearners
Here, we have created a view named as ActiveLearners, which shows us the active learners from the table Intellipaat_learners.
14. What is the Waterfall model?
The Waterfall model involves developing the software step by step, completing each phase before proceeding on to the next. This approach is best for projects with precise requirements and no further changes required, as it is difficult to change something later.
The phases that we have in the Waterfall model are:
- Requirement Gathering: In this phase, we understand what the client needs.
- Design: In this phase, we plan the software based on those needs.
- Development: In this phase, we start to write the code.
- Testing: In this phase, we check if the code works correctly by using different test cases.
- Deployment: In this phase, we deliver the software to the client.
- Maintenance: Fix any issues after delivery.
15. Explain the difference between IPv4 and IPv6.
IPv4 and IPv6 are the internet protocol (IP) types used to identify which devices are connected to a network.
IPv4:
- IPv4 is an older version of the address system. There are 4.3 billion possibilities because an address has 32 bits. However, in some scenarios, this number is no longer sufficient.
- It uses the dotted decimal address format.
- For example: 192.168.1.1
IPv6:
- IPv6 is the latest version of the address system, allowing us to have unlimited addresses. This means that we can connect billions of devices to the network without any shortage of addresses.
- It uses a hexadecimal address format.
- For Example 2001:0db8:85a3:0000:0000:8a2e:0370:7334
16. What is Dynamic Programming?
Dynamic programming solves complex problems by splitting them into smaller subproblems. We solve each subproblem once and then store the results so that we can reuse them later. This avoids performing the same calculation multiple times and helps us solve these complex problems much faster.
17. Explain Overfitting in Machine Learning.
Overfitting occurs when a model learns the training data too well, including all the noise and details, making it perform much better on the training set. However, when we provide new or unseen data, it performs poorly.
To check whether your model is overfitted or not:
- If your model gives a low error on training data but a high error on testing data.
- If there are too many features (columns) in a neural network.
To solve the overfitting issue,
- We can use some regularization techniques like L1 and L2.
- We can use a cross-validation method to test the model on different data splits during training.
- We can remove the unnecessary features by using feature selection tools like VIF (Variance Inflation Factor)
18. What is a Subnet and Subnet Mask?
A subnet is a network created by dividing the larger network into smaller subnetworks. These subnetworks help us organize and manage the connected devices within the network by reducing traffic.
For example, we have hundreds of computers. Suppose we divide one big network into smaller subnets, like one for the technical and management teams. The communication within each subnet will be much faster and easier to manage than having one big network.
Subnet Mask is a tool that tells us which part of an IP address refers to the network and which part of the IP refers to the devices using that network.
For example:
IP Address: 192.168.1.10
Subnet Mask: 255.255.255.0
Here, 255.255.255 shows the network and the .0 part shows the devices.
19. What is Recursion? Why is it useful?
Recursion is an approach where a function calls itself multiple times until it satisfies its base case or termination condition. It is like splitting a massive task into several smaller but closely related tasks and letting the same function act on them one after the other. This process is followed until the base case is achieved.
We can use recursion in cases like:
- Very large data: Apart from iterating through huge datasets, recursion just requires a fixed-size memory to keep function calls for managing the large input data.
- Resolve complex issues: Recursion allows us to easily break a more significant problem into smaller subproblems and solve the smallest ones, such as tree traversals, sortings, or puzzles, with less effort.
- Backtracking: Finally, recursion is also good at checking all of the possible solutions to a problem. For example, in Chess games, we could try one branch, and if the best move does not make sense, we can backtrack to try another branch and find the best move possible.
20. What is Ensemble Learning in Machine Learning?
Ensemble Learning in machine learning is like teamwork. Instead of depending on a single model, we combine the predictions of multiple models to get better results.
The workings of ensemble learning are mentioned below:
- Each model performs its task, which is making predictions. Then, we combine the outputs of all models and make the final decision.
- We can choose the average value of their prediction or choose according to the highest vote.
- It increases the accuracy of prediction and reduces the overfitting cases.
Advanced Infosys Interview Questions for Experienced
21. Explain some significant differences between C and C++.
C Programming Language:
- C follows a procedural programming approach that mainly focuses on functions and procedures.
- Code reusability is harder in C, as everything revolves around functions.
- C has a small standard library with basic functionality.
- It is great for low-level programming that is closer to hardware/kernels.
C++ Programming Language:
- C++ follows an Object-Oriented programming approach that uses the concept of classes and objects for organization.
- Code reusability is easier in C++ with features like inheritance and polymorphism.
- C++ has a rich standard library offering data structures (vectors and maps) and algorithms.
- It is a high-level programming language, but we can still use C code in C++ if required.
22. What are the differences between TCP and UDP protocols?
TCP (Transmission Control Protocol) |
UDP (User Datagram Protocol) |
TCP is reliable as it ensures that data is delivered correctly and resends if lost. |
UPD is unreliable because there is no assurance that the data will arrive or be correct. |
It is slower because it checks the reliability and resends the lost data. |
It is faster as it does not check the reliability. |
TCP is mainly used for file transfers, emails, and web browsing, where accuracy is essential. |
UDP is mainly used for video streaming, gaming, and live calls, for which speed is essential. |
TCP requires a connection to be established first, then the data must be sent. |
UDP sends data directly without setting up a connection. |
23. Explain the DHCP (Dynamic Host Configuration Protocol) process.
DHCP or (Dynamic Host Configuration Protocol) is a network management protocol used to dynamically assign IP addresses to the device nodes on a network so that they can communicate with each other using IP.
Below are the working steps of DHCP:
- Discovery: When a device connects to any network like WiFi, it asks the DHCP server for the IP address.
- Offers: The DHCP server assigns the available IP address to the device
- Request: The device sends a response regarding using that IP address
- Acknowledgement: The DHCP server confirms that the device will use that IP address for a given time.
24. What do software testing verification and validation entail?
Both verification and validation are the important steps of software testing which makes sure that whether software is working as expected or not. It seems like they are the same but focus on different things.
Verification:
- It mainly focuses on building the software correctly.
- We constantly check that our software is meeting the requirements or not.
- For example, we review the design documents and check whether all features are included in the software.
Validation:
- It mainly focuses on whether the software is correct or not.
- We test whether the software is working and solving the user’s problem.
- For example, using different test cases and simulating real-world scenarios.
25. What is the difference between DLL and EXE file extensions?
DLL (Dynamic Link Library) |
EXE (Executable File) |
It is a helper file containing reusable code or resources for other programs. |
It is a file that runs a program directly. |
It cannot run on its own. A .exe file or another program calls it. |
It can run on its own when double-clicked or pressed enter. |
It is shared among multiple applications to save memory and code redundancy. |
It is the main file to start a program. |
It is like a tool that a program uses to perform tasks. |
Think of it as the program itself, like a browser or game. |
26. What is the difference between White box and Black box testing?
White Box Testing |
Black Box Testing |
It tests the internal structure and code logic of the software. |
It tests the functionality without knowing the internal code. |
It is done by developers or testers who have coding knowledge. |
It is done by testers or users with no knowledge of coding. |
It looks at how a software is working. |
It looks at what a software is going to perform |
It requires access to the source code(main code) and development tools. |
It does not require access to the source code. |
Checking if a login function takes passwords correctly by reviewing the source code. |
Test by entering valid and invalid passwords to see if the login works as expected. |
27. What is meant by Case Manipulation functions? Explain their different types in SQL.
Case manipulation functions in SQL are used to convert the letters of text data (string data type) from uppercase to lowercase or vice versa, depending on which manipulation function you use.
Following are the types of case manipulation functions in SQL:
- UPPER(): It converts all characters in a string to uppercase.
For example:
SELECT UPPER(‘hello world’);
The output will be HELLO WORLD (all letters are capitalized).
- LOWER(): It converts all characters in a string to lowercase.
For example:
SELECT LOWER(‘HELLO WORLD’);
Here, the output will be hello world (all letters are lowercase).
- INITCAP() (in Oracle Database): It capitalizes the first letter of each word and makes the rest of the letters lowercase.
For example:
SELECT INITCAP(‘hello world’);
28. What to do with missing values (NaN) in Pandas DataFrame?
While performing data cleaning, handling the missing values (Null, NaN) is very important as they can affect the analysis and modelling process.
There are three ways to handle them:
- By dropping the missing values: If we have a large amount of data where the missing values are very few and not critical, we can simply drop those rows.
df_cleaned = df.dropna()
print(df_cleaned)
- By using central tendencies: If there are some missing values in an important column, we can fill them by using central tendencies (mean, median, or mode):
For mean:
df['Age'].fillna(df['Age'].mean(), inplace=True)
For median:
df['Score'].fillna(df['Score'].median(), inplace=True)
For mode (categorical data):
df['Gender'].fillna(df['Gender'].mode()[0], inplace=True)
- By using a constant value: If we have domain knowledge, we can assume the correct data and replace the null value with it.
df['Source'].fillna('Intellipaat', inplace=True)
Infosys HR Interview Questions
1. Tell me about yourself.
Good morning/afternoon, Sir/Madam, Thank you for giving me this opportunity. I am ABC, and I am currently pursuing/recently graduating from ABC College with a specialization in data science. I am currently working on a campus project where my role is to build a model for ABC prediction. Throughout my degree, I actively participated in different coding events like hackathons and participated in the XYZ workshop while maintaining an 8.0 CGPA. I would like to join this internship to gain professional experience and start my career with such a great opportunity.
2. What are your hobbies and interests?
I like to participate in sports. During college, I was a member of the basketball club and represented my college at the state level. I also enjoy playing instruments like the guitar, which helps soothe my mind whenever I feel exhausted.
3. Why do you want to join our company?
As a fresher, it is a great place to start my corporate journey, where I will gain industrial experience and apply whatever I have learned throughout these years. I will work on the areas where I lack and increase the profit while improving my knowledge.
4. Can you work under pressure?
While working on different projects, we tackled situations where our project did not meet expectations. As a team, we managed to come up with better solutions instead of giving up. So, I assume that when I am under pressure, I will try my best to overcome the situation so that we don’t have to work under pressure for a long time.
5. Who is the current CEO of Infosys? What do you know about Infosys?
Salil Parekh is the current managing director and CEO of Infosys.
Infosys is a multinational IT services and consulting company founded in 1981. It is best known for offering services such as application development, cloud computing, and artificial intelligence.