CS FundamentalsHardTCS NQT · Infosys interview pattern
Processes (arrival, burst, priority — lower number is higher priority): P1 (0, 5, 3), P2 (1, 3, 1), P3 (2, 4, 4), P4 (4, 2, 2). Under preemptive priority scheduling, at what time does P1 complete?
- A. 5
- B. 8
- C. 14
- D. 10
Correct answer: D. 10
P1 runs 0–1, then P2 (priority 1) preempts and runs 1–4. At 4, P4 (priority 2) beats P1 and runs 4–6. P1 resumes 6–10 with its remaining 4 units. P3 runs last, 10–14. 8 forgets P4’s preemption.
More Operating Systems questions
- int A[256][256] is stored in row-major order, and a page holds 512 ints (two rows). The process has only ONE frame for A, initially empty…
- Processes (times in ms): A (arrival 0, burst 9), B (arrival 1, burst 4), C (arrival 3, burst 6), D (arrival 5, burst 2), E (arrival 8…
- Processes (times in ms): A (arrival 0, burst 9), B (arrival 1, burst 4), C (arrival 3, burst 6), D (arrival 5, burst 2), E (arrival 8…
- Processes (arrival, burst, priority; a smaller number means higher priority): A (0, 9, 3), B (1, 4, 1), C (3, 6, 4), D (5, 2, 2), E (8, 5…
- Processes (arrival, burst) in ms: P1 (0, 6), P2 (2, 5), P3 (4, 2), P4 (5, 8), P5 (7, 3). They are scheduled by non-preemptive Highest…
- A multilevel feedback queue has Q0 (Round Robin, quantum 2), Q1 (Round Robin, quantum 4) and Q2 (FCFS). New processes enter Q0. A process…