BCS Bachelor of Computer Science Degree MCQ 3 — Questions and Answers
Question 1: Which asymptotic notation describes the worst-case running time of an algorithm?
- Omega (Ω)
- Theta (Θ)
- Big-O (O) (Correct answer)
- Little-o (o)
Correct answer: Big-O (O)
Big-O notation provides an upper bound on the running time, representing the worst-case scenario for an algorithm's complexity.
Question 2: In TCP/IP networking, what is the function of ARP (Address Resolution Protocol)?
- Translating domain names to IP addresses
- Mapping IP addresses to MAC addresses (Correct answer)
- Assigning IP addresses dynamically
- Encrypting data packets
Correct answer: Mapping IP addresses to MAC addresses
ARP resolves an IP address into the corresponding MAC (hardware) address needed for local network delivery.
Question 3: What is the output of the following binary addition: 1011 + 0110?
- 10001 (Correct answer)
- 1111
- 10101
- 11001
Correct answer: 10001
1011 (11) + 0110 (6) = 10001 (17) in binary, with a carry propagating to produce a 5-bit result.
Question 4: Which design pattern ensures a class has only one instance and provides a global access point to it?
- Factory Pattern
- Observer Pattern
- Singleton Pattern (Correct answer)
- Decorator Pattern
Correct answer: Singleton Pattern
The Singleton pattern restricts instantiation of a class to one object and provides a global access point to that instance.
Question 5: In a binary search tree (BST), what property must always hold?
- Left child > parent > right child
- Left child < parent < right child (Correct answer)
- All nodes have exactly two children
- The tree must be complete
Correct answer: Left child < parent < right child
In a BST, every node's left subtree contains values less than the node, and the right subtree contains values greater than the node.
Question 6: Which of the following is NOT a feature of functional programming?
- Immutability
- Pure functions
- Shared mutable state (Correct answer)
- Higher-order functions
Correct answer: Shared mutable state
Functional programming avoids shared mutable state; instead it relies on immutability, pure functions, and function composition.
Question 7: What does CPU pipelining achieve?
- Increases clock speed by reducing voltage
- Overlaps execution of multiple instructions to improve throughput (Correct answer)
- Stores frequently accessed data closer to the CPU
- Executes a single instruction faster by parallelizing its stages
Correct answer: Overlaps execution of multiple instructions to improve throughput
Pipelining divides instruction execution into stages so multiple instructions can be processed simultaneously, improving throughput.
Which asymptotic notation describes the worst-case running time of an algorithm?