Interview questions for Infosys

Infosys will ask Coding questions of equal difficulty from both CS-IT and non CS-IT branches.
You’re applying for an IT company they want coders. According to them even if they allow non CS-IT people to sit for placement process, they will only select them if they proper coding, irrespective of the branch they are in.
Topics from which they might ask questions from are as follows:-
• C/OOPS/ C++ or Java (all branches)
• Coding Questions (all branches)
• OS/CN/Software Engineering/DBMS (CS/IT branches)
• Project specific theory from Resume(all Branches)
On this dashboard you will find the most asked coding questions asked in Infosys.

1. What is an Object in OOPs?

Objects are runtime entities that have certain properties.
Take, for illustration, a bouquet of Lillies, Roses, and Tulips. Every flower has its unique qualities, such as various shapes, colours, and scents. This is just a collection of objects.

2. What is a Class in OOPS?

A class is a type of object that governs how it will act and what it will include. In other terms, it’s a blueprint or set of instructions for constructing a specific thing.
Let’s use the same example as before: a bouquet. The class is a bouquet, and the objects are the various varieties of flowers that make up the bouquet. As a result, we can define objects as instances of a class.

3. What are the basic OOPs principles?

The idea of real-world entities as objects is central to object-oriented programming. It binds data to the functions that operate on it, preventing any other section of the code from accessing the data except that function.
OOPs are based on four major principles:
• Data encapsulation: This is when data and methods are combined into a single unit called a class. Data encapsulation supports the camouflage and or coverup of data or info from the outside world or entity.
• Data abstraction: Data abstraction is the representation of important properties without their background details.
• Inheritance: Inheritance is the process of transferring existing class properties to a new class. The existing class (parent class) is referred to as the base class, while the new derived class is referred to as the subclass (child class). It is beneficial to code reusability.
• Polymorphism: Polymorphism states to an object’s ability to take on several forms. Method overloading is used to provide compile-time polymorphism in Java, whereas method overriding is used to accomplish run-time polymorphism.

4. Can we implement multiple inheritances in Java?

Multiple inheritances are not explicitly supported by Java. With the use of an interface, we may achieve multiple inheritances. Multiple interfaces can be incorporated into our programme.

5. How method overloading is different from method overriding?

Method overloading occurs when two methods have the same name but differ in the number of parameters or the type of arguments they accept. Compile-time polymorphism is what it’s called because it happens during the compilation process.
Method overriding refers to the ability to construct subclass and super-class methods with the same name and signatures, with the subclass method taking precedence over the super-class method. Run-time polymorphism is a type of polymorphism that occurs during the execution of a programme.

6. What is SDLC?

Software Development Life Cycle (SDLC) is an end to end process that defines the flow of the development of a project from requirements stage to the maintenance and support stage. The stages in SDLC are requirements analysis, planning, definition, design, development, testing, deployment, and support (maintenance).

7. What are different SDLC Methodologies?

 Do you know what is waterfall model? (experienced candidates)
Answer: Just like waterfalls from top to bottom, this approach follows breaking down of project activities into different phases. Once a stage is completed, the next stage in the sequence is followed. Each stage is dependent on the result of the previous stage.

8. Which is the most popular SDLC model? 

One of them is the waterfall model. The other is AGILE which is gaining more popularity now because of its continuous iteration methodology that is less prone to errors during production environment.

9. Explain some important differences between C & C++.

Answer: For the interview, you will be checked only for your basic knowledge and key differences like –
C C++
C is a procedural language, hence there is no concept of classes, objects, inheritance, encapsulation, and polymorphism. C++ is an Object-Oriented language. Polymorphism, encapsulation and inheritance are the essences of OOPS.
Dynamic memory allocation is done through malloc() and calloc() functions Memory allocation is done using the ‘new’ operator.
Main function can be called from any other functions. Main function cannot be called from any other functions.
No operator and function overloading It is easy to implement function overloading and operator overloading in C++
You cannot run C++ code in C You can run most of the C code in C++
For input and output scanf and printf functions are used respectively. Cin and cout are respectively used for input and output.
Reference variables, virtual and friend functions are not supported These are supported fully
Exception handling is not supported Full support for exception handling
For your own curiosity, you can read this article to learn in-depth about the differences.

10. What are the differences between C++ and Java? Which one do you think is better and why?

Both are based on OOPS concept. Following are the basic differences –
Platform dependent language You can write the code and run it anywhere. Java is platform-independent.
Used for system programming, for example OSs are written in C++. Used for application programming, like mobile and web-based applications.
Supports both pass by value and pass by reference Can pass variables only by the value
Developers can explicitly write code for pointers. Java uses pointers internally. Developers can’t write programs i.e. there is restricted support for pointers
Supports operator overloading No support for operator overloading
Supports multiple inheritances Doesn’t support multiple inheritances. (can be achieved through an interface)

11. When asked your opinion on which is better, there is no right or wrong

You can say what you like about C++ or Java more. For example, I don’t like pointers and Java doesn’t have it, so I can vote for Java. On the other hand, C++ supports operator overloading and passing by reference while Java doesn’t, so I can like C++ more because of this flexibility. This question is just to test if you can analyze and weigh the pros and cons of each.

leave your comment

Your email address will not be published. Required fields are marked *