Oops Question Bank (Cs 2203)
Oops Question Bank (Cs 2203)
Oops Question Bank (Cs 2203)
UNIT-I
Object Oriented Concepts
PART-A (2 MARKS)
PART-A (2MARKS)
1) Define constructor.
2) Define default constructor.
3) Define parameterized constructor.
4) Define default argument constructor.
5) What is the ambiguity between default constructor and default
argument constructor?
6) Define copy constructor.
7) Define dynamic constructor.
8) Define const object.
9) Define destructor.
10) Define multiple constructors.
11) Write some special characteristics of constructor.
12) How the objects are initialized dynamically?
13) What is operator overloading in C++?
14) Define default constructor.
15) Is it possible to overload a constructor? How.
16) Difference between Overriding vs. overloading.
17) List out the operators that cannot be overloaded.
18) What is the purpose of using operator function? Write its
syntax.
19) Write at least four rules for Operator overloading.
20) How will you overload Unary & Binary operator using member
functions?
21) How will you overload Unary and Binary operator using Friend
functions?
22) How an overloaded operator can be invoked using member
functions?
23) How an overloaded operator can be invoked using Friend
functions?
24) List out the operators that cannot be overloaded using Friend
function.
25) What is operator overloading?
26) What is meant by casting operator and write the general form of
overloaded casting operator?
27) What is overloaded function selection algorithm?
28) What is meant by pointer operators?
25)
UNIT-III
CLASS TEMPLATES AND EXCEPTION HANDLING
PART-A (2MARKS)
1) What is a template?
2) What is R T T I ?
3) What are generic functions and generic classes?
4) What is namespace?
5) What is the need for template functions in c++? What are their
advantages?
6) Give few examples of multi-argument templates.
7) What is the difference between typename and class?
8) What is instantiation? Explain.
9) What is the difference between generic and non-generic (type and
non-type) arguments to function templates?
10) What is template function and template class?
11) What are the advantages of template argument deduction?
When is it not possible for the compiler to deduce the argument
type?
12) Give an example explaining the need for overloading a
template with another template.
13) Discuss the efficiency and flexibility issues with templates.
14) What is the difference between manually overloaded
functions and template instantiation?
15) Give an example where using the default arguments are
useful in class template.
16) How does the behavior of the static data members of a class
template differ from the behavior of static data members of a
normal class?
17) What is the need for partial specialization?
18) What is the difference between explicit specialization and
partial specialization?
19) Explain two models of template compilation? Compare.
20) What are the different mechanisms of traditional error
handling? What is the problem with them?
21) What is the object destroy problem? How can exception
handling help here?
22) What is the role of terminate() function in exception handling?
Why doesn’t the exception handling mechanism not call abort()
directly?
23) What is the difference between throwing exceptions inside
the function and outside the function?
24) When do we need multiple catch blocks for a single try block?
Give an example.
25) What are exception specifications? In which case are they
needed?
26) What is rethrow()? What is its use?
27) What is unexpected() function? Give an example to explain
the need of it.
28) What is uncaught_exception() function and why do we need
it? What is the need of it?
29) What are the disadvantages of the exception handling
mechanism?
30) What is the importance of catch all?
Part B:
1) What is the need of Templates? Explain.
2) Explain about function templates?
3) Implement selection sort as a generic function.
4) Implement quick sort as a generic function.
5) Write a program for generic queue class with two member functions,
insert and delete. Use the array to implement the queue.
6) Define a stack. The class should throw an exception when the stack
underflow and overflow takes place.
7) using the Time class, throw an exception when invalid time is input,
write set_terminate to provide your own terminate function, which care of
this problem.
8) What is uncaught exception function? Give an example.
9) What are the use of terminate() and Unexpected functions? Explain
with a program.
10) How to use multiple catch functions inside a program? Explain with a
program.
11) Write all blocks of exception handling? Explain with a program.
Unit 4
INHERITANCE and Polymorphism
PART-A (2MARKS)
1) Define basic to class type conversion with an example.
2) Define class to basic type conversion with an example.
3) Define one class to another class conversion with an example.
4) What is meant by inheritance?
5) What is meant by single inheritance?
6) What is multiple inheritances?
7) What is hierarchical inheritance?
8) What is multilevel inheritance?
9) What is hybrid inheritance?
10) What is meant by Abstract base class?
11) Write short notes on virtual base class.
12) What are Friend functions? Write the syntax
13) Write some properties of friend functions.
14) What are the virtual functions?
15) Write some of the basic rules for virtual functions
16) What are pure virtual functions? Write the syntax.
17) What is an Exception?
18) Give any rules for Virtual Functions.
19) What is Visibility mode?
20) What is public, protected, private?
21) What are virtual functions?
22) What is friend function?
23) What do you mean by inheritance?
24) What is abstraction?
25) What is polymorphism? Explain with an example.
26) What do you mean by binding of data and functions?
27) What is virtual class and friend class?
28) What do you mean by inline function?
29) What do you mean by public, private, protected and friendly?
30) When is an object created and what is its lifetime?
31) What do you mean by multiple inheritance and multilevel
inheritance? Differentiate between them.
32) Difference between realloc() and free?
33) What are the main differences between procedure oriented
languages and object oriented languages?
34) Why do we use virtual functions?
35) What do you mean by pure virtual functions?
36) What are virtual classes?
37) Does c++ support multilevel and multiple inheritance?
38) What are the advantages of inheritance?
39) When is a memory allocated to a class?
40) What is the difference between declaration and definition?
41) In c++ there is only virtual destructors, no constructors.
Why?
42) What is late bound function call and early bound function
call? Differentiate.
43) What is Dynamic Polymorphism?
44) Write a macro for swapping integers.
45) Why do we need RTTI? Suggest some cases where we need to use RTTI.
46) What are polymorphic objects?
47) What is the role of typeid object in RTTI?
48) What are the problems with the use of typeid mechanism for solving problems?
49) Draw comparison between different casting operators.
50) Suggest few cases where downcasting or cross casting is useful.
UNIT-V
I/O STREAMS & FILE HANDLING
PART-A(2MARKS )
1. What are streams? Why they are useful?
2. What are input and output streams?
3. Briefly describe the class hierarchy provided by c++ for stream handling.
4. What is the difference between a text file and a binary file?
5. How can a file be opened for both reading and writing?
6. Describe the following manipulators setw(), setprecision(), setfill(),
Setiosflags(),resetiosflags().
7. What is a file pointer?
8. What is a command-line argument?
9. How will you create manipulators?
10. Write the syntax and use of getline () and write () functions.
11. What are the differences between manipulators and ios functions?
12. What is the need for string objects?
13. Compare C strings with C++ strings.
14. What is meant by object serialization?
15. What is name conflict problem? How can it be solved using namespaces?
16. How can we define our own namespace?
17. How can we define our functions inside the namespace and use them outside?
18. What is unnamed namespace? What is the use of unnamed namespace?
19. How can we extend a namespace already defined? What is its advantage?
20. What is std namespace? How it is different from other namespaces?
21. What is STL? How it is different from C++ standard library?
22. List the three types of containers.
23. What is the major difference between sequence container and an associative
container?
24. What is an iterator? What are the its characteristics?
25. Explain how sequence iterators work.
26. Explain how sorted associative containers work.
27. How are the STL algorithms implemented?
28. Distinguish between the following:
a. Lists and vectors
b. Sets and maps
PART-B(16 MARKS)
1) Explain about Template and its types with example.
2) Discuss about Streams and stream classes
3) Write notes on Formatted and Unformatted Console I/O Operations.
4) Explain about File Pointers and Manipulations with example.
5) Discuss about manipulators and file streams with Program.
6) Write on Details about File modes and File I/O.
7) Write notes on Formatted and Unformatted Console I/O Operations.
8) Explain about File Pointers and their manipulations with example.
9) Give the differences between Manipulators and ios Functions.
10) How can we determine errors while dealing with files.
11)Explain in detail about the facilities available for substring operations on the string
object?
12) Explain in detail about Sorted Associative Containers.
13) Discuss about different ways of defining namespaces.
14)Explain in detail about Adapted Containers.