First Exam OS
First Exam OS
First Exam
Question 1 2 3 4 Total
Grade
Answers of Q1:
Question 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Answer D B B B B C B B C C B A B C B
Answers of Q2:
Question 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Answer T F T F T F T F F F F T F T T
1
Q1 (15 pts.): Multiple-Choice Questions
1. In the storage device hierarchy, which level typically has the fastest access time?
a) Magnetic tape
b) Hard disk drive (HDD)
c) Solid-state drive (SSD)
d) CPU registers
3. Which of the following is a key difference between asymmetric and symmetric
multiprocessing?
a) Asymmetric multiprocessing uses a single ready queue, while symmetric
multiprocessing uses multiple queues.
b) Asymmetric multiprocessing assigns specific tasks to specific processors, while
symmetric multiprocessing treats all processors equally.
c) Asymmetric multiprocessing is faster than symmetric multiprocessing.
d) Symmetric multiprocessing is only used in real-time systems.
2
8. Which of the following is a user goal for an operating system?
a) Efficient resource utilization
b) Ease of use
c) High throughput
d) Low overhead
1. The OS kernel is responsible for managing both hardware and software resources.
3. Virtualization allows multiple operating systems to run on a single physical machine
simultaneously.
4. System programs are part of the OS kernel and run in kernel mode.
6. APIs provide a way for applications to interact with hardware directly.
7. The primary goal of an OS is to maximize user convenience and system efficiency.
8. A process in the “ready” state is waiting for an I/O operation to complete.
11.Named pipes can only be used for communication between related processes.
15.Threads within the same process share the same address space.
4
Q3 -A: (2 + 3 = 5 pts.): Basics of Process Management (ANSWER A OR B ONLY)
○ Explain the role of the init (or systemd) process on UNIX and Linux systems in regard
to process termination.
#include <iostream>
#include <unistd.h>
#include <sys/wait.h>
int main() {
return 0;
}
Output:
A
C
D
B
D
5
Q3 -B: (2 + 3 = 5 pts.): Basics of Process Management (ANSWER A OR B ONLY)
○ Draw the process state diagram showing all schedulers on the diagram.
○ Assume you have a system with 2 processors, then discuss and show how the process
state diagram will be to handle this system. Will the state diagram be the same for 2
core processors instead of 2 processors?
6
Q4 (2 + 3 = 5 pts.): Threads and Concurrency
○ Using Amdahl’s Law, calculate the speedup gain of an application that has a 30
percent parallel component for (a) two processing cores and (b) four processing
cores.
######
7
End of Exam