BCS Bachelor of Computer Science Degree 4 — Questions and Answers
Question 1: Which graph traversal algorithm uses a queue data structure and explores nodes level by level?
- Depth-First Search (DFS)
- Dijkstra's Algorithm
- Breadth-First Search (BFS) (Correct answer)
- A* Search
Correct answer: Breadth-First Search (BFS)
Breadth-First Search (BFS) uses a queue to explore all neighbors at the current depth before moving deeper.
Question 2: In SQL, which clause is used to filter groups of rows after a GROUP BY operation?
- WHERE
- FILTER
- HAVING (Correct answer)
- ON
Correct answer: HAVING
The HAVING clause filters aggregated groups in SQL, whereas WHERE filters individual rows before aggregation.
Question 3: What is the function of a virtual machine (VM) in computing?
- To increase physical CPU clock speed
- To emulate a complete computer system on top of physical hardware (Correct answer)
- To compress files for faster disk I/O
- To manage network routing tables
Correct answer: To emulate a complete computer system on top of physical hardware
A virtual machine emulates an entire computer system, allowing multiple OS instances to run on one physical host.
Question 4: Which principle of secure software design states that a user should only have access to what is strictly necessary for their tasks?
- Defense in Depth
- Least Privilege (Correct answer)
- Fail-Safe Defaults
- Separation of Duties
Correct answer: Least Privilege
The Principle of Least Privilege dictates that users and systems should have only the minimum permissions needed for their function.
Question 5: In computer networks, what does CIDR notation '/24' indicate in an IP address like 192.168.1.0/24?
- There are 24 host addresses available
- The first 24 bits are the network portion (Correct answer)
- The subnet has 24 subnets
- The TTL value is 24
Correct answer: The first 24 bits are the network portion
CIDR /24 means the first 24 bits of the IP address identify the network, leaving 8 bits for host addresses.
Question 6: Which programming paradigm treats computation as the evaluation of mathematical functions and avoids changing state?
- Object-Oriented Programming
- Procedural Programming
- Functional Programming (Correct answer)
- Event-Driven Programming
Correct answer: Functional Programming
Functional programming emphasizes pure functions, immutability, and avoids side effects or shared state.
Question 7: What does the term 'cache hit' mean in computer architecture?
- The CPU successfully writes data to the cache
- Data requested by the CPU is found in the cache (Correct answer)
- The cache has reached maximum capacity
- The cache replaces old data with new data
Correct answer: Data requested by the CPU is found in the cache
A cache hit occurs when the CPU finds the requested data already present in the cache, avoiding a slower main memory access.
Which graph traversal algorithm uses a queue data structure and explores nodes level by level?