- What is a class in Object-Oriented Programming?
- What is an object? How is it different from a class?
- What is the difference between a class variable and an instance variable?
- How do you create an object in Python?
- What is the
__init__method and why is it used? - Can a class exist without creating an object? Explain with an example.
- What is the difference between a class method and a static method?
- What is the purpose of the
selfkeyword in Python classes? - How do you delete an object in Python?
- What is the difference between object identity and object equality?
- What is inheritance in OOP?
- What are the types of inheritance supported in Python?
- What is the difference between single and multiple inheritance?
- How do you call a parent class constructor in a derived class?
- What is method overriding in inheritance?
- Can a child class access private members of the parent class?
- What is the role of the
super()function in inheritance? - What is hierarchical inheritance? Provide a real-world example.
- What is hybrid inheritance? Is it supported in Python?
- How does Python handle the Diamond Problem in multiple inheritance?
- What is polymorphism in OOP?
- What is the difference between compile-time and runtime polymorphism?
- How is method overloading achieved in Python?
- What is method overriding? Provide an example.
- What is duck typing in Python?
- What is operator overloading? Provide an example.
- Can two methods have the same name with different return types in Python?
- What is the
__str__()method used for in polymorphism? - What is dynamic dispatch in Python?
- What is the difference between polymorphism and inheritance?
- What is encapsulation in OOP?
- How do you achieve encapsulation in Python?
- What is the difference between public, private, and protected members in Python?
- What is abstraction in OOP?
- How do you achieve abstraction in Python?
- What is the difference between encapsulation and abstraction?
- Can abstraction be achieved without encapsulation?
- Why do we use name mangling (e.g.,
__var) in Python? - What are getter and setter methods?
- What is the use of the
@propertydecorator in Python?
- What is a constructor in OOP?
- What is the difference between default and parameterized constructors?
- How many constructors can a class have in Python?
- What is a destructor in Python and when is it called?
- What happens if you explicitly delete an object in Python?
- What is an abstract class? How do you define one in Python?
- What is an interface? Does Python support interfaces?
- What are the SOLID principles in Object-Oriented Design?
- What is dependency injection in OOP?
- What is multiple dispatch and how is it implemented in Python?