Part 8 of 8 · 2 min read
Exercises
Easy
Easy 1: Round robin by hand (20 minutes)
Two processes with bursts 6 and 3 arrive at 0. With quantum 2, give the finish times.
Done when: P2 finishes at 7 and P1 at 9 (timeline: P1 0-2, P2 2-4, P1 4-6, P2 6-7, P1 7-9).
Hint
draw the timeline in steps of the quantum.
Easy 2: Page count (20 minutes)
How many pages has a 32-bit address space with 8 KiB pages?
Done when: 2^32 / 2^13 = 2^19 = 524,288.
Hint
8 KiB is 2^13 bytes.
Easy 3: Four conditions (20 minutes)
List the four conditions for deadlock.
Done when: mutual exclusion, hold and wait, no preemption, circular wait.
Hint
see section 3.
Medium
Medium 1: EAT (45 minutes)
Hit rate 90 per cent, TLB 2 ns, memory 80 ns, single-level table. Compute the EAT.
Done when: hit 82 ns, miss 162 ns: 0.9 x 82 + 0.1 x 162 = 73.8 + 16.2 = 90.0 ns.
Hint
miss = TLB + table walk + access.
Medium 2: SJF and FCFS (45 minutes)
Bursts 8, 4, 2, all at time 0, in the order given. Compare the average waiting time for FCFS and shortest-job-first.
Done when: FCFS waits 0, 8, 12: average 6.67; SJF order 2, 4, 8 waits 0, 2, 6: average 2.67.
Hint
waiting time is the start time when all arrive at 0.
Medium 3: RAID capacity (45 minutes)
A RAID 5 array of 6 disks of 4 TB. Give the usable capacity and the number of disk failures survived.
Done when: 20 TB usable, 1 failure.
Hint
(disks - 1) x size.
Hard
Hard 1: Write the model answers (90 minutes)
Write your own 60-second answers, in the four-part form, to: process against thread, what is virtual memory, and mutex against semaphore. Time yourself.
Done when: three written answers, each with a definition, a mechanism, a cost and an example, and each speakable in under a minute.
Hint
practise aloud with a timer.
Hard 2: Extend a drill (90 minutes)
Write a drill D: "the machine runs out of memory every night at 2 a.m." Give the first commands, the evidence you expect, and two possible fixes. Use the memory tools of Levels 6 and 7 and /proc.
Done when: a drill with ordered commands (free, ps --sort=-rss, dmesg for OOM), expected evidence and two fixes, such as a limit or a leak fix.
Hint
dmesg | grep -i oom shows kills.
Hard 3: Mock interview (90 minutes)
Ask a friend to pick five questions from the pages of this level and Levels 0 to 11, and answer them aloud. Note which answers needed a second try, and revise the pages.
Done when: a list of five questions, a note on each answer, and a revision plan that names the pages.
Hint
let the friend interrupt with a "why".