Download as pdf or txt
Download as pdf or txt
You are on page 1of 110

<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > 2 July - 8 July > Graded Quiz Unit 3

Started on Thursday, 2 July 2020, 10:41 PM


State Finished
Completed on Thursday, 2 July 2020, 10:51 PM
Time taken 9 mins 53 secs
Marks 20.00/20.00
Grade 100.00 out of 100.00

Question 1 Correct Mark 1.00 out of 1.00

True or False: Lookups simply read the data structure; as long as we can guarantee
that no insert is on-going, we can allow many lookups to proceed concurrently.

Select one:
• True

O False

The correct answer is 'True'.


Question 2 Correct Mark 1.00 out of 1.00

True or False: Condition variable is an explicit queue that threads can put
themselves on when some state of execution (i.e., some condition) is not as desired
by waiting on the condition.

Select one:
• True s /

O False

The correct answer is 'True'.

Question 3 Correct Mark 1.00 out of 1.00

True or False: To use a condition variable, one has to in addition have a lock that is
not associated with this condition.

Select one:
O True

• False

The correct answer is 'False'.

Question 4 Correct Mark 1.00 out of 1.00

True or False: In a multi-threaded application, the developer has full control over
what is scheduled at a given moment in time; rather, the programmer simply
creates threads and then hopes that the underlying OS schedules them in a
reasonable manner across available CPUs.

Select one:
O True

• False

The correct answer is 'False'.


Question 5 Correct Mark 1.00 out of 1.00

When does the deadlock occur in this code?

Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);

Select one:
O a. Thread 1 grabs lock L1

O b. Thread 2 grabs L2 and tries to acquire L1

• c. Thread 1 grabs lock L1 and then a context switch occurs to Thread 2, then Thread 2
grabs L2 and tries to acquire L1 V

O d. Deadlock does not necessarily occur

The correct answer is: Thread 1 grabs lock L1 and then a context switch occurs to Thread 2,
then Thread 2 grabs L2 and tries to acquire L1

Question 6 Correct Mark 1.00 out of 1.00

True or False: Atomicity violation bugs and order violation bugs are examples of
Non-deadlock bugs.

Select one:

• True

O False

The correct answer is 'True'.


Question 7 Correct Mark 1.00 out of 1.00

POSIX threads library are those for providing mutual exclusion to a critical section
via:

Select one:

O a. API's

O b. Multi-threaded

• c. locks

O d. Keys

The correct answer is: locks

Question 8 Correct Mark 1.00 out of 1.00

True or False: Concurrent data structures can be queues lists and counters only.

Select one:
O True

• False

The correct answer is 'False'.


Question 9 Correct Mark 1.00 out of 1.00

What command would you change to switch the letter printed by T2:

Time increases in the downwards direction, and each column shows when a
different thread (the main one, or T1, or T2) is running:

main starts running


main prints "main: begin"
main creates thread T1
main creates thread T2
main waits for T1
T1 runs
T1 prints "A"
T1 returns
main waits for T2
T2 runs
T2 prints "B"
T2 returns
main prints "main: end"

Select one:
O a. T1 =T2

O b. T1 prints "A" or "B"

• c. T2 prints "A"

O d. T2 = T1

The correct answer is: T2 prints "A"


Question 10 Correct Mark 1.00 out of 1.00

Thread 0 holds the lock (i.e., it has called sem wait() but not yet called sem post()),
and another thread (thread 1, say) tries to enter the critical section by calling sem
wait(). In this case thread 1 must wait (putting itself to sleep and relinquishing the
processor)?

Select one:
O a. thread 1will And that the value of the semaphore is -1

O b. thread 1will And that the value of the semaphore is 1

• c. thread 1will And that the value of the semaphore is 0

O d. thread 1will And that the value of the semaphore is 2

The correct answer is: thread 1will And that the value of the semaphore is 0

Question 11 Correct Mark 1.00 out of 1.00

Multi-Threaded Address Space is composed of all EXCEPT:

Select one:

O a. Stack(1)

• b. Stack (3)

O c. Program code

O d. Free

The correct answer is: Stack (3)


Question 12 Correct Mark 1.00 out of 1.00

This code is an example of receiving events via?

int select(int nfds,


fd_set ^restrict readfds,
fd_set ^restrict writefds,
fd_set ^restrict errorfds,
struct timeval ^restrict timeout);

Select one:

O a. API poll ()

• b. API select () V

O c. Select

O d. Poll

The correct answer is: API select ()

Question 13 Correct Mark 1.00 out of 1.00

The following are all key concurrency terms EXCEPT:

Select one:

O a. Mutual Exclusion

• b. Non-Critical Section V

O c. Race Condition

O d. Intermediate

The correct answer is: Non-Critical Section


Question 14 Correct Mark 1.00 out of 1.00

Spin locks must be all of the following EXCEPT:

Select one:

• a. Simple V

O b. Correct

O c. Fair

O d. Perform

The correct answer is: Simple

Question 15 Correct Mark 1.00 out of 1.00

The following stores the state of each thread:

Select one:
• a. TCB V

O b. PCB

O c. T1

O d. T2

The correct answer is: TCB


Question 16 Correct Mark 1.00 out of 1.00

What capability allows multiple people to use one system at the same time?

Select one:

O a. Multi-thread

• b. Multi-user V

O c. Distributed Processing

O d. Multitasking

The correct answer is: Multi-user

Question 17 Correct Mark 1.00 out of 1.00

True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.

Select one:
• True

O False

The correct answer is 'True'.


Question 18 Correct Mark 1.00 out of 1.00

Imagine two producers (Pa and Pb) both calling into put() at roughly the same time.
Assume producer Pa gets to run first, and just starts to fill the first buffer entry (fill
= 0 at line f1). Before Pa gets a chance to increment the fill counter to 1, it is
interrupted. Producer Pb starts to run, and at line f1 it also puts its data into the
0th element of buffer, what happens to the old data?

sem_t empty;
sem_t full;
void *producer(void *arg) {
int i;
for (i = 0; i < loops; i++) {
sem_wait(&empty); // line p1
put(i); // line p2
sem_post(&full); // line p3
}
}
void *consumer(void *arg) {
int i, tmp = 0;
while (tmp != -1) {
sem_wait(&full); // line c1
tmp = get(); // line c2
sem_post(&empty); // line c3
printf("%d\n", tmp);
}
}
int main(int argc, char *argv[]) {
// ...
sem_init(&empty, 0, MAX); // MAX buffers are empty to begin with...
sem_init(&full, 0, 0); // ... and 0 are full
// ...
}

Select one:

O a. Backed up

O b.Saved

• c. Overwritten

O d. Value = 0

The correct answer is: Overwritten


Question 19 Correct Mark 1.00 out of 1.00

How many times will this event loop execute?

e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:

Select one:
a. e

O b. 1

• c. x

O d. Null

The correct answer is: x


Question 20 Correct Mark 1.00 out of 1.00

What is the purpose of this code?

// basic node structure


typedef struct __node_t {
int key;
struct __node_t *next;
} node_t;
// basic list structure (one used per list)
typedef struct__list_t {
node_t *head;
pthread_mutex_t lock;
} list_t;
void List_Init(list_t *L) {
L->head = NULL;
pthread_mutex_init(&L->lock, NULL);
}
int List_Insert(list_t *L, int key) {
pthread_mutex_lock(&L->lock);
node_t *new = malloc(sizeof(node_t));
if (new == NULL) {
perror("maNoc");
pthread_mutex_unlock(&L->lock);
return -1; // fail
}
new->key = key;
new->next = L->head;
L->head = new;
pthread_mutex_unlock(&L->lock);
return 0; // success
}
int List_Lookup(list_t *L, int key) {
pthread_mutex_lock(&L->lock);
node_t *curr = L->head;
while (curr) {
if (curr->key == key) {
pthread_mutex_unlock(&L->lock);
return 0; // success
}
curr = curr->next;
}
pthread_mutex_unlock(&L->lock);
return -1; // failure
}

Select one:
O a. Provides a failure path when the code fails.

b. pthread_mutex_unlock(&L->lock)

O c. Acquires a lock in the insert routine upon entry, and only releases it on condition

• d. Acquires a lock in the insert routine upon entry, and only releases it on exit

The correct answer is: Acquires a lock in the insert routine upon entry, and only releases it
on exit

◄ Self-Quiz Unit 3

Jump to...

Learning Guide Unit 4 ►

/
<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > 23 July - 29 July > Graded Quiz Unit 6

Started on Saturday, 25 July 2020, 2:07 AM


