Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 3 subjective questions OOP concepts

ECAP776 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define object-oriented programming. Explain its major features in the context of Python.

  2. Question 2 of 20

    Distinguish between a class and an object with a suitable Python example.

  3. Question 3 of 20

    Explain the purpose of the __init__() method and the self parameter in Python classes.

  4. Question 4 of 20

    Describe instance attributes, class attributes, instance methods, class methods, and static methods.

  5. Question 5 of 20

    Define encapsulation and explain why it is important in object-oriented programming.

  6. Question 6 of 20

    Explain public, protected, and private members in Python. How does Python's approach differ from strict access control?

  7. Question 7 of 20

    What is name mangling in Python? Describe its purpose, behavior, and limitations.

  8. Question 8 of 20

    Explain how properties support encapsulation in Python. Illustrate your answer with validation of an attribute.

  9. Question 9 of 20

    Compare direct attribute access, getter and setter methods, and the property mechanism in Python.

  10. Question 10 of 20

    Design an encapsulated BankAccount class that validates deposits and withdrawals. Explain how the class preserves its invariants.

  11. Question 11 of 20

    Define inheritance and explain its advantages and possible disadvantages.

  12. Question 12 of 20

    Describe single, multilevel, hierarchical, multiple, and hybrid inheritance with Python-oriented examples.

  13. Question 13 of 20

    Explain method overriding in Python and show how it enables runtime polymorphism.

  14. Question 14 of 20

    What is the purpose of super() in Python inheritance? Explain its use in constructors and overridden methods.

  15. Question 15 of 20

    Explain method resolution order in Python. How does it resolve ambiguity in multiple inheritance?

  16. Question 16 of 20

    Describe the diamond problem in multiple inheritance and explain how Python handles it.

  17. Question 17 of 20

    Distinguish between method overriding and method overloading. How is overloading commonly simulated in Python?

  18. Question 18 of 20

    Compare inheritance and composition. State when each technique should be preferred.

  19. Question 19 of 20

    Explain how encapsulation and inheritance interact. What risks arise when a subclass accesses a parent's internal state directly?

  20. Question 20 of 20

    Develop a Python class hierarchy for employees that demonstrates inheritance, encapsulation, overriding, and polymorphism. Explain the design.

That's unit 3

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.