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

Can you instantiate an abstract class?

View

What is the primary reason for using abstract classes?

View

What happens if a subclass doesn’t override all abstract methods?

View

Which module in Python provides support for abstract classes?

View

Which decorator is used to mark a method as abstract?

View

Can a concrete class inherit from an abstract class?

View

What is the result of creating an abstract class with no methods?

View

Can abstract classes have constructors?

View

Can you use super() with abstract classes?

View

What is the main difference between abstract classes and interfaces?

View

Can you instantiate an abstract class?

Yes
No
Only with the super() function
Only in Python 2.x

What is the primary reason for using abstract classes?

To prevent inheritance
To provide a template for other classes
To force static methods
To improve code performance

What happens if a subclass doesn’t override all abstract methods?

The subclass becomes abstract
The program continues without error
The method is marked private
Python raises a TypeError

Which module in Python provides support for abstract classes?

abc
os
sys
collections

Which decorator is used to mark a method as abstract?

@abstract
@staticmethod
@classmethod
@abstractmethod

Can a concrete class inherit from an abstract class?

No
Yes, but it must implement all abstract methods
Only if it’s a singleton
Only for static methods

What is the result of creating an abstract class with no methods?

It will raise an error
The class acts as a blueprint
It becomes a private class
It turns into an instance class

Can abstract classes have constructors?

No
Yes, but they can’t be called
Yes, and they can initialize data
Only with the abstract keyword

Can you use super() with abstract classes?

Yes
No
Only with polymorphism
Only in child classes

What is the main difference between abstract classes and interfaces?

Abstract classes cannot have attributes
Interfaces only contain static methods
Abstract classes can have concrete methods, while interfaces cannot
There is no difference