State Finished
Completed on Saturday, 25 July 2020, 2:18 AM
Time taken 11 mins 12 secs
Marks 20.00/20.00
Grade 100.00 out of 100.00

Question 1 Correct Mark 1.00 out of 1.00

FFS uses APIs which include all EXCEPT:

Select one:
O a. read()

• b. move() ^

O c. write()

O d. open()

The correct answer is: move()


Question 2 Correct Mark 1.00 out of 1.00

The checkpoint region (CR) is defined as:

Select one:
O a. Unknown location to begin file lookups

O b. Region used to store checkpoints

• c. Fixed and known location on disk to begin a file lookup ^

O d. Checkpoints for time hacks

The correct answer is: Fixed and known location on disk to begin a file lookup

Question 3 Correct Mark 1.00 out of 1.00

Fast File System (FFS) does all of the following except?

Select one:
O a. Create Files and Directories

O b. Allow for long file names

• c. Disk defragmentation

O d. Disk layout optimized for performance

The correct answer is: Disk defragmentation


Question 4 Correct Mark 1.00 out of 1.00

In this method an additional back pointer is added to every block in the system; for
example, each data block has a reference to the inode to which it belongs. When
accessing a file, the file system can determine if the file is consistent by checking if
the forward pointer (e.g., the address in the inode or direct block) points to a block
that refers back to it.

Select one:

O a. Journaling

• b. Backpointer-based consistency * /

O c. FSCK

O d. Super block

The correct answer is: Backpointer-based consistency

Question 5 Correct Mark 1.00 out of 1.00

Which of the following file systems is based on linked lists?

Select one:

O a. vsfs

O b. NTFS

• c. FAT ^

O d. NTFS

The correct answer is: FAT


Question 6 Correct Mark 1.00 out of 1.00

RAID technology is evaluated along 3 axis; which is not:

Select one:

O a. Capacity

• b. N Disks

O c. Performance

O d. Reliability

The correct answer is: N Disks

Question 7 Correct Mark 1.00 out of 1.00

This method is run before the file system is mounted and made available (assumes
that no other file-system activity is on-going while it runs); once finished, the on
disk file system should be consistent and thus can be made accessible to users.

Select one:

O a. Journaling

O b. Backpointer-based consistency

• c. FSCK

O d. Super block

The correct answer is: FSCK


Question 8 Correct Mark 1.00 out of 1.00

RAID is setup with the following parameters; except (select all that apply):

Select one or more:


□ a. Handling small writes to disk

□ b. Number of Disks

✓ c. Disk 1

✓ d. Disk 2 s /

The correct answers are: Disk 1, Disk 2

Question 9 Correct Mark 1.00 out of 1.00

True or False: Internal fragmentation not only wastes space within blocks, but bad
for transfer as each block might require a positioning overhead to reach it.

Select one:
• True

O False

The correct answer is 'True'.

Question 10 Correct Mark 1.00 out of 1.00

Log-structured File Systems are based on all the following except:

Select one:
• a. Memory sizes had stabilized V

O b. File systems were not RAID-aware

O c. Existing Ale systems perform poorly on many common workloads

O d. Memory sizes were growing

The correct answer is: Memory sizes had stabilized


Question 11 Correct Mark 1.00 out of 1.00

True or False: opening, reading, or writing a file incur I/O operations.

Select one:
• True

O False

The correct answer is 'True'.

Question 12 Correct Mark 1.00 out of 1.00

Data or I/O transfer to and from a disk is always faster when it is done?

Select one:

O a. Direct

O b. Random

O c. SSTF

• d. Sequentially V

The correct answer is: Sequentially

Question 13 Correct Mark 1.00 out of 1.00

True or False: Two key abstractions of virtual storage are files and directories.

Select one:
• True s /

O False

The correct answer is 'True'.


Question 14 Correct Mark 1.00 out of 1.00

True or False: The track depicted in figure 36.1 has 12 sectors, each of which is 512
bytes in size (our typical sector size, recall) and addressed therefore by the
numbers 1 through 12.

Select one:
O True

• False

The correct answer is 'False'.

Question 15 Correct Mark 1.00 out of 1.00

To see the metadata for certain files we can issue the following commands?

Select one:
O a. lseek() or stat ()

b. SEEK_SET or SET_CUR

• c. stat() or fstat() V

O d. Input/output

The correct answer is: stat() or fstat()

Question 16 Correct Mark 1.00 out of 1.00

True or False: To compute the value of the new parity block there are two methods:
subtractive and additive.

Select one:
• True

O False

The correct answer is 'True'.


Question 17 Correct Mark 1.00 out of 1.00

True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).

Select one:
O True

• False

The correct answer is 'False'.

Question 18 Correct Mark 1.00 out of 1.00

To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?

/dev/sda1 on / type ext3 (rw)


proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda8 on /scratch type ext3 (rw)
/dev/sdb1 on /scratch.1 type xfs (rw)
/dev/sda6 on /tmp type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)
/dev/sda7 on /var/vice/cache type ext3 (rw)
/dev/sda2 on /usr type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
AFS on /afs type afs (rw)

Select one:

O a. tmpfs

O b. ext3

O c. sysfs

• d. AFS 4/

The correct answer is: AFS


Question 19 Correct Mark 1.00 out of 1.00

In terms of computer system architecture buses which of the following is not?

Select one:

O a. Peripheral

O b. Memory

• c. CPU

O d. Input/output

The correct answer is: CPU

Question 20 Correct Mark 1.00 out of 1.00

True or False: A power loss or system crash both present major challenges to a file
system attempting to update persistent data structures.

Select one:
• True

O False

The correct answer is 'True'.

◄ Self-Quiz Unit 6

Jump to...

Learning Guide Unit 7 ►

/
<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz

Started on Friday, 7 August 2020, 6:43 AM


State Finished
Completed on Friday, 7 August 2020, 7:20 AM
Time taken 37 mins 6 secs
Marks 48.00/50.00
Grade 96.00 out of 100.00
Question 1 Correct Mark 1.00 out of 1.00

In this example there are producer and consumer threads the code for a producer
puts an integer in the shared buffer loops number of times, and a consumer gets
the data out of that shared buffer each time printing it. Which line prints out the
shared buffer?

1 void *producer(void *arg) {


2 int i;
3 int loops = (int) arg;
4 for (i = 0; i < loops; i++) {
5 put(i);
6}
7}
8
9 void *consumer(void *arg) {
10 int i;
11 while (1) {
12 int tmp = get();
13 printf("%d\n", tmp);
14 }
15 }

