CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
Jobs A (6), B (2), C (8) and D (3) all arrive at time 0 in that order. What are the average waiting time under non-preemptive SJF and the average waiting time under Round Robin with quantum 2?
- A. 4.5 and 8
- B. 4.5 and 3
- C. 7.5 and 8
- D. 4.5 and 8.5
Correct answer: A. 4.5 and 8
SJF runs B, D, A, C, waiting 0, 2, 5, 11: average 4.5. RR(2): B ends at 4, D at 13, A at 15, C at 19, giving waits 9, 2, 11, 10 = 32 / 4 = 8. RR's average response time is only 3, which is its real advantage.
More Operating Systems questions
- Under Linux CFS, two CPU-bound tasks share one CPU: one at nice 0 (weight 1024) and one at nice 5 (weight 335). About what share of CPU…
- A system's average process size is s = 1 MB and each page-table entry takes e = 8 bytes. Balancing page-table overhead (s·e / p) against…
- What does this program print? (Assume fork() succeeds and the exec of echo succeeds.) c int main() { fork(); execlp("echo", "echo", "hi"…
- In a traditional Unix file system (such as ext2/ext4 without very large directories), directory /d contains 3 subdirectories and 5 regular…
- A process with umask 027 creates a regular file requesting mode 0666 and a directory requesting mode 0777. What permissions do they get?
- A process writes to a pipe whose read end has been closed by every process. What happens by default?