Object oriented programming interview questions

Ask a question
          

Object oriented programming interview questions


Part 1   Part 2   Part 3   Part 4   Part 5
Download Oops interview questions and answers

Oops interview questions - posted on June 27, 2013 at 16:05 PM by Kshipra Singh

1. What are the basic concepts of OOP?

The four basic concepts of OOP are:
a.) Abstraction
b.) Polymorphism
c.) Inheritance
d.) Encapsulation

2. What is dynamic or run time polymorphism?

- It is also referred to as method overriding. Here, there can be two methods with same name and signature but different implementation.
- The function here is resolved during run time rather than compile time.

3. What is Encapsulation?

- It is a technique to hide the properties and behaviours of an object.
- The access is provided only as required.
- It prevents other objects from altering or accessing the properties of an encapsulated object.

4. Differentiate between abstraction and encapsulation.

- Abstraction is design oriented while abstraction is implementation oriented.

- The focus of abstraction is on the interface i.e. the outside view of the object while encapsulation prevents other objects or methods from looking into the properties and behaviour of that object.

5. What is Inheritance?

- It is the process which allows the objects of one class to acquire the properties of objects of another class.
- The class that inherits is called sub-class while the class from which the object is inherited is called superclass.
- Inheritance helps in re-using the code and polymorphism.

6. Explain method overriding.

- When a subclass declares a method possessing similar arguments as a method declared by one of its superclass, method overriding takes place.
- Using this technique, the behaviour specific to a particular subclass can be defined.
- The methods marked public, final or static can not be overridden

7. Can you give some examples of tokens?

Some of the examples of tokens are:

- Keywords,
- Identifiers,
- Constants,
- Operators,
- Brackets,
- Commas.

8. What is friend function?

- Friend function is a friend of a class.
- It is allowed to access Public, private or protected data of that class.
- It can be declared anywhere in the class declaration
- It doesn’t have any effect of access control keywords like private, public or protected.

9. Define Modularity?

- It is the property of big a system divided into small modules which can be integrated as per the requirement.

10. Explain: a.) Persistence. b.) Colloboration

a.) Persistence.
- It is the property of an object which extends its existence into space and time.

b.) Colloboration
- Process by which several objects co-operate to deliver a higher level result.

11. What is a ternary operator?

- It is also called as a conditional operator.
- It is an operator that can take three arguments.
- The data types of arguments and results are different.

12. What are sealed modifiers?

- Access modifiers which cannot be inherited by other methods.
- They can be applied to properties, events and methods but not to static members.

13. Explain: a.) Static binding b.) Dynamic binding

a.) Static binding-
It is a binding in which the name of the class can be associated with it during compilation. Also referred to as early binding.

b.) Dynamic binding –
It is a binding in which the name of the class can be associated with it during execution time. Also referred to as late binding.

14. What are the different ways for a method to be overloaded?

A method can be overloaded by:
- Varying the numbers of parameters
- Using different data types for the parameters
- Using different sequence of the parameters.

What is OOP? 

The object oriented programming is commonly known as OOP. Most of the languages are developed using OOP concept. Object-oriented programming (OOP) is a programming concept that uses "objects" to develop a system................... 
Read answer

OOAD interview test (50 questions)
Oops interview test (20 questions)

What are the various elements of OOP?

Various elements of OOP are: Object, Class , Method
Class – A class is a collection of data and operations on data. Data and operations / functions / methods are placed together in a single unit, i.e., class. This feature is known as encapsulation................
Read answer

What are the characteristics of Object Oriented programming language?

Some key features of the Object Oriented programming are: Emphasis on data rather than procedure, Programs are divided into entities known as objects, Data Structures are designed such that they characterize objects...............
Read answer

What are the basic Concepts used in the Object-Oriented Programming language?

Object, Class, Data Abstraction and Encapsulation, Polymorphism.................. 
Read answer

Explain an object, class and Method.

An object is an entity that keeps together state and behaviors. For instance, a car encapsulates state such as red color, 900 cc etc and behaviors as 'Start', 'Stop' etc., so does an object.................
Read answer

Define Encapsulation and Information Hiding in OOP.

Encapsulation means keeping actions and attributes together under a single unit. This can also be understood using a motor bike example.............
Read answer

Explain Inheritance and Polymorphism in OOP.

Polymorphism means the ability to take more than one form. An operation may exhibit different behaviors in different instances..............
Read answer

What are the advantages of OOP?

It presents a simple, clear and easy to maintain structure. It enhances program modularity since each object exists independently...................
Read answer

Oops - Jan 12, 2009 at 21:14 PM by Vidya Sagar

What is composition? Explain the purpose of composition.

Assembling existing components instead of creating new ones is called composition. In OOP it is called as objects composition. It is the process of placing object in another object. It is the model of has-a relationship. An employee object can contain an object of type project which is another object.

Purpose of composition:
A model by value aggregation can be derived by using composition which is semantically equivalent to an attribute.

The lifetime is coincident part as a whole for both objects

If one part is removed, the whole part also removed with out explicit removal of individual parts

Composition can be used to model by-value aggregation which is semantically equivalent to an attribute.

What is an abstraction and why is it important?

Representing essential features by hiding the background process / details. In other words, it is specifying what to do but not how to do.

Abstraction is important at the conceptual level of an application. It helps in understanding clearly, what the process and the flow of an application. The abstraction allows the complete flow and development of an application into a structured action. The conceptual level of project execution is derived from abstraction which the gateway for the entire application development. 

Test your Skills!

C++ (20 questions)
.NET Framework (26 questions)
Database concepts (20 questions)
HTML (19 questions)

Related Link

Learn JavaScript's OOP features
Aspect-Oriented Programming

Explain the concepts and capabilities of Aspect-Oriented Programming, AOP.
What is Aspect in AOP?
AOP approach addresses Crosscutting concerns. Explain
The components of AOP are advices/interceptors, introductions, metadata, and pointcuts. Explain them
AOP vs OOPs...........

Business Process Execution Language (BPEL)

What is Business Process Execution Language (BPEL)?
BPEL vs. workflow foundation
Role of BPEL
Explain about BPEL Orchestration and Choreography................

AOP concurrency

Concurrency is the system's ability to act with several requests simultaneously, such a way that threads don't corrupt the state of objects when they gain access at the same time.........

Transparent caching with AOP

To get better results in terms of speed and resources used, it's suggested to use a cache. We can store in it the results corresponding to the methods' invocations as key-value pairs: method and arguments as key and return object as value................

Security with AOP

Once a user is authenticated and has roles, he or she can work on the application and perform the actions permitted by an access control list, which according to the user's roles allows certain operations................



Write your comment - Share Knowledge and Experience

Discussion Board
OOP Interview Questions

Visit the following link to learn some commonly asked Interview Questions for the job or vacancy of Software Engineer or Software/Web/Desktop Application Developer. It also includes OOP, C#, ASP.NET, ADO.NET and SQL Interview Questions.

http://sohaiby.blogspot.com/2013/09/software-engineerdeveloper-interview.html

sohaib 10-12-2013 05:26 PM

.net

what is oops in .net and pyiur defination plzzzz...

dinkal patel 04-17-2012 12:40 PM

.net

what is oops in .net and pyiur defination plzzzz...

dinkal patel 04-17-2012 12:40 PM

.net

what is oops in .net and pyiur defination plzzzz...

dinkal patel 04-17-2012 12:40 PM

.net

what is oops in .net and pyiur defination plzzzz...

dinkal patel 04-17-2012 12:40 PM

 

 
Home | Login | About us | Sitemap | Contact us