Choice Questions (MCQs) with Answers and
Explanations for Degree, Master's, and
Professional Certification Exams
1. A distributed database system is designed to ensure availability during network partitions.
According to the CAP theorem, which property must be compromised when partition
tolerance is maintained?
A. Atomicity
B. Durability
C. Consistency
D. Isolation
Explanation: The CAP theorem states that a distributed system cannot simultaneously guarantee
consistency, availability, and partition tolerance. When partition tolerance is required, one must
choose between consistency and availability.
2. Which scheduling algorithm minimizes average waiting time when all process execution
times are known beforehand?
A. Round Robin
B. First-Come First-Served
C. Priority Scheduling
D. Shortest Job First
Explanation: Shortest Job First executes processes with the smallest burst times first, minimizing
the average waiting time compared with other scheduling methods.
3. A compiler performs lexical analysis before syntax analysis primarily to:
A. Generate object code directly
B. Allocate memory addresses
C. Convert source code into tokens
D. Optimize loops
Explanation: Lexical analysis scans the source code and groups characters into tokens that are
then used by the syntax analyzer to build parse trees.
4. In graph theory, which algorithm efficiently finds the shortest paths from a single source
to all vertices in a graph with non-negative edge weights?
, A. Bellman-Ford Algorithm
B. Floyd-Warshall Algorithm
C. Depth-First Search
D. Dijkstra's Algorithm
Explanation: Dijkstra's algorithm computes shortest paths efficiently for graphs with non-
negative edge weights using a greedy approach.
5. Which database normalization form eliminates transitive dependencies?
A. First Normal Form
B. Second Normal Form
C. Third Normal Form
D. Boyce-Codd Normal Form
Explanation: Third Normal Form removes transitive dependencies by ensuring non-key
attributes depend only on candidate keys.
6. In object-oriented programming, polymorphism allows:
A. Multiple inheritance only
B. Static memory allocation
C. Data hiding through encapsulation
D. Objects of different classes to be treated through a common interface
Explanation: Polymorphism enables methods to operate on objects of different types through a
shared interface, improving flexibility and reusability.
7. Which data structure provides amortized O(1) insertion and deletion at both ends?
A. Binary Search Tree
B. Stack
C. Queue
D. Deque
Explanation: A double-ended queue supports insertion and deletion at both front and rear in
constant amortized time.
8. In operating systems, deadlock prevention can be achieved by:
A. Allowing circular wait conditions
B. Ignoring resource allocation requests
C. Increasing CPU speed
D. Eliminating at least one necessary condition for deadlock