CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
Disk cylinders 0–199; the head is at 50 moving toward higher cylinders; the queue holds 82, 170, 43, 140, 24, 16, 190. Counting the return jump as head movement, what are the totals for SCAN and C-LOOK?
- A. SCAN 332, C-LOOK 341
- B. SCAN 314, C-LOOK 341
- C. SCAN 332, C-LOOK 314
- D. SCAN 391, C-LOOK 332
Correct answer: A. SCAN 332, C-LOOK 341
SCAN goes 50 → 199 (149) and back to 16 (183): 332. C-LOOK goes 50 → 190 (140), jumps to 16 (174) and continues to 43 (27): 341. LOOK, which reverses at 190, would give 314.
More Operating Systems questions
- How many times is x printed? (Every fork() succeeds, and each print is an unbuffered write, so nothing is printed twice through copied…
- Which values are printed (in some order)? (Every fork() succeeds, and each print is an unbuffered write, so nothing is printed twice…
- How many numbers are printed in total, and what is their sum? (Every fork() succeeds, and each print is an unbuffered write, so nothing is…
- What is the sum of all values printed? (Every fork() succeeds, and each print is an unbuffered write, so nothing is printed twice through…
- Semaphores s = 2 and t = 0. T1 runs twice: wait(s); print('a'); signal(t). T2 runs twice: wait(t); print('b'); signal(s). Which outputs…
- Semaphores x = y = z = 0. T1: print A; signal(x); wait(y); print D. T2: wait(x); print B; signal(y); signal(z). T3: wait(z); print C…