AS Associate Degree In Computer Science 5 — Questions and Answers
Question 1: Which data structure is best suited for implementing a breadth-first search (BFS)?
- Stack
- Queue (Correct answer)
- Heap
- Binary tree
Correct answer: Queue
BFS uses a queue (FIFO) to explore nodes level by level, ensuring the shallowest nodes are visited first.
Question 2: What is the hexadecimal equivalent of the decimal number 255?
- FE
- FF (Correct answer)
- EF
- 1FF
Correct answer: FF
255 = 15×16 + 15 = FF in hexadecimal.
Question 3: In an Associate of Science CS program, which subject area does discrete mathematics primarily support?
- Web design
- Algorithm analysis and logic (Correct answer)
- Database administration
- Hardware maintenance
Correct answer: Algorithm analysis and logic
Discrete mathematics provides the foundational logic, proof techniques, and combinatorics used in algorithm analysis and computer science theory.
Question 4: Which of the following is an example of a high-level programming language?
- Machine code
- Assembly language
- Python (Correct answer)
- Binary
Correct answer: Python
Python is a high-level language with human-readable syntax, abstracting away hardware details.
Question 5: In networking, what does DHCP do?
- Encrypts data packets
- Dynamically assigns IP addresses to devices (Correct answer)
- Translates domain names to IP addresses
- Routes packets between networks
Correct answer: Dynamically assigns IP addresses to devices
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses and other network configuration to devices.
Question 6: Which concept in OOP allows a subclass to provide a specific implementation of a method defined in its superclass?
- Encapsulation
- Abstraction
- Overloading
- Overriding (Correct answer)
Correct answer: Overriding
Method overriding allows a subclass to redefine a superclass method with its own specific implementation.
Question 7: What is the primary role of an operating system?
- Run application software only
- Manage hardware resources and provide services to programs (Correct answer)
- Store user data permanently
- Compile source code
Correct answer: Manage hardware resources and provide services to programs
An operating system manages CPU, memory, storage, and I/O resources while providing a platform for applications to run.
Which data structure is best suited for implementing a breadth-first search (BFS)?