Final exam
Operating Systems Concepts
Before you start
- 20 questions, drawn at random from a pool of 32.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Choose one
Which of these can only be done in kernel mode?
Question 2 of 20Put in order
A program calls write() to save data. Arrange what happens.
Drag the items, or use the arrow buttons, to put them in order.
- The kernel checks the file descriptor and buffer
- The kernel queues the data for the device
- Arguments and the call number go into registers
- Control returns to the program with a result
- A trap instruction enters the kernel
Question 3 of 20Sort into groups
Classify each event as synchronous or asynchronous with respect to the running program.
Tap an item, then tap its group (or drag it there).
Question 4 of 20True or false
Under cooperative multitasking, a program stuck in an infinite loop can freeze the whole system.
Question 5 of 20Choose one
Which is the main advantage of a microkernel over a monolithic kernel?
Question 6 of 20Match the pairs
Match each process state transition to its cause.
Tap an answer, then tap the place where it belongs (or drag it there).
- Ready to running
- Running to ready
- Running to waiting
- Waiting to ready
Question 7 of 20Fill in the blanks
Fill in the blanks
Local variables of active function calls live on the , while objects created with malloc or new live on the .
Question 8 of 20Work it out
A process executes fork() twice in sequence, and every resulting process continues to the end of the code. How many processes are there in total afterward?
Question 9 of 20Choose one
What does exec() do to the calling process?
Question 10 of 20True or false
Threads of the same process each have their own private heap.
Question 11 of 20Work it out
A program is 5% serial. What is the maximum speedup it can reach no matter how many cores are added?
Question 12 of 20Work it out
Three jobs arrive at time 0 and run first come, first served in the order P1 (10 ms), P2 (5 ms), P3 (2 ms). What is the average waiting time in milliseconds? Round to two decimals.
Question 13 of 20Work it out
In round robin with 6 ready jobs and a 20 ms quantum, what is the longest a job can wait between two of its turns, ignoring switch overhead?
Question 14 of 20Choose one
Which technique prevents starvation in priority scheduling?
Question 15 of 20What would you do?
What would you do?
Two threads update a shared bank balance. Each reads the balance, adds a deposit and writes the result back, without locking. Customers report that some deposits occasionally disappear. What is happening and what fixes it?
Question 16 of 20Choose one
A counting semaphore starts at 2. Three threads call wait() and then one thread calls signal(). How many threads are still blocked?
Question 17 of 20Select all that apply
Which of the following are necessary conditions for deadlock? Select all that apply.
Select all that apply.
Question 18 of 20True or false
With single-instance resources, a cycle in the resource allocation graph means the threads in the cycle are deadlocked.
Question 19 of 20Spot the mistake
A teammate summarized ways to handle deadlock. Select the claims that are incorrect.
Question 20 of 20Work it out
Pages are 4,096 bytes. What is the offset within its page of virtual address 20,000?
Question 21 of 20Work it out
A 32-bit address space uses 4 KB pages. How many entries would a flat, single-level page table need?
Question 22 of 20Work it out
Memory access takes 50 ns, a TLB miss adds one extra memory access, and the TLB hit rate is 99%. What is the effective access time in nanoseconds?
Question 23 of 20Choose one
What happens when a process accesses an address that is not part of its address space at all?
Question 24 of 20Work it out
Using FIFO replacement with 3 frames that start empty, how many page faults occur for the reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5?
Question 25 of 20Choose one
Which replacement algorithm gives the fewest possible page faults but can't be implemented in a real OS?
Question 26 of 20True or false
In a thrashing system, CPU utilization is usually high because the CPU is busy handling page faults.
Question 27 of 20Work it out
An inode has 12 direct pointers. Blocks are 4 KB. How many KB of file data can the direct pointers alone address?
Question 28 of 20Choose one
Where is a file's name stored in a Unix-style file system?
Question 29 of 20What would you do?
What would you do?
Power fails while a journaling file system is updating a file's metadata. On reboot, the journal holds the transaction's description but no commit record. What does recovery do?
Question 30 of 20Work it out
Write the octal mode for the permission string rwxr-x--x.
Question 31 of 20Match the pairs
Match each isolation mechanism to its description.
Tap an answer, then tap the place where it belongs (or drag it there).
- Sandbox
- Container
- Virtual machine
- setuid program
Question 32 of 20Sort into groups
Sort each hypervisor or tool by type.
Tap an item, then tap its group (or drag it there).