0% found this document useful (0 votes)
13 views2 pages

Python OOP Interview Questions for Wipro

This document contains a list of technical interview questions related to Python and Object-Oriented Programming (OOP) for Wipro WILP BDR candidates. Key topics include constructors, destructors, encapsulation, inheritance, polymorphism, abstraction, and the use of the self keyword. It also provides differences between various methods and concepts in Python, along with tips for interview preparation.

Uploaded by

tusharkaushik468
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)
13 views2 pages

Python OOP Interview Questions for Wipro

This document contains a list of technical interview questions related to Python and Object-Oriented Programming (OOP) for Wipro WILP BDR candidates. Key topics include constructors, destructors, encapsulation, inheritance, polymorphism, abstraction, and the use of the self keyword. It also provides differences between various methods and concepts in Python, along with tips for interview preparation.

Uploaded by

tusharkaushik468
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

Python + OOPs Technical Interview Questions (Wipro WILP BDR)

1️⃣ What is a Constructor in Python?

• A constructor is a special method ( __init__ ) in a class that gets called automatically when we
create an object of that class to initialize the object's properties.

2️⃣ What is a Destructor in Python?

• A destructor ( __del__ ) is a special method in a class that gets called automatically when the object
is about to be destroyed, used for cleanup.

3️⃣ What are functions in Python and why are they used?

• Functions are reusable blocks of code that perform a specific task. They help increase code
reusability and readability.

4️⃣ Explain Encapsulation with a real-world example.

• Encapsulation means binding data and methods into a single unit (class) and restricting direct access
to data. Example: ATM machine hides internal logic; users can only interact through a limited
interface.

5️⃣ Explain Inheritance with a real-world example.

• Inheritance allows a class to acquire properties and methods of another class. Example: A child
inherits properties from parents.

6️⃣ Explain Polymorphism in Python.

• Polymorphism allows the same method name to perform different tasks based on the object calling
it.

7️⃣ What is Abstraction?

• Abstraction hides complex implementation details and shows only necessary features to the user.

8️⃣ Difference between a class and an object.

• Class: Blueprint for creating objects.


• Object: Instance of a class.

9️⃣ What is the use of the self keyword in Python classes?

• self represents the instance of the class and is used to access its variables and methods.

1
10️⃣ What is the difference between __init__ and a normal method in a class?

• __init__ is a constructor called automatically when an object is created, while normal methods
need to be called explicitly.

11️⃣ What is Method Overriding?

• When a child class defines a method with the same name as a method in the parent class, it
overrides the parent’s method.

12️⃣ What is the use of the super() function?

• super() is used to call methods of the parent class within a child class.

13️⃣ Difference between append() and extend() in lists.

• append() adds a single element to the end of the list.


• extend() adds each element of an iterable to the list.

14️⃣ What is a module, and why do we use it?

• A module is a Python file containing code that can be imported and reused in other programs to
organize and reuse code efficiently.

15️⃣ What is the purpose of indentation in Python?

• Indentation is used to define blocks of code in Python, replacing the use of {} as in other
languages.

✅ Tip: Practice explaining each with a 1–2 line example for clear delivery during your interview.

You might also like