Phase 7Ch 7.2 Mixed practice≈ 40 min
Twelve more mixed questions. Before computing, name the lesson each one comes from.
12 questions · 20 marks · 40 minutes. Negative marking on MCQ only: −1/3 mark for a wrong 1-mark MCQ, −2/3 for a wrong 2-mark MCQ. No negative marking for MSQ or NAT; MSQ has no partial credit.
Q1 · MCQ · 1 mark(s) — System calls
Which of these is a system call (not just a library function)?
- (A) sqrt()
- (B) toupper()
- (C) strlen()
- (D) read()
Q2 · MCQ · 1 mark(s) — Process states
Which state change can never happen directly?
- (A) Ready → Waiting
- (B) Waiting → Ready
- (C) Running → Ready
- (D) Running → Waiting
Q3 · NAT · 2 mark(s) — Priority
P1 (arrival 0, burst 5, priority 2), P2 (1, 3, 1), P3 (2, 8, 4), P4 (3, 2, 3); smaller number = higher priority. Non-pre-emptive priority: average waiting time?
Numerical answer: ________
Q4 · NAT · 2 mark(s) — HRRN
Same processes under HRRN. At time 5 P1 finishes. Largest response ratio among the waiting processes (2 decimals)?
Numerical answer: ________
Q5 · NAT · 2 mark(s) — Utilisation
4 processes each wait for I/O half of the time (independently). CPU utilisation?
Numerical answer: ________
Q6 · MCQ · 1 mark(s) — Peterson
In Peterson's solution, process i wants to enter and process j is not interested (flag[j] = false). What happens?
- (A) i enters only if turn == i
- (B) i enters immediately
- (C) i waits until j takes a turn
- (D) i waits for ever
Q7 · NAT · 1 mark(s) — Semaphore
A semaphore starts at 5. Then 12 wait and 9 signal operations are performed. Final value?
Numerical answer: ________
Q8 · NAT · 2 mark(s) — Detection
Available (0, 0, 0). Allocation: P0 (1,0,1), P1 (0,1,0), P2 (1,1,0), P3 (0,0,1). Request: P0 (0,1,0), P1 (1,0,0), P2 (0,0,1), P3 (1,0,0). How many processes are deadlocked?
Numerical answer: ________
Q9 · NAT · 2 mark(s) — TLB
Memory access 120 ns, TLB 10 ns, hit ratio 0.9, single-level paging. EAT in ns?
Numerical answer: ________
Q10 · NAT · 2 mark(s) — Segmentation
Segment table: segment 0 (base 1000, limit 700), segment 1 (3000, 200), segment 2 (5200, 1000). Physical address of (2, 750)?
Numerical answer: ________
Q11 · NAT · 2 mark(s) — Working set
Reference string 1 2 3 2 4 1 5 2 1 2 3 4 (positions 1–12), Δ = 4. Working-set size at t = 8?
Numerical answer: ________
Q12 · NAT · 2 mark(s) — Inode
Inode with 10 direct, 1 single and 1 double indirect pointer; 1 KB blocks; 8-byte pointers. Maximum file size in KB?
Numerical answer: ________
✓Answer Vault
Try the questions first. Open when you are ready to check.
🔐 Open the Answer Vault
Q1 Answer: (D) · 1 mark(s)
It asks the kernel to do I/O.
- (A) is wrong: Pure library code.
- (B) is wrong: Pure library code.
- (C) is wrong: Pure library code.
Re-read: Lesson 0.1.3 — System calls: how programs ask the operating system for help
Q2 Answer: (A) · 1 mark(s)
A process must be running to request I/O or an event.
- (B) is wrong: The event happened.
- (C) is wrong: Pre-emption.
- (D) is wrong: An I/O request.
Re-read: Lesson 1.1.1 — Processes: memory layout, process control block and process states
Q3 Answer: 4.25 · 2 mark(s)
P1 0–5, P2 5–8, P4 8–10, P3 10–18: waits 0, 4, 8, 5.
Re-read: Lesson 2.1.3 — Priority scheduling, starvation and aging; highest response ratio next
Q4 Answer: 2.33 to 2.34 · 2 mark(s)
P2 (4 + 3)/3 ≈ 2.33; P3 (3 + 8)/8; P4 (2 + 2)/2.
Re-read: Lesson 2.1.3 — Priority scheduling, starvation and aging; highest response ratio next
Q5 Answer: 0.9375 · 2 mark(s)
1 − 0.5⁴.
Re-read: Lesson 2.2.2 — Multilevel queues, CPU and I/O bursts, CPU utilisation
Q6 Answer: (B) · 1 mark(s)
The wait condition needs flag[j] to be true.
- (A) is wrong: turn doesn't matter when flag[j] is false.
- (C) is wrong: That is strict alternation.
- (D) is wrong: No.
Re-read: Lesson 3.1.2 — Software solutions: turn and flag attempts, Peterson's algorithm
Q7 Answer: 2 · 1 mark(s)
5 − 12 + 9.
Re-read: Lesson 3.2.1 — Semaphores: wait, signal, counting and binary semaphores
Q8 Answer: 4 · 2 mark(s)
No request fits in (0, 0, 0), so nobody can finish.
Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula
Q9 Answer: 142 · 2 mark(s)
0.9 × 130 + 0.1 × 250.
Re-read: Lesson 5.2.2 — TLBs, effective access time and multilevel page tables
Q10 Answer: 5950 · 2 mark(s)
750 < 1000.
Re-read: Lesson 5.2.3 — Segmentation, and segmentation with paging
Q11 Answer: 4 · 2 mark(s)
References 5–8: 4 1 5 2.
Re-read: Lesson 5.3.3 — Frame allocation, thrashing, working sets and the clock algorithm
Q12 Answer: 16522 · 2 mark(s)
k = 128; 10 + 128 + 16384 blocks.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space