CS Systems & Networking 2 — Questions and Answers
Question 1: A process attempts to read a file but the required page is not in physical memory. What happens next?
- A page fault occurs and the OS loads the page from disk (Correct answer)
- The process is immediately terminated
- The CPU cache is flushed and execution continues
- The file is moved to a new directory
Correct answer: A page fault occurs and the OS loads the page from disk
A page fault triggers the OS to fetch the missing page from secondary storage into RAM.
Question 2: Which TCP mechanism prevents a fast sender from overwhelming a slow receiver?
- Flow control using the sliding window (Correct answer)
- The three-way handshake
- Checksum verification
- Port multiplexing
Correct answer: Flow control using the sliding window
TCP flow control uses the receiver's advertised window to limit how much data the sender can transmit.
Question 3: In a UNIX-like system, what does the fork() system call return to the parent process?
- The child's process ID (Correct answer)
- Zero
- A pointer to the child's stack
- The parent's own process ID
Correct answer: The child's process ID
fork() returns the child's PID to the parent and 0 to the child.
Question 4: Which layer of the OSI model is responsible for routing packets between different networks?
- Network layer (Correct answer)
- Data link layer
- Transport layer
- Session layer
Correct answer: Network layer
The network layer (layer 3) handles logical addressing and routing across networks.
Question 5: Two threads increment a shared counter without synchronization and the final value is sometimes wrong. What is this problem called?
- A race condition (Correct answer)
- A deadlock
- Thrashing
- Priority inversion
Correct answer: A race condition
A race condition occurs when the outcome depends on the unsynchronized interleaving of concurrent operations.
Question 6: What is the primary purpose of DNS in a network?
- Translating domain names into IP addresses (Correct answer)
- Encrypting traffic between hosts
- Assigning MAC addresses to devices
- Compressing packets before transmission
Correct answer: Translating domain names into IP addresses
DNS resolves human-readable domain names into numeric IP addresses.
Question 7: Which CPU scheduling algorithm can cause starvation of long jobs if short jobs keep arriving?
- Shortest Job First (Correct answer)
- Round Robin
- First-Come First-Served
- Multilevel feedback with aging
Correct answer: Shortest Job First
Shortest Job First always favors shorter jobs, so a long job may wait indefinitely.
A process attempts to read a file but the required page is not in physical memory.
What happens next?