wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Design Patterns-Introduction-Session-1

Total questions: 11

Worksheet time: 9mins

Name
Class
Date
1.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
2.

Which of these data structures is LIFO?

a)

Stack

b)

Queue

c)

Binary Tree

d)

Double linked list

3.
Which of the following is NOT a Type of Data Structures?
a)
Arrays
b)
Tables
c)
Stacks
d)
Trees
4.

It use pointer to link nodes.

a)

Variable

b)

Linked List

c)

Pointer

d)

Trees

5.

It is a measure of how well a computer algorithm scales as the amount of data involved increases.

a)

Big logN Notation

b)

Big X Notation

c)

Big O Notation

6.

When a class is derived from a base class it gets access to:

a)

Private

b)

Protected

c)

Private and Protected

d)

Protected and Public

e)

Private, Protected and Public

7.

In a class the access specifiers are _______ by default:

a)

Private

b)

Protected

c)

Public

8.

What does the word const do when placed at the end of a member function in a class?

a)

It is required for C++

b)

States the return type is constant

c)

States the input arguments are constant

d)

States the member variables will not change

e)

None of the above

9.

When class B is inherited from class A, what is the order in which the destructors are called.

a)

Class A first Class B next

b)

Class B first Class A next

c)

Class B's only as it is the child class

d)

Class A's only as it is the parent class

10.

What does the word virtual do when placed in front of a member function in C++?

a)

Forces derived classes to define the function to compile.

b)

Allows derived classes, not required, to define the function.

c)

Does not place the function in text segment if it is not called.

d)

None of the above.

11.

What happens if the word static is placed in front of a member function in C++?

a)

The member function can be called even if we do not create an instance of the class.

b)

It places the member function in the static part of memory

c)

It will cause an error and the program will not compile.

d)

None of the above.