Your session has expired

Your progress and purchases are safe. Log in again to continue.

Log in again
Aspirant Academy

MCQ

Programming & Data Structures (Senior CI) MCQ - Practice Questions

Practice 227 questions across 6 topics with detailed explanations.

227Questions
6Topics
3Difficulty levels

Topics in Programming & Data Structures (Senior CI)

Sample questions

1

In a C++ program, class Shape has a virtual member function draw(). Class Circle publicly derives from Shape and overrides draw(). If Shape* p points to a Circle object and p->draw() is executed, which statement best describes the call?

A Both Shape::draw() and Circle::draw() are called automatically in base-to-derived order.
B The call is illegal unless p is explicitly cast to Circle* before calling draw().
C Circle::draw() is called because virtual dispatch uses the dynamic type of the object through the base pointer.
D Shape::draw() is always called because the declared type of p is Shape*.
2

Which pair correctly matches the algorithmic strategy with a typical feature?

A Branch and bound - searches partial solutions and prunes those that cannot beat the current best
B Greedy method - uses an incumbent bound to prune impossible branches
C Inorder traversal - visits root first and then both subtrees
D Level-order traversal - recursively prints left subtree, root, and right subtree
3

Which statement correctly matches one machine-learning idea with one blockchain idea?

A Supervised learning trains only on unlabeled data, and a blockchain normally stores data in one central private database.
B Unsupervised learning requires every record to have a target label, and a blockchain block cannot include a cryptographic hash.
C Supervised learning uses labeled examples to learn input-output relationships, and a blockchain links tamper-evident ledger records using cryptographic techniques.
D Reinforcement learning is the same as file handling, and blockchain consensus is another name for operator precedence.
4

Insert the keys 50, 30, 70, 20, 40, 60, 80 into an initially empty binary search tree. Which traversal produces the sorted order 20, 30, 40, 50, 60, 70, 80?

A Inorder traversal
B Postorder traversal
C Preorder traversal
D Level-order traversal
5

Which problem is a standard example where a greedy strategy gives an optimal solution when edges are chosen by increasing weight with cycle checks?

A Matrix multiplication by multiplying matrices strictly left to right
B 0/1 knapsack with arbitrary weights and values
C Minimum spanning tree using Kruskal's algorithm
D Travelling salesman problem by always taking the nearest city

Explore more subjects