0% found this document useful (0 votes)
9 views8 pages

First Exam OS

This document is an exam for the Operating Systems course at Palestine Polytechnic University, dated 09/04/2025, consisting of multiple-choice and true/false questions along with short answer sections. It assesses students' understanding of key concepts in operating systems, including process management, system calls, and concurrency. The exam includes a grading section for student responses and specific questions related to the course material.

Uploaded by

Sara Nukho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

First Exam OS

This document is an exam for the Operating Systems course at Palestine Polytechnic University, dated 09/04/2025, consisting of multiple-choice and true/false questions along with short answer sections. It assesses students' understanding of key concepts in operating systems, including process management, system calls, and concurrency. The exam includes a grading section for student responses and specific questions related to the course material.

Uploaded by

Sara Nukho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Palestine Polytechnic University

College of Computer Eng. & IT


Course: Operating Systems

First Exam

Date: 09/04/2025 Time: 60 Minutes

Student Name Student Number

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

2.​ What is the primary purpose of caching in an operating system?​


a) To increase the size of secondary storage​
b) To reduce the latency of data access​
c) To improve the reliability of storage devices​
d) To manage virtual memory

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.

4.​ Which of the following is NOT a characteristic of real-time systems?​


a) Predictable response times​
b) High throughput​
c) Guaranteed deadlines​
d) Prioritization of time-critical tasks

5.​ What is the primary purpose of the exec() system call?​


a) To create a new process​
b) To replace the current process image with a new one​
c) To terminate a process​
d) To wait for a child process to finish

6.​ Which of the following is an example of a system program?​


a) Web browser​ ​ b) Fifa 2025
c) File manager​ ​ d) Word processor

7.​ What is the main advantage of a microkernel architecture?​


a) Improved performance due to a larger kernel​
b) Enhanced security and modularity​
c) Simplicity in design and implementation​
d) Faster system calls due to fewer layers

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

9.​ Which of the following is NOT a part of a process’s address space?​


a) Stack​ ​ ​ b) Heap​
c) Program counter​ ​ d) Data section

10.​What is the primary role of the long-term scheduler?​


a) To allocate CPU time to processes​
b) To manage I/O operations​
c) To decide which processes are admitted to the ready queue​
d) To handle context switching

11.​What happens during a context switch?​


a) The CPU switches from user mode to kernel mode.​
b) The state of the process is saved, and the state of the next process is restored.​
c) A new process is created.​
d) A process is terminated.

12.​Which of the following is a disadvantage of shared memory for IPC?​


a) It requires synchronization mechanisms.​
b) It is slower than message passing.​
c) It cannot be used for communication between processes on the same machine.​
d) It is more complex to implement than pipes.

13.​Which of the following best describes task parallelism?​


a) Dividing a large dataset across multiple processors​
b) Executing different tasks on different processors​
c) Increasing the clock speed of a single processor​
d) Using multiple threads in a single process

14.​What is the primary limitation of Amdahl’s Law?​


a) It assumes infinite resources.​
b) It only applies to single-threaded programs.​
c) It does not account for the overhead of parallelization.​
d) It cannot predict the performance of distributed systems.

15.​What is a key advantage of user-level threads over kernel-level threads?​


a) They are managed directly by the OS.​
b) They have lower context-switching overhead.​
c) They can take advantage of multiple processors.​
d) They are more secure.
3
Q2 (15 pts.): True / False Questions

1.​ The OS kernel is responsible for managing both hardware and software resources.

2.​ Dual-core processors use asymmetric multiprocessing by default.

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.

5.​ The layered OS structure is designed to simplify debugging and maintenance.

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.

9.​ Performing arithmetic operations (e.g., ADD, SUBTRACT) should be a privileged


instruction.

10.​Accessing user-allocated memory is an example of a privileged instruction.

11.​Named pipes can only be used for communication between related processes.

12.​The job queue contains all processes in the system.

13.​Concurrency is only achievable in multi-core systems.

14.​Enabling or disabling interrupts should be a privileged instruction.

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.

○​ What is the output of the following program?

#include <iostream>
#include <unistd.h>
#include <sys/wait.h>

using namespace std;

int main() {

​ ​ cout << "A" << endl;

​ ​ pid_t pid = fork();

if (pid != 0) { wait(NULL); cout << "B" << endl; }


else { cout << "C" << endl; }

cout << "D" << endl;


​ 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

○​ Describe the actions taken by a kernel to context-switch between kernel-level


threads.

○​ 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.

●​ With 2 cores: <= 1.18 → 18%

●​ With 4 cores: <= 1.29 → 29%

######
7
End of Exam

You might also like