0% found this document useful (0 votes)
219 views

Commonly Asked OOP Interview Questions - Set 1

Object oriented programming (OOP) is a paradigm where software operates as objects that communicate with each other. The main advantages of OOP are more manageable code through encapsulation, which makes code easier to maintain by allowing changes to underlying representations while keeping methods the same. The main features of OOP are encapsulation, polymorphism, and inheritance. Polymorphism allows code to behave differently in different contexts through features like function overloading and virtual functions. Inheritance allows a class to reuse data and implementation from another class. Abstraction involves modeling a problem to separate necessary from unnecessary details.

Uploaded by

Krishanu Modak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
219 views

Commonly Asked OOP Interview Questions - Set 1

Object oriented programming (OOP) is a paradigm where software operates as objects that communicate with each other. The main advantages of OOP are more manageable code through encapsulation, which makes code easier to maintain by allowing changes to underlying representations while keeping methods the same. The main features of OOP are encapsulation, polymorphism, and inheritance. Polymorphism allows code to behave differently in different contexts through features like function overloading and virtual functions. Inheritance allows a class to reuse data and implementation from another class. Abstraction involves modeling a problem to separate necessary from unnecessary details.

Uploaded by

Krishanu Modak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Commonly Asked OOP Interview Questions | Set 1

What is Object Oriented Programming?


Object Oriented Programming (OOP) is a programming paradigm where the complete software operates as a bunch of objects talking to each
other. An object is a collection of data and methods that operate on its data.

Why OOP?
The main advantage of OOP is better manageable code that covers following.

1) The overall understanding of the software is increased as the distance between the language spoken by developers and that spoken by
users.

2) Object orientation eases maintenance by the use of encapsulation.   One can easily change the underlying representation by keeping the
methods same.

OOP paradigm is mainly useful for relatively big software.


What are main features of OOP?
Encapsulation
Polymorphism
Inheritance

What is encapsulation?
Encapsulation is referred to one of the following two notions.
1) Data hiding: A language feature to restrict access to members of an object. For example, private and protected members in C++.
2) Bundling of data and methods together: Data and methods that operate on that data are bundled together.

What is Polymorphism? How is it supported by C++?


Polymorphism means that some code or operations or objects behave differently in different contexts. In C++,  following features support
polymorphism.

Compile Time Polymorphism: Compile time polymorphism means compiler knows which function should be called when a polymorphic call is
made.  C++ supports compiler time polymorphism by supporting features like templates, function overloading and default arguments.

Run Time Polymorphism: Run time polymorphism is supported by virtual functions. The idea is, virtual functions are called according to the
type of object pointed or referred, not according to the type of pointer or reference. In other words, virtual functions are resolved late, at
runtime.

What is Inheritance? What is the purpose?


The idea of inheritance is simple, a class is based on another class and uses data and implementation of the other class.
The purpose of inheritance is Code Reuse.

What is Abstraction?
The rst thing with which one is confronted when writing programs is the problem. Typically we are confronted with “real-life” problems and we
want to make life easier by providing a program for the problem. However, real-life problems are nebulous and the rst thing we have to do is to
try to understand the problem to separate necessary from unnecessary details: We try to obtain our own abstract view, or model, of the
problem. This process of modeling is called abstraction.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy