BCS Bachelor of Computer Science Degree MCQ 2 — Questions and Answers
Question 1: Which sorting algorithm has the best average-case time complexity?
- Bubble Sort
- Merge Sort (Correct answer)
- Insertion Sort
- Selection Sort
Correct answer: Merge Sort
Merge Sort has an average-case time complexity of O(n log n), which is optimal for comparison-based sorting.
Question 2: In a relational database, which normal form eliminates transitive dependencies?
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF) (Correct answer)
- Boyce-Codd Normal Form (BCNF)
Correct answer: Third Normal Form (3NF)
Third Normal Form (3NF) requires that no non-key attribute is transitively dependent on the primary key.
Question 3: What does the OSI model's Transport Layer primarily provide?
- Routing between networks
- End-to-end communication and error recovery (Correct answer)
- Physical signal transmission
- Session establishment
Correct answer: End-to-end communication and error recovery
The Transport Layer (Layer 4) provides end-to-end communication, segmentation, flow control, and error recovery via protocols like TCP.
Question 4: Which of the following is a characteristic of a stack data structure?
- FIFO ordering
- Random access by index
- LIFO ordering (Correct answer)
- Priority-based removal
Correct answer: LIFO ordering
A stack follows Last In, First Out (LIFO) ordering, where the most recently pushed element is the first to be popped.
Question 5: In object-oriented programming, what is method overriding?
- Defining multiple methods with the same name but different parameters
- Providing a new implementation of an inherited method in a subclass (Correct answer)
- Calling a parent class method from a subclass
- Hiding a method from external access
Correct answer: Providing a new implementation of an inherited method in a subclass
Method overriding allows a subclass to provide its own implementation of a method already defined in its parent class.
Question 6: Which logic gate produces a HIGH output only when all inputs are HIGH?
- OR gate
- NAND gate
- AND gate (Correct answer)
- XOR gate
Correct answer: AND gate
An AND gate outputs HIGH (1) only when every one of its inputs is HIGH (1).
Question 7: What is the purpose of virtual memory in an operating system?
- To speed up CPU execution directly
- To allow programs to use more memory than physically installed RAM (Correct answer)
- To store frequently used instructions in cache
- To manage file system permissions
Correct answer: To allow programs to use more memory than physically installed RAM
Virtual memory uses disk space to extend the apparent amount of RAM, allowing programs larger than physical memory to run.
Which sorting algorithm has the best average-case time complexity?