OBJECTIVE ASSESSMENT QUESTIONS COMPLETE WITH
VERIFIED ANSWERS AND EXPLANATIONS
Question 1
Which of the following is considered a primitive data type?
A) Array
B) Linked List
C) Integer
D) Stack
Correct Answer: C) Integer
Rationale: Primitive data types are the basic building blocks provided by
programming languages. Integers, characters, booleans, and floating-
point numbers are primitive types. Arrays, linked lists, and stacks are
non-primitive or abstract data structures built from primitive types.
Question 2
What is the primary purpose of a data structure?
A) To execute program instructions
B) To organize and store data efficiently
C) To compile source code
D) To manage network connections
,Correct Answer: B) To organize and store data efficiently
Rationale: A data structure is a way of collecting and organizing data so
that operations can be performed on it effectively. It provides a
framework for storing, accessing, and manipulating data. The choice of
data structure directly affects algorithm efficiency.
Question 3
Which Abstract Data Type (ADT) stores items in which the order does
not matter and duplicate items are allowed?
A) Set
B) Bag
C) Stack
D) Queue
Correct Answer: B) Bag
Rationale: A Bag is an ADT for storing items where order does not
matter and duplicate items are allowed. A Set does not allow duplicates,
while Stack and Queue enforce specific ordering rules for insertion and
removal.
Question 4
Which data structure follows the Last-In, First-Out (LIFO) principle?
A) Queue
B) Deque
C) Stack
D) Priority Queue
,Correct Answer: C) Stack
Rationale: A stack follows the Last-In, First-Out (LIFO) principle. All
operations (push and pop) occur at the "top" of the stack, meaning the
last item placed on the stack is the first one retrieved.
Question 5
What is the time complexity for accessing an element by index in an
array?
A) O(1)
B) O(log n)
C) O(n)
D) O(n²)
Correct Answer: A) O(1)
Rationale: Arrays provide O(1) time complexity for accessing elements
by index. Because they occupy contiguous memory blocks, the address
of any element can be calculated directly using the base address and
index offset.
Question 6
Which data structure allows elements to be inserted and deleted from
only one end and provides no direct access to the other end?
A) Doubly Linked List
B) Deque
C) Stack
D) Circular Queue
, Correct Answer: C) Stack
Rationale: A stack follows the Last-In, First-Out (LIFO) principle. All
operations (push and pop) occur at the "top" of the stack, meaning the
last item placed on the stack is the first one retrieved.
Question 7
Which statement best describes a queue data structure?
A) It is a sequence of elements in which insertion and deletion take
place at one end
B) It is a sequence of elements in which insertion and deletion take
place at both ends
C) It is a sequence of elements where insertion can take place anywhere
but deletion is at the front
D) It is a sequence of elements where insertions take place at the back
and deletions at the front
Correct Answer: D) It is a sequence of elements where insertions take
place at the back and deletions at the front
Rationale: A queue follows the First-In, First-Out (FIFO) principle. This
means the first element added to the structure (at the back/rear) is the
first one to be removed (from the front).
Question 8
Which data structure allows for the insertion and deletion of data
elements at both the front and the rear ends?