COMP3231 Final Exam V2

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 1/17

Dashboard  My courses  COMP9283-COMP3231-COMP3891-COMP9201-5203_00462  General  Sample Final Exam V2

Information

Question 1
Not answered

Marked out of

Question 2
Not answered

Marked out of

Question 3
Not answered

Marked out of

Question 4
Not answered

Marked out of

Started on Monday, 11 May 2020, 12�30 AM

State Finished

Completed on Monday, 11 May 2020, 12�32 AM

Time taken 2 mins 5 secs

Grade 0.00 out of 86.00 (0%)

(Staff Only)

 Site Home

 Announcements 

 User Guides

For each question in this section, classify the overall statement as �ẃẴǴ if the statement is generally true, or à ǀ ḵẎǴ if the statement (or
a component of it) is false.

You will receive one mark for each correct classification, and lose one mark for each incorrect

classification. You gain zero marks for each question left unclassified. 

Condition variables are used to manage blocking and waking within critical sections protected by  semaphores.

 

Select one:

The correct answer is: False

ZḙṎḙṎḅ ṿḎḙḵṙ Ẏṙ ṿḎǴẃẎ can avoid deadlock using a single lock for the entire table.

Select one:

The correct answer is: True

ì ṙ ḵǨ ǀ ṎǨ ỹ ǀ ḙẤ is a practical deadlock prevention strategy.

Select one:

The correct answer is: False

One deadlock prevention method is to release all locks held by a thread when the thread finds a lock that it requires is held by

another thread. This method prevents deadlock, but not necessarily livelock.

Select one:

The correct answer is: True

https://moodle.telt.unsw.edu.au/my/
https://moodle.telt.unsw.edu.au/course/view.php?id=48561
https://moodle.telt.unsw.edu.au/mod/quiz/view.php?id=2957991
http://www.unsw.edu.au/
http://bit.ly/2vxLDNi
http://bit.ly/2vxLDNi
http://bit.ly/2CsKery
http://bit.ly/2CsKery
http://bit.ly/2FECVjK
http://bit.ly/2FECVjK
https://moodle.telt.unsw.edu.au/?redirect=0
http://moodle.telt.unsw.edu.au/mod/page/view.php?id=41448
https://student.unsw.edu.au/moodle/support

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 2/17

Question 5
Not answered

Marked out of

Question 6
Not answered

Marked out of

Question 7
Not answered

Marked out of

Question 8
Not answered

Marked out of

Question 9
Not answered

Marked out of

A group of processes are ḵḙỴǴḵṙ ǜḮ ǴǨ if they are all in the ǘḵṙ ǜḮ ǴǨ state, and are making no effective progress.

Select one:

The correct answer is: False

Mǀ ṎḮ ǴẃῗẎ ǀ ḵḅṙ ẃḙẤḎṊ  can be used to avoid competing processes deadlocking without requiring any knowledge of their resource
requirements in advance.

Select one:

The correct answer is: False

Deadlock ṿẃǴỴǴṎẤḙṙ Ṏ can be achieved by mitigating one of the four conditions required for deadlock. Each one of the four conditions
are as practical a candidate to mitigate as any of the others.

Select one:

The correct answer is: False

A buffer cache improves performance by buffering writes to disk, allowing the application to continue computation while buffers are

written back to the disk in the background. This increases the chance of losing data during a power failure.

Select one:

The correct answer is: True

Using a bitmap to manage free blocks on a disk reduces the usable disk capacity compared to the approach of storing the addresses

of free blocks in the free blocks themselves.

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 3/17

Question 10
Not answered

Marked out of

Question 11
Not answered

Marked out of

Question 12
Not answered

Marked out of

Question 13
Not answered

Marked out of

Question 14
Not answered

Marked out of

A file system using linked-list disk allocation (also termed chained allocation) provides poor random access performance.

Select one:

The correct answer is: True

When an application performs a series of small file system writes, having the operating system contiguously allocate multiple blocks

on the initial write (and occasionally on subsequent writes) can improve file system performance compared to allocating a block at a

Select one:

The correct answer is: True

A FAT file system gets its name as it is designed for really big disks.

Select one:

The correct answer is: False

A buffer cache improves performance by buffering writes to disk, allowing the application to continue computation while buffers are

written to the disk in the background. Meta-data and data writes are generally treated equally and simultaneously flushed to disk

periodically.

Select one:

The correct answer is: False

A typical i-node-based UNIX file system features differing levels of indirection (levels of indirect blocks) depending on the offset of

