Professional Documents
Culture Documents
Full Exam Prep Cs 3307 PDF
Full Exam Prep Cs 3307 PDF
Home > My courses > CS 3307 - AY2020-T5 > 2 July - 8 July > Graded Quiz Unit 3
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
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
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
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
Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);
Select one:
O a. Thread 1 grabs lock 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
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
True or False: Atomicity violation bugs and order violation bugs are examples of
Non-deadlock bugs.
Select one:
• True
O False
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
True or False: Concurrent data structures can be queues lists and counters only.
Select one:
O True
• False
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:
Select one:
O a. T1 =T2
• c. T2 prints "A"
O d. T2 = T1
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
The correct answer is: thread 1will And that the value of the semaphore is 0
Select one:
O a. Stack(1)
• b. Stack (3)
O c. Program code
O d. Free
Select one:
O a. API poll ()
• b. API select () V
O c. Select
O d. Poll
Select one:
O a. Mutual Exclusion
• b. Non-Critical Section V
O c. Race Condition
O d. Intermediate
Select one:
• a. Simple V
O b. Correct
O c. Fair
O d. Perform
Select one:
• a. TCB V
O b. PCB
O c. T1
O d. T2
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
True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.
Select one:
• True
O False
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
e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:
Select one:
a. e
O b. 1
• c. x
O d. Null
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...
/
<S Suleman Ismaila
Home > My courses > CS 3307 - AY2020-T5 > 23 July - 29 July > Graded Quiz Unit 6
Select one:
O a. read()
• b. move() ^
O c. write()
O d. open()
Select one:
O a. Unknown location to begin file lookups
The correct answer is: Fixed and known location on disk to begin a file lookup
Select one:
O a. Create Files and Directories
• c. Disk defragmentation
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
Select one:
O a. vsfs
O b. NTFS
• c. FAT ^
O d. NTFS
Select one:
O a. Capacity
• b. N Disks
O c. Performance
O d. Reliability
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
RAID is setup with the following parameters; except (select all that apply):
□ b. Number of Disks
✓ c. Disk 1
✓ d. Disk 2 s /
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
Select one:
• a. Memory sizes had stabilized V
Select one:
• True
O False
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
True or False: Two key abstractions of virtual storage are files and directories.
Select one:
• True s /
O False
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
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
True or False: To compute the value of the new parity block there are two methods:
subtractive and additive.
Select one:
• True
O False
True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).
Select one:
O True
• False
To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?
Select one:
O a. tmpfs
O b. ext3
O c. sysfs
• d. AFS 4/
Select one:
O a. Peripheral
O b. Memory
• c. CPU
O d. Input/output
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
◄ Self-Quiz Unit 6
Jump to...
/
<S Suleman Ismaila
Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz
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?
Select one:
O a. 4 for (i = 0; i < loops; i++) {
• c. 13 printf("%d\n", tmp);
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)
The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)
True or False: To compute the value of the new parity block there are two methods:
subtractive and additive.
Select one:
• True
O False
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
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)
Select one:
O a. Stack(1)
• b. Stack (3)
O c. Program code
O d. Free
Select one:
O a. CONFIGURATION MANAGEMENT
O d. SECURITY ASSESSMENT
Select one:
• a. Memory sizes had stabilized V
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 c. Disk scrubbing
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
The correct answer is: thread 1will And that the value of the semaphore is 0
The cache consistency problem actually has 2 sub problems (pick 2):
✓ b. Update visibility
✓ c. Stale cache
□ d. Write buffering
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
Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:
Thread 1::
void init() {
}
Thread 2::
void mMain(...) {
mState = mThread->State;
Select one:
a. B should always be executed before A
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
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 /
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
Select one:
O a. Simple
O b. Correct
• c. Fair X
O d. Perform
True or False: NFSv2 is a stateless protocol which means the server tracks client
states.
Select one:
O True
• False
Select one:
• a. Memory sizes had stabilized V
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
Select one:
• a. TCB
O b. PCB
O c. T1
O d. T2
Select one:
O a. INTERNAL SYSTEM CONNECTION
O b. BOUNDARY PROTECTION
• c. SECURITY ASSESSMENT ^
O d. PENETRATION TESTING
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
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:
Select one:
O a. T1 =T2
• c. T2 prints "A"
O d. T2 = T1
Select one:
O a. Create Files and Directories
• c. Disk defragmentation ^
RAID is setup with the following parameters; except (select all that apply):
□ b. Number of Disks
✓ c. Disk 1
✓ d. Disk 2 s /
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
True or False: Warning banners are not a control on the SANS SCORE checklist.
Select one:
O True
• False
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
Select one:
• True X
O False
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
Select one:
O a. Capacity
• b. N Disks
O c. Performance
O d. Reliability
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
True or False: File systems have three aspects: data structures, access methods,
and data.
Select one:
O True
• False
Select one:
O a. Checksum
O b. Sockets
• c. stat() or fstat() V
O d. Datagrams
Select one:
O a. LP-3
O b. AC-1
• c. AC-8
O d. LP-1
Select one:
• True
O False
True or False: Atomicity violation bugs and order violation bugs are examples of
Non-deadlock bugs.
Select one:
• True
O False
True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).
Select one:
O True
• False
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
Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:
Thread 1::
void init() {
}
Thread 2::
void mMain(...) {
mState = mThread->State;
Select one:
a. B should always be executed before A
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
Select one:
O a. Peripheral
O b. Memory
• c. CPU
O d. Input/output
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
Select one:
• True
O False
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
Select one:
O a. Too easy
O b. Easy
• c. Just Right V
O d. Too Hard
The correct answers are: Too easy, Easy, Just Right, Too Hard
Select one:
O a. Cyclical redundancy check (CRC)
O c. XOR-based
O d. Addition
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
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
Jump to...
/
<S Suleman Ismaila
Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz
Select one:
O a. Create Files and Directories
• c. Disk defragmentation
Select one:
• True
O False
Select one:
• True
O False
True or False: UDP is more reliable than TCP because it is connection oriented
communications.
Select one:
O True
• False * /
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
Select one:
O a. Workstation caching
O c. single namespace
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
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
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
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
e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:
Select one:
a. e
O b. 1
• c. x
O d. Null
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
Select one:
O a. Peripheral
O b. Memory
• c. CPU
O d. Input/output
Select one:
O a. RAID Level 0(striping)
Select one:
O True
• False
True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.
Select one:
• True
O False
True or False: Concurrent data structures can be queues lists and counters only.
Select one:
O True
• False
Select one:
O a. RAID Level 0(striping)
Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);
Select one:
• 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
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
Select one:
O a. 10 lock(&m);
O b. 20 lock(&m);
O c. 15 unlock(&m)
• d. 23 unlock(&m);
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
□ b. state
□ c. AFSv2
✓ d. File handle
Select one:
O a. Lock mechanism
O b. Interrupt
• c. atomic exchange
O d. Stack
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 c. FSCK
O d. Super block
Select one:
O a. read()
• b. move()
O c. write()
O d. open()
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
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
True or False: SANS SCORE checklist recommends Telnet is for remote access.
Select one:
O True
• False
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
Select one:
O a. vsfs
O b. NTFS
• c. FAT
O d. NTFS
Select one:
O a. Unknown location to begin file lookups
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
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
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
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 * ,/
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
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 /
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
Select one:
• True
O False
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?
Select one:
O a. 4 for (i = 0; i < loops; i++) {
• c. 13 printf("%d\n", tmp);
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
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
Select one:
O a. Capacity
• b. N Disks
O c. Performance
O d. Reliability
To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?
Select one:
O a. tmpfs
O b. ext3
O c. sysfs
• d. AFS
Select one:
O a. API poll ()
• b. API select () V
O c. Select
O d. Poll
True or False: Two key abstractions of virtual storage are files and directories.
Select one:
• True
O False
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
Select one:
O a. Stack(1)
• b. Stack (3)
O c. Program code
O d. Free
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
Select one:
O a. Mutual Exclusion
• b. Non-Critical Section V
O c. Race Condition
O d. Intermediate
Jump to...
Home > My courses > CS 3307 - AY2020-T5 > Final Exam (Days 1 - 4) > Review Quiz
Select one:
O a. Workstation caching
O c. single namespace
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
True or False: File systems have three aspects: data structures, access methods,
and data.
Select one:
O True
• False s /
Select one:
• True s /
O False
e
while (1) {
events = getEvents();
for (x in events)
processEvent(x);
}:
Select one:
a. e
O b. 1
• c. x
O d. Null
Select one:
O a. Capacity
• b. N Disks
O c. Performance
O d. Reliability
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
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 c. FSCK
O d. Super block
Select one:
O a. Lock mechanism
O b. Interrupt
• c. atomic exchange
O d. Stack
Select one:
O a. read()
• b. move()
O c. write()
O d. open()
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
True or False: Two key abstractions of virtual storage are files and directories.
Select one:
• True
O False
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
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
Select one:
• True
O False
True or False: UDP is more reliable than TCP because it is connection oriented
communications.
Select one:
O True
• False
Select one:
• a. TCB
O b. PCB
O c. T1
O d. T2
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
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
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:
Select one:
O a. T1 =T2
• c. T2 prints "A"
O d. T2 = T1
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
Select one:
• a. Memory sizes had stabilized V
Select one:
• True
O False
True or False: Inodes are organized in an array and placed on disk at a random
location (or locations).
Select one:
O True
• False
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 ()
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
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
Thread 1: Thread 2:
lock(L1); lock(L2);
lock(L2); lock(L1);
Select one:
O a. Thread 1 grabs lock 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
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
Select one:
O a. Stack(1)
• b. Stack (3)
O c. Program code
O d. Free
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
Select one:
O a. Too easy
O b. Easy
• c. Just Right V
O d. Too Hard
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
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
RAID is setup with the following parameters; except (select all that apply):
□ b. Number of Disks
✓ c. Disk 1
✓ d. Disk 2 s /
Select one:
O a. Mutual Exclusion
• b. Non-Critical Section V
O c. Race Condition
O d. Intermediate
True or False: Locks work through mutual exclusion which preventing multiple
threads from entering a critical section.
Select one:
• True s /
O False
Select one:
O a. 10 lock(&m);
O b. 20 lock(&m);
O c. 15 unlock(&m)
• d. 23 unlock(&m);
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)
The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)
Select one:
O a. API poll ()
• b. API select () V
O c. Select
O d. Poll
Select one:
O a. Unknown location to begin file lookups
The correct answer is: Fixed and known location on disk to begin a file lookup
The cache consistency problem actually has 2 sub problems (pick 2):
✓ b. Update visibility
✓ c. Stale cache
□ d. Write buffering
Order violations occur assuming mThread is initially set to NULL; it is assumed that
the following is true:
Thread 1::
void init() {
}
Thread 2::
void mMain(...) {
mState = mThread->State;
Select one:
a. B should always be executed before A
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 c. Disk scrubbing
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
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
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?
Select one:
O a. 4 for (i = 0; i < loops; i++) {
• c. 13 printf("%d\n", tmp);
To see what is mounted on your system, and at which points, simply run the mount
program. What distributed file systems are mounted?
Select one:
O a. tmpfs
O b. ext3
O c. sysfs
• d. AFS
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)
Select one:
O a. INTERNAL SYSTEM CONNECTION
O b. BOUNDARY PROTECTION
• c. SECURITY ASSESSMENT ^
O d. PENETRATION TESTING
Select one:
O a. vsfs
O b. NTFS
• c. FAT
O d. NTFS
Jump to...
Home > My courses > CS 3307 - AY2020-T5 > 6 August - 12 August > Self-Quiz Unit 8
True or False: Warning banners are not a control on the SANS SCORE checklist.
Select one:
O True
• False
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
Select one:
• True
O False
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
True or False: SANS SCORE checklist recommends Telnet is for remote access.
Select one:
O True
• False
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)
The correct answer is: AC-1, AC-2 (b, c), AC-3 (4), AC-4, AC-6, MP-3, RA-2 (a)
Select one:
O a. INTERNAL SYSTEM CONNECTION
O b. BOUNDARY PROTECTION
• c. SECURITY ASSESSMENT
O d. PENETRATION TESTING
Select one:
O a. CONFIGURATION MANAGEMENT
O d. SECURITY ASSESSMENT
Select one:
O a. LP-3
O b. AC-1
• c. AC-8 ^
O d. LP-1
Select one:
• True s /
O False
Jump to...