IKM Operating Systems 2 — Questions and Answers
Question 1: Which scheduling algorithm gives each process an equal time slice in circular order?
- First Come First Served
- Shortest Job First
- Round Robin (Correct answer)
- Priority Scheduling
Correct answer: Round Robin
Round Robin assigns a fixed time quantum to each process in circular order.
Round Robin is a preemptive algorithm ideal for time-sharing systems. Each process gets a fixed time slice, typically 10-100ms. When the quantum expires, the process moves to the back of the ready queue.
Question 2: What is the primary purpose of virtual memory?
- Increase CPU speed
- Allow programs to use more memory than physically available (Correct answer)
- Compress files on disk
- Manage user authentication
Correct answer: Allow programs to use more memory than physically available
Virtual memory uses disk space as an extension of RAM, enabling programs to address more memory than physically installed.
Virtual memory uses RAM and disk (swap/page file) to present a larger address space. The MMU translates virtual to physical addresses using page tables. Page faults trigger loading data from disk.
Question 3: Which file system is the default for modern Linux distributions?
- NTFS
- FAT32
- ext4 (Correct answer)
- HFS+
Correct answer: ext4
ext4 is the default file system for most modern Linux distributions, offering journaling and large file support.
ext4 supports volumes up to 1 exbibyte and files up to 16 tebibytes. It includes journaling, extents, delayed allocation, and backward compatibility with ext2/ext3.
Question 4: What is a deadlock in operating systems?
- Infinite loop
- Two or more processes waiting for resources held by each other (Correct answer)
- CPU overheating
- Disk read error
Correct answer: Two or more processes waiting for resources held by each other
A deadlock occurs when processes are permanently blocked, each waiting for a resource held by another.
Deadlock requires four Coffman conditions. Strategies include prevention (break a condition), avoidance (Banker's algorithm), detection and recovery, or ignoring it (ostrich algorithm).
Question 5: Which system call creates a new process in Unix/Linux?
- exec()
- fork() (Correct answer)
- spawn()
- create()
Correct answer: fork()
fork() creates a child process that is a copy of the parent process.
fork() creates a child with a new PID but copies the parent's address space using copy-on-write. It returns 0 to the child and the child's PID to the parent. Typically followed by exec().
Question 6: What is the purpose of a semaphore?
- Measure CPU temperature
- Synchronize access to shared resources between processes (Correct answer)
- Manage disk partitions
- Handle network routing
Correct answer: Synchronize access to shared resources between processes
A semaphore controls access to shared resources using wait and signal operations.
Semaphores use an integer counter with atomic wait (P) and signal (V) operations. Binary semaphores allow one process at a time. Counting semaphores allow up to N concurrent accesses.
Which scheduling algorithm gives each process an equal time slice in circular order?