access to the file. File access performance would be improved for small files if the file system was simplified to use three levels of

indirection for all offsets in the file.

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 4/17

Question 15
Not answered

Marked out of

Question 16
Not answered

Marked out of

Question 17
Not answered

Marked out of

Question 18
Not answered

Marked out of

Question 19
Not answered

Marked out of

In the ẴẎǴẃ Ṋ ṙ ǨǴ of the microprocessor, only the application’s virtual memory is accessible to the processor.

Select one:

The correct answer is: True

An operating system can enforce security by putting security checks in the ẎẤǀ ṎǨǀ ẃǨ Qᾷḵḙǘẃǀ ẃӑῢ

 

Select one:

The correct answer is: False

An operating system is not responsible for arbitrating between processes competing for system resources.

Select one:

The correct answer is: False

Adding more levels of I/O buffering always improves performance.

Select one:

The correct answer is: False

A ẃǴǀ Ǩ ǘǴḂṙ ẃǴ ẤǴẎẤ ǀ ṎǨ ẎǴẤ implementation of a spinlock (also called a ẤǴẎẤ ǀ ṎǨ ẤǴẎẤ ǀ ṎǨ ẎǴẤ) just adds extra overhead to the lock
implementation by adding a superfluous read.

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 5/17

Question 20
Not answered

Marked out of

Question 21
Not answered

Marked out of

Question 22
Not answered

Marked out of

Question 23
Not answered

Marked out of

Question 24
Not answered

Marked out of

A single-threaded process runs twice as fast on a two CPU machine.

Select one:

The correct answer is: False

Application multi-threading supported by user-level threads features a per-thread user-level stack and a 1-to-1 corresponding per-

thread in-kernel stack.

Select one:

The correct answer is: False

In a multi-threaded process, every thread has its own virtual address space.

Select one:

The correct answer is: False

A context switch between user-level threads (also termed a thread switch), can be implemented by an assembly language function

called from Q that pushes a subset of the registers onto the current stack, saves the current stack pointer, and then sets the stack
pointer to the target thread, and restores the target’s registers.

Select one:

The correct answer is: True

Applications can benefit from running on multi-processors when they are implemented to use multi-threading provided by kernel-

level threads, but not user-level threads.

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 6/17

Question 25
Not answered

Marked out of

Question 26
Not answered

Marked out of

Question 27
Not answered

Marked out of

Question 28
Not answered

Marked out of

Question 29
Not answered

Marked out of

Multi-tasking can improve system utilisation for I/O-bound workloads by overlapping I/O with execution of other ẃǴǀ Ǩӑ applications.

Select one:

The correct answer is: True

Co-operative (non-preemptive) multitasking can result in a non-responsive system if an application has an endless loop.

Select one:

The correct answer is: True

đ ṙ ẴṎǨᾷẃṙ ǘḙṎ ẎǜḎǴǨẴḵḙṎḅ  gives each ẃǴǀ Ǩӑ  process (or thread) a turn to execute for a ẤḙṊ ǴẎḵḙǜǴ length of time. A short timeslice
provides good interactive response times at the expense of more overhead due to more frequent context switching.

Select one:

The correct answer is: True

The traditional UNIX scheduler uses priorities to favour I/O-bound processes over CPU-bound processes. It fails to adjust when

CPU-bound processes become I/O-bound and vice versa.

Select one:

The correct answer is: False

The following program uses the Ḃṙ ẃḮ ᾨᾩ system call to create new processors. Running the program results in “Hello World” being
printed 3 times.

printf(“Hello World\n”);

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 7/17

Question 30
Not answered

Marked out of

Question 31
Not answered

Marked out of

Question 32
Not answered

Marked out of

Question 33
Not answered

Marked out of

Question 34
Not answered

Marked out of

A process and the operating system kernel share the same stack so they both can execute a high-level language like the

Q programming language.

Select one:

The correct answer is: False

Because the operating system runs in privileged mode, the operating system can safely use the memory pointers provided by

applications (via the arguments to system calls) just like in-kernel memory pointers.

Select one:

The correct answer is: False

A Ḃẃǀ Ṋ Ǵ Ấǀ ǘḵǴ is not required to manage free frames when using an ḙṎỴǴẃẤǴǨ ṿǀ ḅǴ Ấǀ ǘḵǴ as virtual address translation and free frame
management is combined into the one data structure.

Select one:

The correct answer is: True

A computer has a 32-bit virtual address space and uses a two-level page table. The top-level of the page table has 256 entries, and

the second-level page tables have 1024 entries. That implies the page size on the computer must be 16 KiB.

