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 6 subjective questions Exception Handling, Templates and Standard Template Library

CSE202 — Object Oriented Programming 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define an exception in C++. Why is exception handling preferred over traditional error-handling techniques?

  2. Question 2 of 20

    Explain the exception-handling mechanism in C++ using try, throw, and catch.

  3. Question 3 of 20

    Describe the throwing mechanism in C++. What types of values can be thrown, and what happens after a throw expression is executed?

  4. Question 4 of 20

    Explain the catching mechanism in C++. Discuss handler matching, handler order, and the catch-all handler.

  5. Question 5 of 20

    What is stack unwinding during exception handling? Explain its role in resource management.

  6. Question 6 of 20

    What is rethrowing an exception? Explain how it is performed and identify situations in which it is useful.

  7. Question 7 of 20

    Design a C++ program that uses a user-defined exception class to validate a bank withdrawal. Explain the flow of exception handling.

  8. Question 8 of 20

    Define a function template. Explain its syntax, instantiation, and advantages with a suitable example.

  9. Question 9 of 20

    Explain function-template argument deduction and specialization. How are templates related to overloaded functions?

  10. Question 10 of 20

    Define a class template and develop a generic Pair class that can store and display two values of potentially different types.

  11. Question 11 of 20

    Distinguish between function templates and class templates.

  12. Question 12 of 20

    Explain class templates with inheritance. Illustrate how a template class can derive from another template class.

  13. Question 13 of 20

    What is the Standard Template Library? Explain the relationship among STL containers, algorithms, and iterators.

  14. Question 14 of 20

    Classify the main categories of STL containers and give suitable examples of each.

  15. Question 15 of 20

    Define an iterator. Describe the major iterator categories and the operations supported by them.

  16. Question 16 of 20

    Explain how STL algorithms operate on iterator ranges. Demonstrate sorting, searching, and counting with a vector.

  17. Question 17 of 20

    Describe the vector container. Discuss its storage, important member functions, complexity, and iterator invalidation rules.

  18. Question 18 of 20

    Write and explain a C++ program that performs insertion, deletion, traversal, and sorting on a vector.

  19. Question 19 of 20

    Describe the list container. Explain its structure, major operations, complexity, and limitations.

  20. Question 20 of 20

    Compare vector and list. Recommend an appropriate container for different usage scenarios and justify your choices.

That's unit 6

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.