Skip to content
CY-305 · Object Oriented Programming & Methodology/Unsolved PYQ Paper

CY-305 Object Oriented Programming and Methodology - Dec 2024 Question Paper

Under each question, How to answer lists the points an answer should cover, outlined by CampusPrep from the syllabus. Check the details against your textbook.

  1. 7 Marks
    aHow does Object-Oriented Programming (OOP) differ from procedural programming, and what are the key features of the object-oriented paradigm?
    How to answer
    • Define procedural programming and object-oriented programming
    • Tabular comparison based on structure, data hiding, code reuse, and control flow
    • List and briefly explain core features of OOP: Classes/Objects, Encapsulation, Abstraction, Inheritance, Polymorphism
  2. 7 Marks
    bDiscuss the merits and demerits of using object-oriented methodology in software development, compared to other programming paradigms.
    How to answer
    • Merits of OOP: reusability, maintenance, security/data hiding, modularity, real-world modeling
    • Demerits of OOP: steep learning curve, higher memory/execution overhead, unnecessary complexity for simple tasks
    • Summary of trade-offs in software development
  3. 7 Marks
    aDescribe the concept of exception handling in object-oriented programming, including the mechanisms used to handle runtime errors and exceptions gracefully.
    How to answer
    • Definition of exception and runtime errors vs compile-time errors
    • Role of graceful degradation and fault tolerance
    • Key mechanisms/keywords: try, catch, throw, throws, finally
    • Flow of control during exception propagation
  4. 7 Marks
    bDescribe the process of Input/Output (I/O) processing in object-oriented programming, including the handling of data types, type conversion and control statements.
    How to answer
    • Concepts of streams in OOP (cin/cout in C++ or System.in/System.out in Java)
    • Handling basic and user-defined data types in I/O
    • Implicit vs explicit type conversion (type casting)
    • Role of control statements in coordinating I/O flow
  5. 7 Marks
    aDiscuss the concepts of encapsulation and data abstraction in object-oriented programming and explain how they enable modular and reusable code design.
    How to answer
    • Define Encapsulation (binding data and methods, data hiding)
    • Define Data Abstraction (exposing essential features, hiding background details)
    • Differentiate encapsulation and abstraction
    • Explain how they promote modular architecture and reusability
  6. 7 Marks
    bExplain the concept of objects in object-oriented programming, including their state, behavior and identity and how they are represented in code.
    How to answer
    • Definition of an Object as an instance of a class
    • State (attributes/data fields)
    • Behavior (methods/functions)
    • Identity (unique reference/address in memory)
    • Code illustration showing state and behavior implementation
  7. 7 Marks
    aDiscuss attributes and services in the context of object-oriented programming, including the role of access modifier and static members in defining class behavior.
    How to answer
    • Define attributes (variables) and services (functions/methods)
    • Role of access modifiers (private, protected, public) in encapsulation
    • Role of static variables and static methods (class-level vs instance-level)
    • How these together define class structure and behavior
  8. 7 Marks
    bExplain the concept of instances in object-oriented programming and how they represent individual objects created from a class template?
    How to answer
    • Definition of class as a blueprint/template and instance as realization
    • The instantiation process (memory allocation via new/declaration)
    • Multiple instances sharing code but maintaining unique data/state
    • Code snippet showing class declaration and multiple object instantiation
  9. 7 Marks
    aDescribe the process of message passing in object-oriented programming and its role in enabling communication between objects.
    How to answer
    • Definition of message passing in OOP
    • Components of a message: object identifier, method name, and arguments
    • Mechanism of dynamic binding during message reception
    • Importance in decoupled and modular design
    • Diagram or syntax example showing sender invoking receiver method
  10. 7 Marks
    bDiscuss the construction and destruction of objects in object-oriented programming, including the use of constructors and destructors to manage object lifecycle.
    How to answer
    • Definition and purpose of constructors (default, parameterized, copy)
    • Initialization of state during creation
    • Definition and purpose of destructors (cleanup, freeing allocated resources)
    • Order of invocation of constructors and destructors (e.g., in inheritance)
  11. 7 Marks
    aDiscuss association and aggregation as relationship types in object-oriented programming and provide examples of each.
    How to answer
    • Define Association (general 'has-a' connection between classes)
    • Define Aggregation (weak form of association, 'part-of' relationship with independent lifecycles)
    • Differences between association, aggregation, and composition
    • Real-world code or UML examples for each
  12. 7 Marks
    bDescribe the concept of interfaces and abstract classes in object-oriented programming, including their role in defining common behavior and enforcing contracts.
    How to answer
    • Define Abstract Classes and abstract/pure virtual methods
    • Define Interfaces as strict contracts
    • Key differences between abstract classes and interfaces
    • Role in decoupling and enabling polymorphism
  13. 7 Marks
    aDiscuss virtual functions, friend functions and static functions in object-oriented programming, including their usage and implications for class design.
    How to answer
    • Virtual Functions: runtime polymorphism, vtable/vptr mechanism
    • Friend Functions: access to private/protected members, trade-offs with encapsulation
    • Static Functions: invocation without object instance, access restricted to static members
    • Implications and guidelines in software/class design
  14. 7 Marks
    bExplain how strings are handled in object-oriented programming, including common operations and best practices for string manipulation.
    How to answer
    • String as an object/class vs character arrays
    • Common operations: concatenation, comparison, substring, search, length
    • Memory management and immutability (e.g. String vs StringBuilder in Java, std::string in C++)
    • Best practices for performance and avoiding memory leaks
  15. 14 Marks
    Introduce the concepts of multi-threading and data collections in object-oriented programming and discuss their applications in building concurrent and data-intensive systems. Additionally, provide a case study, such as an ATM or library management system, to illustrate the practical application of object-oriented thinking and programming principles.
    How to answer
    • Concept of multi-threading and concurrency management (synchronization, thread safety)
    • Data collections (lists, sets, maps) in data-intensive software
    • Case study introduction (ATM or Library Management System)
    • Identification of classes, attributes, methods, and their relationships (inheritance, association)
    • Explanation of how OOP principles (encapsulation, polymorphism) solve the system design problem
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in