Select one:

The correct answer is: True

The size of an ḙṎỴǴẃẤǴǨ ṿǀ ḅǴ Ấǀ ǘḵǴ is determined by the virtual address space size of a process, and is unrelated to the size of
physical memory.

Select one:

The correct answer is: False

COMP3231/COMP9201/COMP3891/COMP9283 Operating Systems T1-2020 Kah May Tan

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 8/17

Question 35
Not answered

Marked out of

Question 36
Not answered

Marked out of

Question 37
Not answered

Marked out of

Question 38
Not answered

Marked out of

Question 39
Not answered

Marked out of

It is possible to construct a time-sharing system able to withstand malicious applications on a computer architecture possessing only

ǘǀ ẎǴ ǀ ṎǨ ḵḙṊ ḙẤ registers for memory management.

Select one:

The correct answer is: True

The Ấẃǀ ṎẎḵǀ Ấḙṙ Ṏ ḵṙ ṙ Ḯ ǀ ẎḙǨǴ ǘẴḂḂǴẃ (TLB) that translates virtual addresses to physical addresses for every CPU instruction is sometimes
implemented in software.

Select one:

The correct answer is: False

On a processor with a hardware-refilled TLB, the operating system is free to implement the most efficient page table data structure

for the expected workload.

Select one:

The correct answer is: False

The minimum virtual-memory page size available for use by the operating system is determined by the properties of the underlying

hardware architecture.

Select one:

The correct answer is: True

È ṿẤḙṊ ǀ ḵ is the best practical page replacement algorithm.

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 9/17

Question 40
Not answered

Marked out of

Question 41
Not answered

Marked out of

Question 42
Not answered

Marked out of

Information

When choosing a victim for page replacement, a ǜḵǴǀ Ṏ page is faster to replace than a ǨḙẃẤӑ page.

Select one:

The correct answer is: True

In this section you will match pairs that are the most closely related. Each correct pair earns  of the marks available for the

question, where is the number of pairs to match.

ZǴǀ Ǩḵṙ ǜḮ ṿẃǴỴǴṎẤḙṙ Ṏ is a strategy where one of the four conditions required for deadlock is prevented, thereby preventing deadlock
from occurring.

Listed below are the four conditions required for deadlock and four approaches to preventing the condition from occurring. Match

the individual condition with its method of prevention.

No Preemption Choose…

Circular Wait Choose…

Hold and Wait Choose…

Mutual exclusion Choose…

The correct answer is: No Preemption → Nearly always impractical to remove a resource, Circular Wait → Use a single defined order

of resource acquistion, Hold and Wait → Allocate all required resources initially, Mutual exclusion → Always infeasible

Given the statements below, match them to whether they describe internal, external, or not fragmentation.

Space wasted due to space needed being smaller than space allocated. Choose…

Space wasted due to space needed being larger than space available between existing allocations. Choose…

The correct answer is: Space wasted due to space needed being smaller than space allocated. → Internal fragmentation, Space

wasted due to space needed being larger than space available between existing allocations. → External fragmentation

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 10/17

Question 43
Not answered

Marked out of

Question 44
Not answered

Marked out of

Information

For each resource, OS or processor feature listed below, indicate whether it is accessible in kernel (privileged) mode, user mode, or

in both modes.

 

Hard disk drive controller registers Choose…

An interrupt disabling instruction Choose…

An add instruction Choose…

The application’s page table Choose…

A TLB management instruction Choose…

The registers used to transfer system call arguments. Choose…

The application’s memory containing the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ Choose…

Application memory Choose…

The correct answer is: Hard disk drive controller registers → Kernel mode, An interrupt disabling instruction → Kernel mode, An add

instruction → Kernel mode and user mode, The application’s page table → Kernel mode, A TLB management instruction → Kernel

mode, The registers used to transfer system call arguments. → Kernel mode and user mode, The application’s memory containing

the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ → Kernel mode and user mode, Application memory → Kernel mode and user mode

In a system that supports multi-threaded processes, for each attribute listed below, indicate whether it is a per process or a per

thread attribute.

 

Stack Choose…

General purpose registers Choose…

Open file descriptors Choose…

The execution state, e.g. blocked, ready, running Choose…

Local variables Choose…

Virtual address space Choose…

Global variables Choose…

Program counter Choose…

The correct answer is: Stack → Per thread, General purpose registers → Per thread, Open file descriptors → Per process, The

execution state, e.g. blocked, ready, running → Per thread, Local variables → Per thread, Virtual address space → Per process, Global

