Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is multiple inheritance?

View

What is multilevel inheritance?

View

Which of the following is true about multiple inheritance?

View

How is the Diamond Problem handled in Python?

View

What will the following code print?

View

What is the use of the mro() method?

View

Which of the following describes hybrid inheritance?

View

What will C.mro() return in this code?

View

Can a derived class in multilevel inheritance call the base class directly?

View

Which is an example of hybrid inheritance?

View

What is multiple inheritance?

A class inheriting from one class
A class inheriting from two or more classes
A method that calls multiple classes
A constructor creating multiple objects

What is multilevel inheritance?

A class inheriting from multiple parent classes
A class derived from another derived class
Using inheritance without constructors
Using encapsulation within inheritance

Which of the following is true about multiple inheritance?

It is not supported in Python
It requires an interface
It can lead to the Diamond Problem
It does not involve parent-child relationships

How is the Diamond Problem handled in Python?

By restricting multiple inheritance
Using super() and the MRO (Method Resolution Order)
By using abstract classes only
Through staticmethod

What will the following code print?

class A: def show(self): print("Class A") class B(A): pass class C(B): pass obj = C() obj.show()

Class A
Class B
Class C
Error

What is the use of the mro() method?

To get a class's private methods
To determine the method resolution order
To create multiple constructors
To overload operators

Which of the following describes hybrid inheritance?

Combination of multiple and multilevel inheritance
Using only private classes
Restricting access to subclasses
Using single inheritance twice

What will C.mro() return in this code?

class A: pass class B(A): pass class C(B): pass

[A, B, C]
[C, B, A, object]
[C, A, B, object]
[B, A, object]

Can a derived class in multilevel inheritance call the base class directly?

Yes, using super()
No, it can only call its immediate parent
Only with interfaces
It depends on method visibility

Which is an example of hybrid inheritance?

Class A → Class B → Class C
Class A → (Class B, Class C)
Class A → Class B; Class C → Class D
A combination of a and b