Select one:
O a. 4 for (i = 0; i < loops; i++) {

O b. void *producer(void *arg) {

• c. 13 printf("%d\n", tmp);

O d. 1 void *producer(void *arg) {

The correct answer is: 13 printf("%d\n", tmp);


Question 2 Correct Mark 1.00 out of 1.00

Top 20 Critical Control 15: Controlled Access Based on the Need to Know is
associated with which Associated NIST Special Publication 800-53, Revision 3, and
Priority 1 Controls?

Select one:
O a. CM-8 (a, c, d, 2, 3, 4), PM-5, PM-6

O b. CA-2 (1,2), CA-7 (1,2), RA-3, RA-5 (4, 9), SA-12 (7)

• c. AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

O d. SC-18, SC-26, SI-3 (a, b, 1,2, 5, 6)

Your answer is correct.

The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

Question 3 Correct Mark 1.00 out of 1.00

True or False: To compute the value of the new parity block there are two methods:
subtractive and additive.

Select one:
• True

O False

The correct answer is 'True'.


Question 4 Correct Mark 1.00 out of 1.00

True or False: In modern systems versus older systems, disks cannot accommodate
multiple outstanding requests, and have sophisticated internal schedulers
themselves.

Select one:
O True

• False

The correct answer is 'False'.


Question 5 Correct Mark 1.00 out of 1.00

Which line is the first lock in this code?

typedef struct __counter_t {


int value;
pthread_lock_t lock;
} counter_t;
void init(counter_t *c) {
c->value = 0;
Pthread_mutex_init(&c->lock, NULL);
}
void increment(counter_t *c) {
Pthread_mutex_lock(&c->lock);
c->value++;
Pthread_mutex_unlock(&c->lock);
}
void decrement(counter_t *c) {
Pthread_mutex_lock(&c->lock);
c->value--;
Pthread_mutex_unlock(&c->lock);
}
int get(counter_t *c) {
Pthread_mutex_lock(&c->lock);
int rc = c->value;
Pthread_mutex_unlock(&c->lock);
return rc;
}

Select one:
a. Pthread_mutex_lock(&c->lock);

• b. pthread_lock_t lock; V

c. Pthread_mutex_lock(&c->lock);

d. Pthread_mutex_init(&c->lock, NULL)

Your answer is correct.

The correct answer is: pthread_lock_t lock;


Question 6 Correct Mark 1.00 out of 1.00

Multi-Threaded Address Space is composed of all EXCEPT:

Select one:

O a. Stack(1)

• b. Stack (3)

O c. Program code

O d. Free

Your answer is correct.

The correct answer is: Stack (3)

Question 7 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup what


control CM-8 means:

Select one:
O a. CONFIGURATION MANAGEMENT

O b. INTERNAL SYSTEM CONNECTION

• c. INFORMATION SYSTEM COMPONENT INVENTORY y '

O d. SECURITY ASSESSMENT

Your answer is correct.

The correct answer is: INFORMATION SYSTEM COMPONENT INVENTORY


Question 8 Correct Mark 1.00 out of 1.00

Log-structured File Systems are based on all the following except:

Select one:
• a. Memory sizes had stabilized V

O b. File systems were not RAID-aware

O c. Existing Ale systems perform poorly on many common workloads

O d. Memory sizes were growing

The correct answer is: Memory sizes had stabilized

Question 9 Correct Mark 1.00 out of 1.00

The first failure mode of interest is called a misdirected write. This arises in disk
and RAID controllers which write the data to disk correctly, except in the wrong
location. A method to address this error is called:

Select one:
O a. Cyclical redundancy check (CRC)

O b. Zettabyte File System (ZFS)

O c. Disk scrubbing

• d. Physical identifier (physical ID) ^

The correct answer is: Physical identifier (physical ID)


Question 10 Correct Mark 1.00 out of 1.00

Thread 0 holds the lock (i.e., it has called sem wait() but not yet called sem post()),
and another thread (thread 1, say) tries to enter the critical section by calling sem
wait(). In this case thread 1 must wait (putting itself to sleep and relinquishing the
processor)?

Select one:
O a. thread 1will And that the value of the semaphore is -1

O b. thread 1will And that the value of the semaphore is 1

• c. thread 1will And that the value of the semaphore is 0

O d. thread 1will And that the value of the semaphore is 2

Your answer is correct.

The correct answer is: thread 1will And that the value of the semaphore is 0

Question 11 Correct Mark 1.00 out of 1.00

The cache consistency problem actually has 2 sub problems (pick 2):

Select one or more:


□ a. Flush-on-close

✓ b. Update visibility

✓ c. Stale cache

□ d. Write buffering

Your answer is correct.

The correct answers are: Update visibility, Stale cache


Question 12 Correct Mark 1.00 out of 1.00

True or False: Internal fragmentation not only wastes space within blocks, but bad
for transfer as each block might require a positioning overhead to reach it.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 13 Correct Mark 1.00 out of 1.00

Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:

Thread 1::
void init() {

mThread = PR_CreateThread(mMain, ...);

}
Thread 2::
void mMain(...) {

mState = mThread->State;

Select one:
a. B should always be executed before A

O b. A and B should execute simultaneously

O c. The order does not matter

• d. A should always be executed before B

Your answer is correct.

The correct answer is: A should always be executed before B


Question 14 Correct Mark 1.00 out of 1.00

True or False: AFS is whole-file caching on the local disk of the client machine that is
accessing a file.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 15 Correct Mark 1.00 out of 1.00

True or False: To use a condition variable, one has to in addition have a lock that is
not associated with this condition.

Select one:
O True

• False s /

The correct answer is 'False'.


Question 16 Correct Mark 1.00 out of 1.00

What is the purpose of this code?

// basic node structure


typedef struct __node_t {
int key;
struct __node_t *next;
} node_t;
// basic list structure (one used per list)
typedef struct__list_t {
node_t *head;
pthread_mutex_t lock;
} list_t;
void List_Init(list_t *L) {
L->head = NULL;
pthread_mutex_init(&L->lock, NULL);
}
int List_Insert(list_t *L, int key) {
pthread_mutex_lock(&L->lock);
node_t *new = malloc(sizeof(node_t));
if (new == NULL) {
perror("maNoc");
pthread_mutex_unlock(&L->lock);
return -1; // fail
}
new->key = key;
new->next = L->head;
L->head = new;
pthread_mutex_unlock(&L->lock);
return 0; // success
}
int List_Lookup(list_t *L, int key) {
pthread_mutex_lock(&L->lock);
node_t *curr = L->head;
while (curr) {
if (curr->key == key) {
pthread_mutex_unlock(&L->lock);
return 0; // success
}
curr = curr->next;
}
pthread_mutex_unlock(&L->lock);
return -1; // failure
}

Select one:
O a. Provides a failure path when the code fails.

b. pthread_mutex_unlock(&L->lock)

O c. Acquires a lock in the insert routine upon entry, and only releases it on condition

• d. Acquires a lock in the insert routine upon entry, and only releases it on exit

Your answer is correct.

The correct answer is: Acquires a lock in the insert routine upon entry, and only releases it
on exit

Question 17 Incorrect Mark 0.00 out of 1.00

Spin locks must be all of the following EXCEPT:

Select one:

O a. Simple

O b. Correct

• c. Fair X

O d. Perform

Your answer is incorrect.

The correct answer is: Simple


Question 18 Correct Mark 1.00 out of 1.00

True or False: NFSv2 is a stateless protocol which means the server tracks client
states.

Select one:
O True

• False

The correct answer is 'False'.

Question 19 Correct Mark 1.00 out of 1.00

Log-structured File Systems are based on all the following except:

Select one:
• a. Memory sizes had stabilized V

O b. File systems were not RAID-aware

O c. Existing Ale systems perform poorly on many common workloads

O d. Memory sizes were growing

The correct answer is: Memory sizes had stabilized


Question 20 Correct Mark 1.00 out of 1.00

In this method an additional back pointer is added to every block in the system; for
example, each data block has a reference to the inode to which it belongs. When
accessing a file, the file system can determine if the file is consistent by checking if
the forward pointer (e.g., the address in the inode or direct block) points to a block
that refers back to it.

Select one:

O a. Journaling

• b. Backpointer-based consistency * /

O c. FSCK

O d. Super block

The correct answer is: Backpointer-based consistency

Question 21 Correct Mark 1.00 out of 1.00

The following stores the state of each thread:

Select one:
• a. TCB

O b. PCB

O c. T1

O d. T2

Your answer is correct.

The correct answer is: TCB


Question 22 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup what


control CA-2 means:

Select one:
O a. INTERNAL SYSTEM CONNECTION

O b. BOUNDARY PROTECTION

• c. SECURITY ASSESSMENT ^

O d. PENETRATION TESTING

Your answer is correct.

The correct answer is: SECURITY ASSESSMENT

Question 23 Correct Mark 1.00 out of 1.00

Data or I/O transfer to and from a disk is always faster when it is done?

Select one:
O a. Direct

O b. Random

O c. SSTF

• d. Sequentially V

Your answer is correct.

The correct answer is: Sequentially


Question 24 Correct Mark 1.00 out of 1.00

What command would you change to switch the letter printed by T2:

Time increases in the downwards direction, and each column shows when a
different thread (the main one, or T1, or T2) is running:

main starts running


main prints "main: begin"
main creates thread T1
main creates thread T2
main waits for T1
T1 runs
T1 prints "A"
T1 returns
main waits for T2
T2 runs
T2 prints "B"
T2 returns
main prints "main: end"

Select one:
O a. T1 =T2

O b. T1 prints "A" or "B"

• c. T2 prints "A"

O d. T2 = T1

Your answer is correct.

The correct answer is: T2 prints "A"


Question 25 Correct Mark 1.00 out of 1.00

Fast File System (FFS) does all of the following except?

Select one:
O a. Create Files and Directories

O b. Allow for long Ale names

• c. Disk defragmentation ^

O d. Disk layout optimized for performance

Your answer is correct.

The correct answer is: Disk defragmentation

Question 26 Correct Mark 1.00 out of 1.00

RAID is setup with the following parameters; except (select all that apply):

Select one or more:


□ a. Handling small writes to disk

□ b. Number of Disks

✓ c. Disk 1

✓ d. Disk 2 s /

Your answer is correct.

The correct answers are: Disk 1, Disk 2


Question 27 Correct Mark 1.00 out of 1.00

True or False: To compute the value of the new parity block there are two methods:
subtractive and additive.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 28 Correct Mark 1.00 out of 1.00

True or False: Warning banners are not a control on the SANS SCORE checklist.

Select one:
O True

• False

The correct answer is 'False'.

Question 29 Correct Mark 1.00 out of 1.00

Client-side file system. A client application issues system calls to the client-side file
system; which is not:

Select one:

O a. mkdir()

O b. read()

O c. write()

• d. disk write () V

Your answer is correct.

The correct answer is: disk write ()


Question 30 Incorrect Mark 0.00 out of 1.00

True or False: Enabling more concurrency always increases performance.

Select one:

• True X

O False

The correct answer is 'False'.

Question 31 Correct Mark 1.00 out of 1.00

True or False: A DMA engine is essentially a very specific device within a system
that can orchestrate transfers between devices and main memory without much
CPU intervention.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 32 Correct Mark 1.00 out of 1.00

RAID technology is evaluated along 3 axis; which is not:

Select one:

O a. Capacity

• b. N Disks

O c. Performance

O d. Reliability

Your answer is correct.

The correct answer is: N Disks


Question 33 Correct Mark 1.00 out of 1.00

True or False: Condition variable is an explicit queue that threads can put
themselves on when some state of execution (i.e., some condition) is not as desired
by waiting on the condition.

Select one:
• True s /

O False

The correct answer is 'True'.

Question 34 Correct Mark 1.00 out of 1.00

True or False: File systems have three aspects: data structures, access methods,
and data.

Select one:
O True

• False

The correct answer is 'False'.

Question 35 Correct Mark 1.00 out of 1.00

UDP uses all of the following except:

Select one:
O a. Checksum

O b. Sockets

• c. stat() or fstat() V

O d. Datagrams

Your answer is correct.

The correct answer is: stat() or fstat()


Question 36 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup least


privilege:

Select one:

O a. LP-3

O b. AC-1

• c. AC-8

O d. LP-1

Your answer is correct.

The correct answer is: AC-8

Question 37 Correct Mark 1.00 out of 1.00

True or False: Each thread has its own stack.

Select one:
• True

O False

The correct answer is 'True'.

Question 38 Correct Mark 1.00 out of 1.00

True or False: Atomicity violation bugs and order violation bugs are examples of
Non-deadlock bugs.

Select one:
• True

O False

The correct answer is 'True'.


Question 39 Correct Mark 1.00 out of 1.00

True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).

Select one:
O True

• False

The correct answer is 'False'.

Question 40 Correct Mark 1.00 out of 1.00

True or False: Condition variable is an explicit queue that threads can put
themselves on when some state of execution (i.e., some condition) is not as desired
by waiting on the condition.

Select one:
• True

O False

The correct answer is 'True'.


Question 41 Correct Mark 1.00 out of 1.00

Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:

Thread 1::
void init() {

mThread = PR_CreateThread(mMain, ...);

}
Thread 2::
void mMain(...) {

mState = mThread->State;

Select one:
a. B should always be executed before A

O b. A and B should execute simultaneously

O c. The order does not matter

• d. A should always be executed before B

The correct answer is: A should always be executed before B


Question 42 Correct Mark 1.00 out of 1.00

In the single threaded address space you will find all EXCEPT:

Select one:

O a. Heap

O b. Program code

. c. T1 V

O d. Stack

Your answer is correct.

The correct answer is: T1

Question 43 Correct Mark 1.00 out of 1.00

In terms of computer system architecture buses which of the following is not?

Select one:
O a. Peripheral

O b. Memory

• c. CPU

O d. Input/output

The correct answer is: CPU


Question 44 Correct Mark 1.00 out of 1.00

In the single threaded address space you will find all EXCEPT:

Select one:

O a. Heap

O b. Program code

. c. T1 V

O d. Stack

The correct answer is: T1

Question 45 Correct Mark 1.00 out of 1.00

True or False: opening, reading, or writing a file incur I/O operations.

Select one:
• True

O False

The correct answer is 'True'.

Question 46 Correct Mark 1.00 out of 1.00

To see the metadata for certain files we can issue the following commands?

Select one:
O a. lseek() or stat ()

b. SEEK_SET or SET_CUR

• c. stat() or fstat() V

O d. Input/output

Your answer is correct.

The correct answer is: stat() or fstat()


Question 47 Correct Mark 1.00 out of 1.00

Rate the difficulty of the course so far:

Select one:

O a. Too easy

O b. Easy

• c. Just Right V

O d. Too Hard

Your answer is correct.

The correct answers are: Too easy, Easy, Just Right, Too Hard

Question 48 Correct Mark 1.00 out of 1.00

The primary mechanism used by modern storage systems to preserve data


integrity is called the checksum. Some common functions used to compute the
checksum are all except:

Select one:
O a. Cyclical redundancy check (CRC)

• b. Forward error correction and detection V

O c. XOR-based

O d. Addition

The correct answer is: Forward error correction and detection


Question 49 Correct Mark 1.00 out of 1.00

True or False: Garbage in the file system is created when LFS leaves older versions
of file structures all over the disk, scattered throughout the disk.

Select one:

• True s /

O False

The correct answer is 'True'.


Question 50 Correct Mark 1.00 out of 1.00

Imagine two producers (Pa and Pb) both calling into put() at roughly the same time.
Assume producer Pa gets to run first, and just starts to fill the first buffer entry (fill
= 0 at line f1). Before Pa gets a chance to increment the fill counter to 1, it is
interrupted. Producer Pb starts to run, and at line f1 it also puts its data into the
0th element of buffer, what happens to the old data?

sem_t empty;
sem_t full;
void *producer(void *arg) {
int i;
for (i = 0; i < loops; i++) {
sem_wait(&empty); // line p1
put(i); // line p2
sem_post(&full); // line p3
}
}
void *consumer(void *arg) {
int i, tmp = 0;
while (tmp != -1) {
sem_wait(&full); // line c1
tmp = get(); // line c2
sem_post(&empty); // line c3
printf("%d\n", tmp);
}
}
int main(int argc, char *argv[]) {
// ...
sem_init(&empty, 0, MAX); // MAX buffers are empty to begin with...
sem_init(&full, 0, 0); // ... and 0 are full
// ...
}

Select one:

O a. Backed up

O b.Saved

• c. Overwritten

O d. Value = 0

Your answer is correct.


The correct answer is: Overwritten

◄ Learning Guide Unit 9

Jump to...

Final Exam (Proctored) ►

/
<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz

Started on Friday, 7 August 2020, 7:22 AM


State Finished
Completed on Friday, 7 August 2020, 7:44 AM
Time taken 22 mins 22 secs
Marks 49.00/50.00
Grade 98.00 out of 100.00

Question 1 Correct Mark 1.00 out of 1.00

Fast File System (FFS) does all of the following except?

Select one:
O a. Create Files and Directories

O b. Allow for long Ale names

• c. Disk defragmentation

O d. Disk layout optimized for performance

The correct answer is: Disk defragmentation

Question 2 Correct Mark 1.00 out of 1.00

True or False: All Linux systems support system logging.

Select one:
• True

O False

The correct answer is 'True'.


Question 3 Correct Mark 1.00 out of 1.00

True or False: opening, reading, or writing a file incur I/O operations.

Select one:
• True

O False

The correct answer is 'True'.

Question 4 Correct Mark 1.00 out of 1.00

True or False: UDP is more reliable than TCP because it is connection oriented
communications.

Select one:
O True

• False * /

The correct answer is 'False'.

Question 5 Correct Mark 1.00 out of 1.00

True or False: Garbage in the file system is created when LFS leaves older versions
of file structures all over the disk, scattered throughout the disk.

Select one:

• True s /

O False

The correct answer is 'True'.


Question 6 Correct Mark 1.00 out of 1.00

The protocol design of AFS is particularly important in:

Select one:

O a. Workstation caching

• b. minimizing server interactions

O c. single namespace

O d. access control lists

Your answer is correct.

The correct answer is: minimizing server interactions

Question 7 Correct Mark 1.00 out of 1.00

Top 20 Critical Security Controls for Linux includes all the following except:

Select one:
O a. Bzip2

O b. tar

O c. gzip

• d. rsynch V

Your answer is correct.

The correct answer is: rsynch


Question 8 Correct Mark 1.00 out of 1.00

True or False: A DMA engine is essentially a very specific device within a system
that can orchestrate transfers between devices and main memory without much
CPU intervention.

Select one:
• True s /

O False

The correct answer is 'True'.

Question 9 Correct Mark 1.00 out of 1.00

True or False: Lookups simply read the data structure; as long as we can guarantee
that no insert is on-going, we can allow many lookups to proceed concurrently.

Select one:
• True

O False

The correct answer is 'True'.

Question 10 Correct Mark 1.00 out of 1.00

True or False: The entity-relationship (E-R) data model perceives the real world as
consisting of basic objects, called entities, NOT the relationships among these
objects.

Select one:
O True

• False

The correct answer is 'False'.


Question 11 Correct Mark 1.00 out of 1.00

How many times will this event loop execute?

e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:

Select one:
a. e

O b. 1

• c. x

O d. Null

Your answer is correct.

The correct answer is: x

Question 12 Correct Mark 1.00 out of 1.00

What capability allows multiple people to use one system at the same time?

Select one:

O a. Multi-thread

• b. Multi-user V

O c. Distributed Processing

O d. Multitasking

The correct answer is: Multi-user


Question 13 Correct Mark 1.00 out of 1.00

In terms of computer system architecture buses which of the following is not?

Select one:

O a. Peripheral

O b. Memory

• c. CPU

O d. Input/output

Your answer is correct.

The correct answer is: CPU

Question 14 Correct Mark 1.00 out of 1.00

RAID technology can take 3 essential designs; which is not:

Select one:
O a. RAID Level 0(striping)

• b. RAID Level 1 (Parity)

O c. RAID Levels 4/5 (parity based redundancy)

O d. RAID Level 1 (mirroring)

Your answer is correct.

The correct answer is: RAID Level 1 (Parity)


Question 15 Correct Mark 1.00 out of 1.00

True or False: Enabling more concurrency always increases performance.

Select one:
O True

• False

The correct answer is 'False'.

Question 16 Correct Mark 1.00 out of 1.00

True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.

Select one:
• True

O False

The correct answer is 'True'.

Question 17 Correct Mark 1.00 out of 1.00

True or False: Concurrent data structures can be queues lists and counters only.

Select one:
O True

• False

The correct answer is 'False'.


Question 18 Correct Mark 1.00 out of 1.00

RAID technology can take 3 essential designs; which is not:

Select one:
O a. RAID Level 0(striping)

• b. RAID Level 1 (Parity) ^

O c. RAID Levels 4/5 (parity based redundancy)

O d. RAID Level 1 (mirroring)

The correct answer is: RAID Level 1 (Parity)

Question 19 Correct Mark 1.00 out of 1.00

When does the deadlock occur in this code?

Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);

Select one:

O a. Thread 1 grabs lock L1

O b. Thread 2 grabs L2 and tries to acquire L1

• c. Thread 1 grabs lock L1 and then a context switch occurs to Thread 2, then Thread 2
grabs L2 and tries to acquire L1 V

O d. Deadlock does not necessarily occur

Your answer is correct.

The correct answer is: Thread 1 grabs lock L1 and then a context switch occurs to Thread 2,
then Thread 2 grabs L2 and tries to acquire L1
Question 20 Correct Mark 1.00 out of 1.00

When checking for a condition in a multi-threaded program, using a while loop is


always correct; using an if statement only might be, depending on the semantics of
signaling. Thus, always use while and your code will behave as expected. Which
condition statement will unlock after the final condition is met?

1 // how many bytes of the heap are free?


2 int bytesLeft = MAX_HEAP_SIZE;
3
4 // need lock and condition too
5 cond_t c;
6 mutex_t m;
7
8 void *
9 allocate(int size) {
10 lock(&m);
11 while (bytesLeft < size)
12 cond_wait(&c, &m);
13 void *ptr = ...; // get mem from heap
14 bytesLeft -= size;
15 unlock(&m);
16 return ptr;
17 }
18
19 void free(void *ptr, int size) {
20 lock(&m);
21 bytesLeft += size;
22 cond_signal(&c); // whom to signal??
23 unlock(&m);
24 }

Select one:
O a. 10 lock(&m);

O b. 20 lock(&m);

O c. 15 unlock(&m)

• d. 23 unlock(&m);

Your answer is correct.

The correct answer is: 23 unlock(&m);


Question 21 Correct Mark 1.00 out of 1.00

POSIX threads library are those for providing mutual exclusion to a critical section
via:

Select one:

O a. API's

O b. Multi-threaded

• c. locks

O d. Keys

Your answer is correct.

The correct answer is: locks

Question 22 Correct Mark 1.00 out of 1.00

Which two notions were introduced by AFSv2 (pick 2):

Select one or more:


✓ a. Call back V

□ b. state

□ c. AFSv2

✓ d. File handle

Your answer is correct.

The correct answers are: Call back, File handle


Question 23 Correct Mark 1.00 out of 1.00

The test-and-set instruction, is also known as:

Select one:

O a. Lock mechanism

O b. Interrupt

• c. atomic exchange

O d. Stack

Your answer is correct.

The correct answer is: atomic exchange

Question 24 Correct Mark 1.00 out of 1.00

In this method when updating the disk, before over writing the structures in place,
first write down a little note (somewhere else on the disk, in a well-known location)
describing what you are about to do. Writing this note is the "write ahead" part,
and we write it to a structure that we organize as a "log"; hence, write.

Select one:

• a. Journaling V

O b. File system checker

O c. FSCK

O d. Super block

The correct answer is: Journaling


Question 25 Correct Mark 1.00 out of 1.00

FFS uses APIs which include all EXCEPT:

Select one:

O a. read()

• b. move()

O c. write()

O d. open()

Your answer is correct.

The correct answer is: move()

Question 26 Correct Mark 1.00 out of 1.00

True or False: A power loss or system crash both present major challenges to a file
system attempting to update persistent data structures.

Select one:
• True

O False

The correct answer is 'True'.


Question 27 Correct Mark 1.00 out of 1.00

When the file is opened for the first time, the client-side file system sends a The
LOOKUP request message from the client side for the pathname (
/home/remzi/foo.txt), the client would send three LOOKUPs which will not include:

Select one:
O a. home in the directory

O b. remzi in home

• c. foo.txt V

O d. foo.txt in remzi

Your answer is correct.

The correct answer is: foo.txt

Question 28 Correct Mark 1.00 out of 1.00

True or False: SANS SCORE checklist recommends Telnet is for remote access.

Select one:
O True

• False

The correct answer is 'False'.

Question 29 Correct Mark 1.00 out of 1.00

True or False: Lookups simply read the data structure; as long as we can guarantee
that no insert is on-going, we can allow many lookups to proceed concurrently.

Select one:
• True

O False

The correct answer is 'True'.


Question 30 Correct Mark 1.00 out of 1.00

Which of the following hie systems is based on linked lists?

Select one:

O a. vsfs

O b. NTFS

• c. FAT

O d. NTFS

Your answer is correct.

The correct answer is: FAT

Question 31 Correct Mark 1.00 out of 1.00

The checkpoint region (CR) is defined as:

Select one:
O a. Unknown location to begin file lookups

O b. Region used to store checkpoints

• c. Fixed and known location on disk to begin a file lookup

O d. Checkpoints for time hacks

The correct answer is: Fixed and known location on disk to begin a file lookup
Question 32 Correct Mark 1.00 out of 1.00

This method is run before the file system is mounted and made available (assumes
that no other file-system activity is on-going while it runs); once finished, the on
disk file system should be consistent and thus can be made accessible to users.

Select one:
O a. Journaling

O b. Backpointer-based consistency

• c. FSCK

O d. Super block

The correct answer is: FSCK

Question 33 Correct Mark 1.00 out of 1.00

True or False: The entity-relationship (E-R) data model perceives the real world as
consisting of basic objects, called entities, NOT the relationships among these
objects.

Select one:
O True

• False

The correct answer is 'False'.


Question 34 Correct Mark 1.00 out of 1.00

True or False: Server recovery after a crash is more complicated. The problem that
arises is that callbacks are kept in-memory; thus, when a server reboots, it has no
idea which client machine has which files. Thus, upon server restart, each client of
the server must realize that the server has crashed and treat all of their cache
contents as validated, and (as above) reestablish the validity of a file before using it.

Select one:
O True

• False

The correct answer is 'False'.

Question 35 Correct Mark 1.00 out of 1.00

True or False: In a multi-threaded application, the developer has full control over
what is scheduled at a given moment in time; rather, the programmer simply
creates threads and then hopes that the underlying OS schedules them in a
reasonable manner across available CPUs.

Select one:
O True

• False * ,/

The correct answer is 'False'.


Question 36 Correct Mark 1.00 out of 1.00

True or False: The track depicted in figure 36.1 has 12 sectors, each of which is 512
bytes in size (our typical sector size, recall) and addressed therefore by the
numbers 1 through 12.

Select one:
O True

• False

The correct answer is 'False'.

Question 37 Correct Mark 1.00 out of 1.00

True or False: To use a condition variable, one has to in addition have a lock that is
not associated with this condition.

Select one:
O True

• False s /

The correct answer is 'False'.


Question 38 Correct Mark 1.00 out of 1.00

Linux command used to create Boot and Rescue Disk which creates a boot disk
manually.

Select one:

O a. Makedisk

O b. TCPwrappers

O c. Xinedtd

• d. Mkbootdisk

Your answer is correct.

The correct answer is: Mkbootdisk

Question 39 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); Least privilege


can refer to operating systems.

Select one:
• True

O False

The correct answer is 'True'.


Question 40 Correct Mark 1.00 out of 1.00

In this example there are producer and consumer threads the code for a producer
puts an integer in the shared buffer loops number of times, and a consumer gets
the data out of that shared buffer each time printing it. Which line prints out the
shared buffer?

1 void *producer(void *arg) {


2 int i;
3 int loops = (int) arg;
4 for (i = 0; i < loops; i++) {
5 put(i);
6}
7}
8
9 void *consumer(void *arg) {
10 int i;
11 while (1) {
12 int tmp = get();
13 printf("%d\n", tmp);
14 }
15 }

Select one:
O a. 4 for (i = 0; i < loops; i++) {

O b. void *producer(void *arg) {

• c. 13 printf("%d\n", tmp);

O d. 1 void *producer(void *arg) {

Your answer is correct.

The correct answer is: 13 printf("%d\n", tmp);


Question 41 Correct Mark 1.00 out of 1.00

See Table 37.6. Which disk will get the parity bit P5 to remove the parity bit bottle-
nick of RAID 4:

Select one:

o a. Disk 0

o b. Disk 1

o c. Disk 2

o d. Disk 3

e. Disk 4

Your answer is correct.

The correct answer is: Disk 4

Question 42 Incorrect Mark 0.00 out of 1.00

In this method an additional back pointer is added to every block in the system; for
example, each data block has a reference to the inode to which it belongs. When
accessing a file, the file system can determine if the file is consistent by checking if
the forward pointer (e.g., the address in the inode or direct block) points to a block
that refers back to it.

Select one:
O a. Journaling

O b. Backpointer-based consistency

• c. FSCK X

O d. Super block

The correct answer is: Backpointer-based consistency


Question 43 Correct Mark 1.00 out of 1.00

RAID technology is evaluated along 3 axis; which is not:

Select one:

O a. Capacity

• b. N Disks

O c. Performance

O d. Reliability

The correct answer is: N Disks


Question 44 Correct Mark 1.00 out of 1.00

To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?

/dev/sda1 on / type ext3 (rw)


proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda8 on /scratch type ext3 (rw)
/dev/sdb1 on /scratch.1 type xfs (rw)
/dev/sda6 on /tmp type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)
/dev/sda7 on /var/vice/cache type ext3 (rw)
/dev/sda2 on /usr type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
AFS on /afs type afs (rw)

Select one:

O a. tmpfs

O b. ext3

O c. sysfs

• d. AFS

Your answer is correct.

The correct answer is: AFS


Question 45 Correct Mark 1.00 out of 1.00

This code is an example of receiving events via?

int select(int nfds,


fd_set ^restrict readfds,
fd_set ^restrict writefds,
fd_set ^restrict errorfds,
struct timeval ^restrict timeout);

Select one:

O a. API poll ()

• b. API select () V

O c. Select

O d. Poll

Your answer is correct.

The correct answer is: API select ()

Question 46 Correct Mark 1.00 out of 1.00

True or False: Two key abstractions of virtual storage are files and directories.

Select one:

• True

O False

The correct answer is 'True'.


Question 47 Correct Mark 1.00 out of 1.00

Free space management in modern file systems can be accomplished using each of
these methods EXCEPT?

Select one:
• a. free lists * /

O b. bitmaps

O c. pre-allocation policy

O d. binary tree

Your answer is correct.

The correct answer is: free lists

Question 48 Correct Mark 1.00 out of 1.00

Multi-Threaded Address Space is composed of all EXCEPT:

Select one:
O a. Stack(1)

• b. Stack (3)

O c. Program code

O d. Free

The correct answer is: Stack (3)


Question 49 Correct Mark 1.00 out of 1.00

What capability allows multiple people to use one system at the same time?

Select one:

O a. Multi-thread

• b. Multi-user V

O c. Distributed Processing

O d. Multitasking

Your answer is correct.

The correct answer is: Multi-user

Question 50 Correct Mark 1.00 out of 1.00

The following are all key concurrency terms EXCEPT:

Select one:
O a. Mutual Exclusion

• b. Non-Critical Section V

O c. Race Condition

O d. Intermediate

Your answer is correct.

The correct answer is: Non-Critical Section

◄ Learning Guide Unit 9

Jump to...

Final Exam (Proctored) ►


<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz

Started on Monday, 10 August 2020, 4:49 PM


State Finished
Completed on Monday, 10 August 2020, 5:19 PM
Time taken 30 mins 18 secs
Marks 50.00/50.00
Grade 100.00 out of 100.00

Question 1 Correct Mark 1.00 out of 1.00

The protocol design of AFS is particularly important in:

Select one:
O a. Workstation caching

• b. minimizing server interactions ^

O c. single namespace

O d. access control lists

Your answer is correct.

The correct answer is: minimizing server interactions


Question 2 Correct Mark 1.00 out of 1.00

True or False: AFS is whole-file caching on the local disk of the client machine that is
accessing a file.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 3 Correct Mark 1.00 out of 1.00

True or False: File systems have three aspects: data structures, access methods,
and data.

Select one:
O True

• False s /

The correct answer is 'False'.

Question 4 Correct Mark 1.00 out of 1.00

True or False: All Linux systems support system logging.

Select one:

• True s /

O False

The correct answer is 'True'.


Question 5 Correct Mark 1.00 out of 1.00

How many times will this event loop execute?

e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:

Select one:
a. e

O b. 1

• c. x

O d. Null

Your answer is correct.

The correct answer is: x

Question 6 Correct Mark 1.00 out of 1.00

RAID technology is evaluated along 3 axis; which is not:

Select one:

O a. Capacity

• b. N Disks

O c. Performance

O d. Reliability

Your answer is correct.

The correct answer is: N Disks


Question 7 Correct Mark 1.00 out of 1.00

Imagine two producers (Pa and Pb) both calling into put() at roughly the same time.
Assume producer Pa gets to run first, and just starts to fill the first buffer entry (fill
= 0 at line f1). Before Pa gets a chance to increment the fill counter to 1, it is
interrupted. Producer Pb starts to run, and at line f1 it also puts its data into the
0th element of buffer, what happens to the old data?

sem_t empty;
sem_t full;
void *producer(void *arg) {
int i;
for (i = 0; i < loops; i++) {
sem_wait(&empty); // line p1
put(i); // line p2
sem_post(&full); // line p3
}
}
void *consumer(void *arg) {
int i, tmp = 0;
while (tmp != -1) {
sem_wait(&full); // line c1
tmp = get(); // line c2
sem_post(&empty); // line c3
printf("%d\n", tmp);
}
}
int main(int argc, char *argv[]) {
// ...
sem_init(&empty, 0, MAX); // MAX buffers are empty to begin with...
sem_init(&full, 0, 0); // ... and 0 are full
// ...
}

Select one:

O a. Backed up

O b.Saved

• c. Overwritten

O d. Value = 0

The correct answer is: Overwritten


Question 8 Correct Mark 1.00 out of 1.00

In this method when updating the disk, before over writing the structures in place,
first write down a little note (somewhere else on the disk, in a well-known location)
describing what you are about to do. Writing this note is the "write ahead" part,
and we write it to a structure that we organize as a "log"; hence, write.

Select one:

• a. Journaling V

O b. File system checker

O c. FSCK

O d. Super block

The correct answer is: Journaling

Question 9 Correct Mark 1.00 out of 1.00

The test-and-set instruction, is also known as:

Select one:

O a. Lock mechanism

O b. Interrupt

• c. atomic exchange

O d. Stack

Your answer is correct.

The correct answer is: atomic exchange


Question 10 Correct Mark 1.00 out of 1.00

FFS uses APIs which include all EXCEPT:

Select one:

O a. read()

• b. move()

O c. write()

O d. open()

Your answer is correct.

The correct answer is: move()

Question 11 Correct Mark 1.00 out of 1.00

True or False: A DMA engine is essentially a very specific device within a system
that can orchestrate transfers between devices and main memory without much
CPU intervention.

Select one:
• True

O False

The correct answer is 'True'.

Question 12 Correct Mark 1.00 out of 1.00

True or False: Two key abstractions of virtual storage are files and directories.

Select one:
• True

O False

The correct answer is 'True'.


Question 13 Correct Mark 1.00 out of 1.00

True or False: In modern systems versus older systems, disks cannot accommodate
multiple outstanding requests, and have sophisticated internal schedulers
themselves.

Select one:
O True

• False

The correct answer is 'False'.

Question 14 Correct Mark 1.00 out of 1.00

In the single threaded address space you will find all EXCEPT:

Select one:

O a. Heap

O b. Program code

• c. T1 V

O d. Stack

Your answer is correct.

The correct answer is: T1

Question 15 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); Least privilege


can refer to operating systems.

Select one:
• True

O False

The correct answer is 'True'.


Question 16 Correct Mark 1.00 out of 1.00

True or False: UDP is more reliable than TCP because it is connection oriented
communications.

Select one:
O True

• False

The correct answer is 'False'.

Question 17 Correct Mark 1.00 out of 1.00

The following stores the state of each thread:

Select one:
• a. TCB

O b. PCB

O c. T1

O d. T2

Your answer is correct.

The correct answer is: TCB


Question 18 Correct Mark 1.00 out of 1.00

True or False: The track depicted in figure 36.1 has 12 sectors, each of which is 512
bytes in size (our typical sector size, recall) and addressed therefore by the
numbers 1 through 12.

Select one:
O True

• False

The correct answer is 'False'.

Question 19 Correct Mark 1.00 out of 1.00

Thread 0 holds the lock (i.e., it has called sem wait() but not yet called sem post()),
and another thread (thread 1, say) tries to enter the critical section by calling sem
wait(). In this case thread 1 must wait (putting itself to sleep and relinquishing the
processor)?

Select one:
O a. thread 1will find that the value of the semaphore is -1

O b. thread 1will find that the value of the semaphore is 1

• c. thread 1will find that the value of the semaphore is 0

O d. thread 1will find that the value of the semaphore is 2

Your answer is correct.

The correct answer is: thread 1will find that the value of the semaphore is 0
Question 20 Correct Mark 1.00 out of 1.00

What command would you change to switch the letter printed by T2:

Time increases in the downwards direction, and each column shows when a
different thread (the main one, or T1, or T2) is running:

main starts running


main prints "main: begin"
main creates thread T1
main creates thread T2
main waits for T1
T1 runs
T1 prints "A"
T1 returns
main waits for T2
T2 runs
T2 prints "B"
T2 returns
main prints "main: end"

Select one:
O a. T1 =T2

O b. T1 prints "A" or "B"

• c. T2 prints "A"

O d. T2 = T1

Your answer is correct.

The correct answer is: T2 prints "A"


Question 21 Correct Mark 1.00 out of 1.00

True or False: Garbage in the file system is created when LFS leaves older versions
of file structures all over the disk, scattered throughout the disk.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 22 Correct Mark 1.00 out of 1.00

Log-structured File Systems are based on all the following except:

Select one:
• a. Memory sizes had stabilized V

O b. File systems were not RAID-aware

O c. Existing file systems perform poorly on many common workloads

O d. Memory sizes were growing

The correct answer is: Memory sizes had stabilized

Question 23 Correct Mark 1.00 out of 1.00

True or False: Each thread has its own stack.

Select one:
• True

O False

The correct answer is 'True'.


Question 24 Correct Mark 1.00 out of 1.00

True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).

Select one:
O True

• False

The correct answer is 'False'.

Question 25 Correct Mark 1.00 out of 1.00

Client-side file system. A client application issues system calls to the client-side file
system; which is not:

Select one:

O a. mkdir()

O b. read()

O c. write()

• d. disk write ()

Your answer is correct.

The correct answer is: disk write ()


Question 26 Correct Mark 1.00 out of 1.00

True or False: In a multi-threaded application, the developer has full control over
what is scheduled at a given moment in time; rather, the programmer simply
creates threads and then hopes that the underlying OS schedules them in a
reasonable manner across available CPUs.

Select one:
O True

• False

The correct answer is 'False'.

Question 27 Correct Mark 1.00 out of 1.00

To see the metadata for certain files we can issue the following commands?

Select one:
O a. lseek() or stat ()

b. SEEK_SET or SET_CUR

• c. stat() or fstat() V

O d. Input/output

The correct answer is: stat() or fstat()


Question 28 Correct Mark 1.00 out of 1.00

When does the deadlock occur in this code?

Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);

Select one:
O a. Thread 1 grabs lock L1

O b. Thread 2 grabs L2 and tries to acquire L1

• c. Thread 1 grabs lock L1 and then a context switch occurs to Thread 2, then Thread 2
grabs L2 and tries to acquire L1 V

O d. Deadlock does not necessarily occur

The correct answer is: Thread 1 grabs lock L1 and then a context switch occurs to Thread 2,
then Thread 2 grabs L2 and tries to acquire L1

Question 29 Correct Mark 1.00 out of 1.00

Multi-Threaded Address Space is composed of all EXCEPT:

Select one:

O a. Stack(1)

• b. Stack (3)

O c. Program code

O d. Free

Your answer is correct.

The correct answer is: Stack (3)


Question 30 Correct Mark 1.00 out of 1.00

True or False: Internal fragmentation not only wastes space within blocks, but bad
for transfer as each block might require a positioning overhead to reach it.

Select one:

• True s /

O False

The correct answer is 'True'.

Question 31 Correct Mark 1.00 out of 1.00

Rate the difficulty of the course so far:

Select one:

O a. Too easy

O b. Easy

• c. Just Right V

O d. Too Hard

Your answer is correct.

The correct answers are: Too easy, Easy, Just Right, Too Hard
Question 32 Correct Mark 1.00 out of 1.00

Linux command used to create Boot and Rescue Disk which creates a boot disk
manually.

Select one:

O a. Makedisk

O b. TCPwrappers

O c. Xinedtd

• d. Mkbootdisk

Your answer is correct.

The correct answer is: Mkbootdisk

Question 33 Correct Mark 1.00 out of 1.00

True or False: Internal fragmentation not only wastes space within blocks, but bad
for transfer as each block might require a positioning overhead to reach it.

Select one:
• True

O False

The correct answer is 'True'.


Question 34 Correct Mark 1.00 out of 1.00

RAID is setup with the following parameters; except (select all that apply):

Select one or more:


□ a. Handling small writes to disk

□ b. Number of Disks

✓ c. Disk 1

✓ d. Disk 2 s /

Your answer is correct.

The correct answers are: Disk 1, Disk 2

Question 35 Correct Mark 1.00 out of 1.00

The following are all key concurrency terms EXCEPT:

Select one:
O a. Mutual Exclusion

• b. Non-Critical Section V

O c. Race Condition

O d. Intermediate

The correct answer is: Non-Critical Section


Question 36 Correct Mark 1.00 out of 1.00

True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.

Select one:

• True s /

O False

The correct answer is 'True'.


Question 37 Correct Mark 1.00 out of 1.00

When checking for a condition in a multi-threaded program, using a while loop is


always correct; using an if statement only might be, depending on the semantics of
signaling. Thus, always use while and your code will behave as expected. Which
condition statement will unlock after the final condition is met?

1 // how many bytes of the heap are free?


2 int bytesLeft = MAX_HEAP_SIZE;
3
4 // need lock and condition too
5 cond_t c;
6 mutex_t m;
7
8 void *
9 allocate(int size) {
10 lock(&m);
11 while (bytesLeft < size)
12 cond_wait(&c, &m);
13 void *ptr = ...; // get mem from heap
14 bytesLeft -= size;
15 unlock(&m);
16 return ptr;
17 }
18
19 void free(void *ptr, int size) {
20 lock(&m);
21 bytesLeft += size;
22 cond_signal(&c); // whom to signal??
23 unlock(&m);
24 }

Select one:
O a. 10 lock(&m);

O b. 20 lock(&m);

O c. 15 unlock(&m)

• d. 23 unlock(&m);

Your answer is correct.

The correct answer is: 23 unlock(&m);


Question 38 Correct Mark 1.00 out of 1.00

Top 20 Critical Control 15: Controlled Access Based on the Need to Know is
associated with which Associated NIST Special Publication 800-53, Revision 3, and
Priority 1 Controls?

Select one:
O a. CM-8 (a, c, d, 2, 3, 4), PM-5, PM-6

O b. CA-2 (1,2), CA-7 (1,2), RA-3, RA-5 (4, 9), SA-12 (7)

• c. AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

O d. SC-18, SC-26, SI-3 (a, b, 1,2, 5, 6)

Your answer is correct.

The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

Question 39 Correct Mark 1.00 out of 1.00

This code is an example of receiving events via?

int select(int nfds,


fd_set ^restrict readfds,
fd_set ^restrict writefds,
fd_set ^restrict errorfds,
struct timeval ^restrict timeout);

Select one:

O a. API poll ()

• b. API select () V

O c. Select

O d. Poll

The correct answer is: API select ()


Question 40 Correct Mark 1.00 out of 1.00

The checkpoint region (CR) is defined as:

Select one:
O a. Unknown location to begin file lookups

O b. Region used to store checkpoints

• c. Fixed and known location on disk to begin a file lookup ^

O d. Checkpoints for time hacks

The correct answer is: Fixed and known location on disk to begin a file lookup

Question 41 Correct Mark 1.00 out of 1.00

The cache consistency problem actually has 2 sub problems (pick 2):

Select one or more:


□ a. Flush-on-close

✓ b. Update visibility

✓ c. Stale cache

□ d. Write buffering

Your answer is correct.

The correct answers are: Update visibility, Stale cache


Question 42 Correct Mark 1.00 out of 1.00

Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:

Thread 1::
void init() {

mThread = PR_CreateThread(mMain, ...);

}
Thread 2::
void mMain(...) {

mState = mThread->State;

Select one:
a. B should always be executed before A

O b. A and B should execute simultaneously

O c. The order does not matter

• d. A should always be executed before B

Your answer is correct.

The correct answer is: A should always be executed before B


Question 43 Correct Mark 1.00 out of 1.00

The first failure mode of interest is called a misdirected write. This arises in disk
and RAID controllers which write the data to disk correctly, except in the wrong
location. A method to address this error is called:

Select one:
O a. Cyclical redundancy check (CRC)

O b. Zettabyte File System (ZFS)

O c. Disk scrubbing

• d. Physical identifier (physical ID)

The correct answer is: Physical identifier (physical ID)

Question 44 Correct Mark 1.00 out of 1.00

True or False: In modern systems versus older systems, disks cannot accommodate
multiple outstanding requests, and have sophisticated internal schedulers
themselves.

Select one:
O True

• False

The correct answer is 'False'.


Question 45 Correct Mark 1.00 out of 1.00

True or False: In a multi-threaded application, the developer has full control over
what is scheduled at a given moment in time; rather, the programmer simply
creates threads and then hopes that the underlying OS schedules them in a
reasonable manner across available CPUs.

Select one:
O True

• False

The correct answer is 'False'.


Question 46 Correct Mark 1.00 out of 1.00

In this example there are producer and consumer threads the code for a producer
puts an integer in the shared buffer loops number of times, and a consumer gets
the data out of that shared buffer each time printing it. Which line prints out the
shared buffer?

1 void *producer(void *arg) {


2 int i;
3 int loops = (int) arg;
4 for (i = 0; i < loops; i++) {
5 put(i);
6}
7}
8
9 void *consumer(void *arg) {
10 int i;
11 while (1) {
12 int tmp = get();
13 printf("%d\n", tmp);
14 }
15 }

Select one:
O a. 4 for (i = 0; i < loops; i++) {

O b. void *producer(void *arg) {

• c. 13 printf("%d\n", tmp);

O d. 1 void *producer(void *arg) {

Your answer is correct.

The correct answer is: 13 printf("%d\n", tmp);


Question 47 Correct Mark 1.00 out of 1.00

To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?

/dev/sda1 on / type ext3 (rw)


proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda8 on /scratch type ext3 (rw)
/dev/sdb1 on /scratch.1 type xfs (rw)
/dev/sda6 on /tmp type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)
/dev/sda7 on /var/vice/cache type ext3 (rw)
/dev/sda2 on /usr type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
AFS on /afs type afs (rw)

Select one:

O a. tmpfs

O b. ext3

O c. sysfs

• d. AFS

Your answer is correct.

The correct answer is: AFS


Question 48 Correct Mark 1.00 out of 1.00

Which line is the first lock in this code?

typedef struct __counter_t {


int value;
pthread_lock_t lock;
} counter_t;
void init(counter_t *c) {
c->value = 0;
Pthread_mutex_init(&c->lock, NULL);
}
void increment(counter_t *c) {
Pthread_mutex_lock(&c->lock);
c->value++;
Pthread_mutex_unlock(&c->lock);
}
void decrement(counter_t *c) {
Pthread_mutex_lock(&c->lock);
c->value--;
Pthread_mutex_unlock(&c->lock);
}
int get(counter_t *c) {
Pthread_mutex_lock(&c->lock);
int rc = c->value;
Pthread_mutex_unlock(&c->lock);
return rc;
}

Select one:
a. Pthread_mutex_lock(&c->lock);

• b. pthread_lock_t lock; V

c. Pthread_mutex_lock(&c->lock);

d. Pthread_mutex_init(&c->lock, NULL)

Your answer is correct.

The correct answer is: pthread_lock_t lock;


Question 49 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup what


control CA-2 means:

Select one:
O a. INTERNAL SYSTEM CONNECTION

O b. BOUNDARY PROTECTION

• c. SECURITY ASSESSMENT ^

O d. PENETRATION TESTING

Your answer is correct.

The correct answer is: SECURITY ASSESSMENT

Question 50 Correct Mark 1.00 out of 1.00

Which of the following file systems is based on linked lists?

Select one:
O a. vsfs

O b. NTFS

• c. FAT

O d. NTFS

Your answer is correct.

The correct answer is: FAT

◄ Learning Guide Unit 9

Jump to...

Final Exam (Proctored) ►


<S Suleman Ismaila

Home > My courses > CS 3307 - AY2020-T5 > 6 August - 12 August > Self-Quiz Unit 8

Started on Thursday, 6 August 2020, 9:42 AM


State Finished
Completed on Thursday, 6 August 2020, 9:45 AM
Time taken 3 mins 29 secs
Grade 10.00 out of 10.00 (100%)

Question 1 Correct Mark 1.00 out of 1.00

True or False: Warning banners are not a control on the SANS SCORE checklist.

Select one:
O True

• False

The correct answer is 'False'.


Question 2 Correct Mark 1.00 out of 1.00

Top 20 Critical Security Controls for Linux includes all the following except:

Select one:

O a. Bzip2

O b. tar

O c. gzip

• d. rsynch V

Your answer is correct.

The correct answer is: rsynch

Question 3 Correct Mark 1.00 out of 1.00

True or False: All Linux systems support system logging.

Select one:
• True

O False

The correct answer is 'True'.


Question 4 Correct Mark 1.00 out of 1.00

Linux command used to create Boot and Rescue Disk which creates a boot disk
manually.

Select one:

O a. Makedisk

O b. TCPwrappers

O c. Xinedtd

• d. Mkbootdisk

Your answer is correct.

The correct answer is: Mkbootdisk

Question 5 Correct Mark 1.00 out of 1.00

True or False: SANS SCORE checklist recommends Telnet is for remote access.

Select one:
O True

• False

The correct answer is 'False'.


Question 6 Correct Mark 1.00 out of 1.00

Top 20 Critical Control 15: Controlled Access Based on the Need to Know is
associated with which Associated NIST Special Publication 800-53, Revision 3, and
Priority 1 Controls?

Select one:
O a. CM-8 (a, c, d, 2, 3, 4), PM-5, PM-6

O b. CA-2 (1,2), CA-7 (1,2), RA-3, RA-5 (4, 9), SA-12 (7)

• c. AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

O d. SC-18, SC-26, SI-3 (a, b, 1,2, 5, 6)

Your answer is correct.

The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)

Question 7 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup what


control CA-2 means:

Select one:
O a. INTERNAL SYSTEM CONNECTION

O b. BOUNDARY PROTECTION

• c. SECURITY ASSESSMENT

O d. PENETRATION TESTING

Your answer is correct.

The correct answer is: SECURITY ASSESSMENT


Question 8 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup what


control CM-8 means:

Select one:
O a. CONFIGURATION MANAGEMENT

O b. INTERNAL SYSTEM CONNECTION

• c. INFORMATION SYSTEM COMPONENT INVENTORY ^

O d. SECURITY ASSESSMENT

Your answer is correct.

The correct answer is: INFORMATION SYSTEM COMPONENT INVENTORY

Question 9 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); lookup least


privilege:

Select one:

O a. LP-3

O b. AC-1

• c. AC-8 ^

O d. LP-1

Your answer is correct.

The correct answer is: AC-8


Question 10 Correct Mark 1.00 out of 1.00

NIST Publication 800-53 (Appendix F SECURITY CONTROL CATALOG); Least privilege


can refer to operating systems.

Select one:

• True s /

O False

The correct answer is 'True'.

◄ Learning Guide Unit 8

Jump to...

CS 3307 Course Evaluation ►

You might also like