variables → Per process, Program counter → Per thread

This section consists of choosing the most correct answer from the multiple choices available.

A correct answer earns 100% of the marks available. An incorrect answer subtracts   of the marks available, where  is the

number of choices available in the question.

For example, an incorrect answer to a questions with 5 choices would reduce your marks by  of the marks available for the

specific question.

No marks are awarded or subtracted for unanswered questions.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 11/17

Question 45
Not answered

Marked out of

Bill and Ben are two threads that execute the functions of the same name below respectively. Bill and Ben are prone to deadlock.

Identify the function calls in Bill and Ben where they end up deadlocked if they deadlock. 

Each line of code in each function has a line number to help you identify the location of deadlock. 

void bill() 
1:    lock_acq(&file2)
2:    lock_acq(&file3)
3:    lock_acq(&file1)

/* access all three files mutually exclusively */

4:    lock_rel(&file3)
5:    lock_rel(&file1)

/* do nothing */

6:    lock_acq(&file1)

/* access file1 and file2 mutually exclusively */

7:    lock_rel(&file1)
8:    lock_rel(&file2)

void ben()
1:     lock_acq(&file2)
2:     lock_acq(&file3)
3:     lock_acq(&file1)

/* access all three files mutually exclusively */

4:    lock_rel(&file3)
5:    lock_rel(&file2)

/* do nothing */

6:    lock_acq(&file3)

/* write to file1 and file3 */

7:    lock_rel(&file1)
8:    lock_rel(&file3)

Select one:

Bill line 4, Ben line 7

Bill line 3, Ben line 6

Bill line 6, Ben line 6

Bill line 6, Ben line 3

The correct answer is: Bill line 3, Ben line 6

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 12/17

Question 46
Not answered

Marked out of

In most UNIX file systems, every file has an index block, called an ḙᾷṎṙ ǨǴ, which is used to store
information about the file as well as pointers to data blocks, as shown in the diagram below.

Assume a block size of 2 KiB (2048 bytes) and 4-byte block numbers. What is the approximate largest possible file size supported

by this filesystem?

Select one:

1048576 bytes

24576 bytes

536870912 bytes

275415851008 bytes

274877906944 bytes

8.796 * 10^12 bytes

The correct answer is: 275415851008 bytes

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 13/17

Question 47
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x7fffe18d, choose the most accurate answer from the options below.

Select one:

Physical address 0x5418d is accessed, stores are not allowed.

Physical address 0x5418d is accessed, and stores are allowed.

A TLB exception occurs.

Physical address 0x54 is accessed, and stores are allowed.

Physical address 0x54 is accessed

The correct answer is: Physical address 0x5418d is accessed, and stores are allowed.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 14/17

Question 48
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x00009dde, choose the most accurate answer from the options below.

Select one:

Physical address 0x7adde is accessed, and stores are allowed.

A TLB exception occurs.

Physical address 0x7a is invalid but stores are allowed.

Physical address 0x7a is accessed

Physical address 0x7adde is invalid, but stores are allowed.

The correct answer is: A TLB exception occurs.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 15/17

Question 49
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x7fffd257, choose the most accurate answer from the options below.

Select one:

Physical address 0x56 is invalid but stores are allowed.

Physical address 0x56257 is invalid, but stores are allowed.

Physical address 0x56 is accessed

Physical address 0x56257 is accessed, and stores are allowed.

A TLB exception occurs.

The correct answer is: A TLB exception occurs.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 16/17

Question 50
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x200a2f, choose the most accurate answer from the options below.

Select one:

A TLB exception occurs.

Physical address 0x31a is accessed

Physical address 0x31aa2f is accessed, and stores are allowed.

Physical address 0x31a is accessed, but stores are not allowed.

Physical address 0x31aa2f is accessed, but stores are not allowed.

The correct answer is: Physical address 0x31aa2f is accessed, but stores are not allowed.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7073914&cmid=2957991&showall=1 17/17

Question 51
Not answered

Marked out of

Information

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x00005765, choose the most accurate answer from the options below.

Select one:

Physical address 0x6c is accessed

Physical address 0x6c765 is accessed, and stores are allowed.

Physical address 0x6c765 is accessed, stores are not allowed.

Physical address 0x6c is accessed, and stores are allowed.

A TLB exception occurs.

The correct answer is: Physical address 0x6c765 is accessed, and stores are allowed.

This is the last page of the exam. 

You can submit your exam by clicking Finish attempt … , and Submit all and finish at the bottom of the page, and confirm via the