Skip to main content

Object Oriented Programming MCQs with Answers

Practice important Object Oriented Programming MCQs with answers and explanations.

Multiple Choice Questions

Q621: What does STL stand for in C++?
  • A: Standard Template Library
  • B: Standard Type Library
  • C: Static Template Library
  • D: Structured Template Library
View Answer
A

Q622: Which of the following is NOT a key component of STL?
  • A: Containers
  • B: Iterators
  • C: Algorithms
  • D: Functions
View Answer
B

Q623: What type of container is a 'vector' in STL?
  • A: Sequence Container
  • B: Associative Container
  • C: Container Adapter
  • D: Utility Container
View Answer
A

Q624: Which STL container allows rapid insertions and deletions at both ends?
  • A: Deque
  • B: List
  • C: Vector
  • D: Stack
View Answer
B

Q625: In STL, which container allows duplicate elements?
  • A: Set
  • B: Map
  • C: Multi-Set
  • D: Queue
View Answer
C

Q626: What function is used to add an element to the back of a 'vector' in STL?
  • A: push_back
  • B: push_front
  • C: insert
  • D: remove
View Answer
A

Q627: Which of the following containers is used for a last-in, first-out (LIFO) data structure?
  • A: Stack
  • B: Queue
  • C: Priority Queue
  • D: Deque
View Answer
A

Q628: Which STL container does NOT allow duplicate keys?
  • A: Map
  • B: Multi-Map
  • C: Set
  • D: Multi-Set
View Answer
A

Q629: What is the primary function of a 'map' in STL?
  • A: To store key-value pairs with unique keys
  • B: To store elements in a sorted order
  • C: To store elements with duplicate keys
  • D: To provide fast retrieval by index
View Answer
A

Q630: In the STL example provided, which function returns the size of a 'set' before insertions?
  • A: size
  • B: empty
  • C: max_size
  • D: iterator
View Answer
B

Test Your Knowledge

Take a timed quiz on Object Oriented Programming

🚀 Start Quiz Now