ICT Operating System Fundamentals 5 — Questions and Answers
Question 1: What is the difference between a process and a program?
- They are identical concepts
- A program is static code on disk; a process is a program in execution with associated resources (Correct answer)
- A process can only run one program at a time
- A program includes the OS kernel; a process does not
Correct answer: A program is static code on disk; a process is a program in execution with associated resources
A program is a passive set of instructions stored on disk, while a process is an active instance of execution with its own state.
Question 2: Which system call is used to wait for a child process to finish in Unix?
- sleep()
- pause()
- wait() (Correct answer)
- join()
Correct answer: wait()
The wait() system call causes the parent process to block until one of its child processes terminates.
Question 3: What is 'demand paging'?
- Loading all pages of a process into memory before execution begins
- Loading pages into memory only when they are actually needed during execution (Correct answer)
- Writing modified pages to disk on demand
- Allocating memory pages based on process priority
Correct answer: Loading pages into memory only when they are actually needed during execution
Demand paging loads a page from disk into memory only when the process accesses it, triggering a page fault.
Question 4: In a file system, what is the purpose of a 'journal'?
- To log user activity for security auditing
- To record pending metadata changes so the file system can recover after a crash (Correct answer)
- To speed up directory searches
- To compress infrequently accessed files
Correct answer: To record pending metadata changes so the file system can recover after a crash
A journaling file system records changes to a log before applying them, enabling recovery to a consistent state after crashes.
Question 5: Which of the following best describes the 'banker's algorithm'?
- A disk scheduling algorithm that minimizes seek time
- A deadlock avoidance algorithm that checks if resource allocation leads to a safe state (Correct answer)
- A memory compaction technique
- A CPU scheduling algorithm for real-time systems
Correct answer: A deadlock avoidance algorithm that checks if resource allocation leads to a safe state
The banker's algorithm grants resource requests only if the resulting state is safe (i.e., all processes can eventually complete).
Question 6: What is 'spooling' in operating systems?
- A technique to compress files before storage
- Buffering data for a slow device (like a printer) in a queue so the CPU can continue other work (Correct answer)
- Splitting a process across multiple CPUs
- Encrypting network communications
Correct answer: Buffering data for a slow device (like a printer) in a queue so the CPU can continue other work
Spooling (Simultaneous Peripheral Operations On-Line) queues jobs for slow devices so the system can process other tasks concurrently.
Question 7: What is the key advantage of using a multi-level feedback queue scheduling algorithm?
- It guarantees equal CPU time for all processes
- It adapts process priority dynamically based on CPU burst behavior, favoring interactive tasks (Correct answer)
- It eliminates context switching overhead
- It requires no kernel involvement in scheduling decisions
Correct answer: It adapts process priority dynamically based on CPU burst behavior, favoring interactive tasks
Multi-level feedback queues move processes between priority queues based on behavior, automatically favoring short/interactive jobs.
What is the difference between a process and a program?