Kiểm tra Chương 3 và 4 - Hệ Điều Hành
Kiểm tra Chương 3 và 4 - Hệ Điều Hành
13 14 15 16
Question 1 Given the following system information:
17 18 19 20 Correct
ALLOCATION
Show one page at Mark 1.00 out of
REQUEST AVBALABLE
a time 1.00
PROCESS A B C
A B C A B
C
P0 0 1
0 0 0 0
0 0 0
P1 2 0
0 2 0 2
P2 3 0
3 0 0 1
[Link] Page 1 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P3 2 1
1 1 0 0
P4 0 0
2 0 0 2
Select one:
There algorithm results in FINISH=(T, F, T, F, F),
thus P1, P3 and P4 are in a deadlock.
Flag question
[Link] Page 2 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Select one:
Claim edge.
Request edge.
Assignment edge.
[Link] Page 3 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(T, T, F), WORK=(10)
[Link] Page 4 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
[Link] Page 5 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Select one:
1
-1
NULL
[Link] Page 6 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
var val=0;
waitForNewRequest();
if(found){
hit+=1;
val=hit;
Respond();
Select one:
Respond();
if(found){ ...}
waitForNewRequest();
[Link] Page 7 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
do {
wait(conner[i]);
wait(conner[(i+1)%4]);
Get_Over_The_Crossroad
(i);
signal(conner[i]);
signal(conner[(i+1)%4]
;
Continue_Going(i);
[Link] Page 8 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
} while (TRUE);
Select one:
At a time, only a car can go through the
crossroad
PROCESS A B C
A B C A B
C
[Link] Page 9 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 0
1 0 7 5
3 2 3 0
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(T, T, T, T, F), WORK=(9, 5, 5)
[Link] Page 10 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
[Link] Page 11 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
remove a proce
ss P from S->L;
wakeup(P);
Select one:
Since we have the waiting queue, there no
need to have the variable S->value in the
semaphore S
PROCESS A B C
A B C A B
C
P0 0
1 0 7 5
3 2 3 0
[Link] Page 12 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(T, F, T, T, F), WORK=(9, 5, 6)
Flag question
[Link] Page 13 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Select one:
Assignment edge.
Claim edge.
Request edge.
//Some code
int val=buf;
[Link] Page 14 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
buf=val
Select one:
The globally shared variable buf will always
get an incorrect value when there are more
than 2 instances of the code running.
//Some code
[Link] Page 15 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
val += count();//2. A
time consuming function
buf=val; //3.
val=val*4; //4.
Select one:
There is a race condition in the code.
[Link] Page 16 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
Answer:
Claim
PROCESS A B
C A B C
A B C
[Link] Page 17 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 0
3 0 7 5
3 2 1 0
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(F, T, F, F, F), WORK=(2, 1, 0)
[Link] Page 18 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
Pro Allocation
Max
Available
A B
C A B
C A B
C
P0 0 0
1 0 0
1 1 5
2
P1 1 0
0 1 7
5
P2 1 3
5 2 3
5
P3 0 6
3 0 6
5
P4 0 0
1 0 6
5
Select one:
[Link] Page 19 of 20
Câu Hỏi 48 Hoàn thành
Cho một ổ đĩa cứng gồm 16 đĩa (surfaces), mỗi đĩa có 128 tracks, mỗi track có 256 sectors, mỗi sector
có thể lưu trữ dữ liệu kích thước 512 bytes. Cần bao nhiêu bit để có thể biểu diễn địa chỉ của một
sector trên đĩa?
Answer: 28
Để vừa đảm bảo hiệu năng và tính an toàn cho hệ thống, loại RAID nào được sử dụng?
Chọn câu:
a. RAID 3
b. RAID 2
c. RAID 1
d. RAID 0+1
Thành phần nào sau giữ thông tin trạng thái về việc sử dụng các thiết bị vào/ra
Chọn câu:
b. Bộ xử lý CPU
d. Bộ nhớ trong
/
UETOTS Phan Công Hậu
Flag question Once a process is executed, it can only be switched into terminated state
Question 2 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15. Which is
the response time of P2?
Mark 1.00 out of
1.00
Select one:
Flag question
10
20
15
Question 3 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several processes, a process may have several programs
Flag question An application may have several programs, a program may have several processes
An application may have several programs, a program has only one process
An application has only one program, a program has only one process
Flag question Valid states are new, ready, running, waiting and terminated
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the process
Correct are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
37
Response time
Question 8 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Flag question
Question 9 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 10 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of P1 ?
Flag question
Is an instance of a program
Question 12 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
18
15
16
17
Question 13 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of process P3 ?
/
Question 14 Which module should NOT be implemented in the kernel of operating systems?
Correct
Select one:
Mark 1.00 out of
1.00 Process management module
Networking module
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Question 17 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Answer: P1 P3 P2 P4
Flag question
Question 19 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of process P2 ?
10
Question 20 Select INCORRECT description about the main tasks of operating systems
Correct
Select one:
Mark 1.00 out of
1.00 Provide database management systems (e.g. MS SQL Server)
/
Finish review
/
UETOTS Phan Anh
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
Because the system has many processes to run and they need to be treated equally
Because we need to utilize the memory more effectively
[Link]();
add AX, BX
/
Question 4 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
15
20
10
0
Quick-term scheduler
Long-term scheduler
Uni-programming
Multi-programming
Question 8 Select the best description about operating systems for computers
Correct
Select one:
/
Mark 1.00 out of They are applications
1.00
They are libraries
Flag question
They are software that are between users and computer hardware
They are firmware
Question 10 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the
Correct process are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
27
37
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
Remove flag Allow operating systems on the same hardware to use some resources (such as IP,
port, domain name,...) independently
Utilize RAM and CPU more effectively
Allow multiple operating system to run on the same hardware
/
Question 13 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
C++
C
Question 15 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
10
0
20
15
Embedded system
Sequential system,
Round robin
None of the above
Layered
Micro-kernel
Question 20 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Answer: 15.75
Flag question
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
You are logged in as Phan Anh (Log out)
S2INT2206_9_1920
/
UETOTS Nguyễn Thị Huệ
Question 1 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Correct information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Remove flag
Answer: 63
Embedded
/
Question 4 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
P4 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of
Correct processes are P1(21), P2(10), P3(6). Which is the throughput of the system?
0.1
Question 6 Suppose a system uses SRTF scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,15). Show the order (e.g. P2, P1,
P3, P4) in which the processes are run?
Mark 1.00 out of
1.00
Answer: P1, P3, P2, P4, P3
Remove flag
Question 8 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0
10
15
20 /
Question 9 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes
Correct information (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total
waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Remove flag
17
16
18
15
Question 10 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Remove flag
Question 12 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Answer: 3
Remove flag
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
/
Because we need to utilize the memory more effectively
Question 14 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P2?
Mark 1.00 out of
1.00
Select one:
Remove flag
5
20
0
10
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 17 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the throughput of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0.04
0.02
0.01
0.03
/
Question 18 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program may have several processes
Flag question An application may have several processes, a process may have several programs
An application has only one program, a program has only one process
An application may have several programs, a program has only one process
Sequential system,
Uni-programming operating system
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
UETOTS Phan Anh
Question 1 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and the pointer is 4
byte. Given the logical address x=98364. Which is the correct information about the location
Mark 1.00 out of
of the above address?
1.00
Question 2 Given the following RAID system in the following figure. Suppose each disk is 500GB,
Correct which is the maximum size of data can be stored on the system?
Flag question
Select one:
approximate 1 TB
approximate 3 TB /
approximate 1.5 TB
approximate 2 TB
Question 3 Suppose a level-6 RAID system has 12 hard-disks of size 500 GB. How much is the
Correct performance of the system improved?
Question 4 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 53; Disk request string is 98, 183, 37, 122, 14, 124, 65, 67. Suppose SSTF disk
scheduling algorithm is used, calculate the total cylinders the head has to move to serve the
Mark 1.00 out of
above requests (e.g. 432)?
1.00
Flag question
Answer: 236
Question 5 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 75 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14. Suppose LOOK disk scheduling algorithm is used, calculate the total number of
Mark 1.00 out of
cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 277
Question 6 A system uses linked list disk allocation with the block size of 2KB; the pointer size of 4
Correct bytes. Suppose a file has the size of 15.5MB. Calculate the offset in the block containing
data at file offset (from 0) 68 KB?
Mark 1.00 out of
1.00
Answer: 140
Remove flag
Question 7 Suppose a system uses (1-level) indexed allocation with the block size of 4KB; the pointer
Correct size of 4 bytes. A file has the size of 3MB. Which is the correct location at the file offset
(from 0) 27 KB?
Mark 1.00 out of
1.00
Select one:
Remove flag
(block index, offset)=(7, 3071) /
(block index, offset)=(8, 3071)
(block index, offset)=(7, 3072)
(block index, offset)=(8, 3072)
Question 8 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the
Correct size of 12.3MB. Which is the correct location of the file offset (from 0) 415 KB?
Question 9 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 161; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS disk scheduling
algorithm is used, calculate the total cylinders the head has to move to serve the above
Mark 1.00 out of
requests (e.g. 432)?
1.00
Flag question
Answer: 496
Question 10 Given the following RAID system in the following figure. How much is the performance of
Correct the system improved?
Flag question
Select one:
2 times
4 times
5 times
3 times
/
Question 11 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 2KB, and the pointer is 4
bytes. Given a valid logical address x=2493668. Which is the correct information about the
Mark 1.00 out of
location of the above address?
1.00
Question 12 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 53 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14, 124, 65, 67. Suppose C-LOOK disk scheduling algorithm is used (serving direction
Mark 1.00 out of
is from 0 to 199), calculate the total number of cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 322
Question 13 A system uses extent-based disk allocation with the block size of 2KB. An extent consists of
Correct 100 blocks; a file has the size of 25.3MB. Calculate the extent number (starting from 0) at
file offset (from 0) 14MB?
Mark 1.00 out of
1.00
Answer: 71
Flag question
Question 14 A system uses linked list disk allocation with the block size of 2KB; the pointer size of 4
Correct bytes. Suppose a file has the size of 15.5MB. Calculate the block number (starting from 0)
of the location at file offset (from 0) 68 KB?
Mark 1.00 out of
1.00
Answer: 34
Flag question
Question 15 Suppose a system uses (1-level) indexed allocation with the block size of 4KB; the pointer
Correct size of 4 bytes. A file has the size of 3MB. Which is the correct location at the file offset
(from 0) 35KB?
Mark 1.00 out of
1.00
Select one:
Flag question
(block index, offset)=(8, 3072)
Question 16 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 56 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14. Suppose LOOK disk scheduling algorithm is used, calculate the total number of
Mark 1.00 out of
cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 296
Question 17 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Incorrect double indirect pointer, 1 triple indirect pointer; the block size is 2KB, and the pointer is 4
bytes. Given a valid logical address x=2493668. Which is the correct information about the
Mark 0.00 out of
location of the above address?
1.00
Question 18 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 17; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS disk scheduling
algorithm is used, calculate the total cylinders the head has to move to serve the above
Mark 1.00 out of
requests (e.g. 432)?
1.00
Flag question
Answer: 374
Question 19 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and the pointer is 4
byte. Given the logical address x=54984. Which is the correct information about the location
Mark 1.00 out of
of the above address?
1.00
/
Question 20 Given the following RAID-2 system in the following figure. Suppose each disk is 120 GB,
Correct which is the maximum size of data can be stored on the system?
Flag question
Select one:
approximate 720 GB
approximate 480 GB
approximate 240 GB
approximate 360 GB
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
/
/
/
/
/
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
13 14 15 16
Question 1 Suppose a system uses SJN (or SJF) scheduling
17 18 19 20 Correct algorithm. The processes information (arrival time,
Show one page at duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5).
Mark 1.00 out of
a time Calculate the response time of P4 ?
1.00
[Link] Page 1 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Flag question the time quantum is 15. Which is the running order
of the processes?
Select one:
P1, P3, P2, P4, P3, P4, P3
Select one:
10
20
15
[Link] Page 2 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Answer:
P1, P3, P2, P4, P3
Select one:
20
[Link] Page 3 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
10
12
add AX, BX
a=a+b
Flag question
Answer: 7
[Link] Page 4 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
17
16
15
18
CPU utilization
RAM utilization
0.2
0.3
0.4
[Link] Page 5 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
algorithm
Answer:
P1 P2 P3 P2 P4 P2
[Link] Page 6 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
0
10
15
Finish review
[Link] Page 7 of 7
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
13 14 15 16
Question 1 A UNIX file system with the block size of 4KB;
17 18 19 20 Correct pointer size of 4 bytes; 12 direct pointers; 1
Show one page at indirect pointer; 1 double indirect pointer; and 1
Mark 1.00 out of
a time triple indirect pointer. Which is the maximum
1.00
number of index blocks the system can use to
Finish review Flag question create a file?
Select one:
3+1024+1024*1024
1024*1024
3+1024*2+1024*1024
1024*2+1024*1024
Answer: 35840
[Link] Page 1 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
DOUPLE INDIRECT POINTER
(index_block,block,offset)=(186, 245,0)
Answer: 387
[Link] Page 2 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
(extent number, block number, offset)=(61, 43,
0)
Answer: 506
Answer: 307
[Link] Page 3 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Answer: 296
Flag question
Select one:
3
2
4
Select one:
SINGLE INDIRECT POINTER, (block,offset)=
(112, 16)
[Link] Page 4 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
DOUPLE INDIRECT POINTER
(index_block,block,offset)=(9, 88, 852)
9 times
10 times
12 times
[Link] Page 5 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
1.00
Flag question
Select one:
approximate 1 TB
approximate 1.5 TB
approximate 2 TB
approximate 2.5 TB
Flag question
Select one:
approximate 0.5 TB
approximate 1.5 TB
approximate 1 TB
approximate 1.75 TB
[Link] Page 6 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Answer: 512
[Link] Page 7 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
SINGLE INDIRECT POINTER (block,offset)=
(598, 3300)
Flag question
Select one:
approximate 1 TB
approximate 1.5 TB
approximate 2 TB
approximate 3 TB
Finish review
[Link] Page 8 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
[Link] Page 9 of 9
UETOTS Lưu Lê Tuấn Đạt
Question 1 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 175 with the direction toward the cylinder 0; The disk request string is
Correct 98, 183, 37, 122, 14. Suppose SCAN disk scheduling algorithm is used, calculate the total number of cylinders the head moved (e.g. 432)?
Flag question
Question 2 A UNIX file system with the block size of 4KB; pointer size of 4 bytes; 12 direct pointers; 1 indirect pointer; 1 double indirect pointer; and 1 triple indirect pointer.
Correct Which is the maximum number of index blocks the system can use to create a file?
Question 3 Suppose a system uses RAID 5 with 4 disks, given 4 blocks in the corresponding disks (1 0 1 0) (1 1 1 0) (1 0 0 0) (0 0 1 0), calculate the parity block of the four
Correct blocks (e.g. 1 0 1 0).
Remove flag
Question 4 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 161; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS
Correct disk scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 5 The disk partition is 500GB (1GB=1024MB, 1MB=1024KB, ...); the block size is 1KB. Suppose a system uses linked list disk allocation. Which is the suitable data
Correct type of the pointer (e.g. long)?
Flag question
Question 6 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 16; Disk request string is 98, 183, 37, 122, 14. Suppose FCFS disk
Correct scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 7 Suppose a system uses (1-level) indexed allocation with the block size of 16KB; the pointer size of 4 bytes. Calculate the maximum file size in MB (e.g. 5) the system
Correct can create?
Remove flag
Question 8 A system uses 2 level indexed allocation with block size of 4KB; pointer size of 4 bytes. Suppose a file has the size of 20MB. Which is the location of file offset (from
Correct 0) 156 KB?
Question 9 Consider a stable storage system, suppose the crash occurs before writing the first copy. Which is correct about the read protocol to recover the data?
Correct
Select one:
Mark 1.00 out of
The new data is not written, so the two copies of the data are incorrect
1.00
The two copies of old data are intact, so no need to do anything
Remove flag
Replace the first copy with the second
Erase the two copies of the old data
Question 10 Given the following RAID system in the following figure. How much is the performance of the system improved?
Correct
Flag question
Select one:
3 times
4 times
2 times
5 times
Question 11 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1 double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and
Correct the pointer is 4 bytes. Given a valid logical address x=123668. Which is the correct information about the location of the above address?
Question 12 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0) 1
Correct MB?
Question 13 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0)
Correct 415 KB?
Question 14 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1 double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and
Correct the pointer is 4 byte. Given the logical address x=6874. Which is the correct information about the location of the above address?
Question 15 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 163; Disk request string is 98, 183, 37, 122, 14. Suppose FCFS disk
Correct scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 16 Consider a stable storage system, suppose the crash occurs during writing the second copy. Which is correct about the read protocol to recover the data?
Correct
Select one:
Mark 1.00 out of
Second copy is bad, while the first copy is good, thus, replace the second with the first
1.00
It is impossible to recover the data
Remove flag
The first copy is good, just use this one
The second is bad, so the two copies are useless
Question 17 A UNIX file system with the block size of 4KB; pointer size of 4 bytes; 12 direct pointers; 1 indirect pointer; 1 double indirect pointer; and 1 triple indirect pointer.
Correct Which is the maximum file size when the (single) indirect pointer is used?
Question 19 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0)
Correct 511KB?
Question 20 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 53 with the direction toward the cylinder 0; The disk request string is
Incorrect 98, 183, 37, 122, 14, 124, 65, 67. Suppose SCAN disk scheduling algorithm is used, calculate the total number of cylinders the head has to move to serve the above
requests (e.g. 432)?
Mark 0.00 out of
1.00
Answer: 236
Flag question
Finish review
Question 1 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Flag question
Answer: 3
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
process P4 ?
Mark 1.00 out of
1.00
Answer: 12
Flag question
Question 3 Select the best description about the resources a computer may have
Correct
Select one:
Mark 1.00 out of
1.00 CPU, RAM, Disks
Flag question CPU, RAM and anything that can connect to the computer, such as CD, network card,
...
[Link] 1/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 4 Suppose a system uses Round Robin (RR) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Show the order (e.g. P2, P1, P3, P4) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1, P3, P2, P4
Waiting time
Question 6 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
SRTF
[Link] 2/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 9 Which is INCORRECT about the criteria to evaluate a good CPU scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 Maximize turnaround time
Question 10 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Flag question
Answer: 15.75
FIFO
Question 12 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
Question 14 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 0.00 out of
1.00
Flag question
Answer: 62
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of
process P2 ?
Mark 1.00 out of
1.00
Select one:
Flag question
10
8
12
13 14 15 16
Question 1 Given the following system information, and process P1
17 18 19 20 Correct requests (1, 0, 2) more resources:
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 1
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(F, F, T, T, T), WORK=(7, 5, 2)
Flag question
PROCESS A B C
A B C A B
C
P0 0 1 0
0 0 0 0
0 0
P1 2 0 0
2 0 2
P2 3 0 3
0 0 0
P3 2 1 1
1 0 0
P4 0 0 2
0 0 2
Select one:
The algorithm results in FINISH=(T, T, T, T, T),
WORK=(7, 2, 6), thus there is no deadlock.
Flag question
Select one:
Claim edge.
Assignment edge.
Request edge.
int buff[N];
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
wait(mutex);
Read(buff);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
The semaphore mutex is used to ensure this
constraint.
wait(empty);
wait(mutex);
Write (item);
signal(mutex);
signal(full);
} while (TRUE);
Read process Q:
do {
wait(full);
wait(mutex);
Read(item);
signal(mutex);
signal(empty);
} while (TRUE);
no problem at all
Flag question
wait(empty);
wait(mutex);
Write (item);
signal(mutex);
signal(full);
} while (TRUE);
Read process Q:
do {
wait(full);
wait(mutex);
Read(item);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
NULL
-1
//Write process P:
do {
wait(empty);
wait(mutex);
Write(item,buf);
signal(mutex);
signal(full);
} while (TRUE);
//Read process Q:
do {
wait(full);
wait(mutex);
Read(item,buf);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
P will be put into the waiting list of mutex
Flag question
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(T, F, T) WORK=(12)
FINISH=(T, F, F) WORK=(12)
FINISH=(F, T, F) WORK=(12)
FINISH=(T, T, T) WORK=(12)
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Select one:
1
NULL
-1
Question 14
Correct
Flag question
Which is incorrect about Semaphore?
Select one:
One important statement in signal (or V) operator is
to increase the integer by 1.
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 2
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(F, F, F, T, F), WORK=(3, 3, 2)
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(F, F, F), WORK=(4)
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(F, F, F), WORK=(4)
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 2
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(T, T, T, T, T), WORK=(10, 5, 7)
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
remove a process P
from S->L;
wakeup(P);
Select one:
S can not be initialized by 3
Finish review
Flag question
PROCESS TAPES TAPES TAPES
P0 5 10 3
P1 2 4
P2 2 9
Which is the correct value of FINISH and WORK vectors during the running of
Banker's algorithm?
Select one:
FINISH=(T, T, T) WORK=(12)
FINISH=(T, F, T) WORK=(12)
FINISH=(F, T, F) WORK=(12)
FINISH=(T, F, F) WORK=(12)
/
Question 2 Given the two bellow processes sharing three semaphores full, empty, mutex, and a buffer
Correct buff having initial N empty slots:
Flag question
int buff[N];
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
wait(mutex);
/
Read(buff);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
The minimum value of full is -1.
Question 4 Given the following resource allocation graph, provide the name of the edge from R2 to P2
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
Remove flag
A B C A B
C A B C
/
P0 0 0 1 0 0
1 1 5 2
P1 1 0 0 1 7
5
P2 1 3 5 2 3
5
P3 0 6 3 0 6
5
P4 0 0 1 0 6
5
Select one:
P0 P2 P1 P3 P4 is a safe sequence, the request can be granted immediately
Question 6 Which is CORRECT about the goal of mutual exclusion condition of critical section?
Correct
Select one:
Mark 1.00 out of
1.00 It tries to utilize the shared resource more effectively
Remove flag /
Select one:
There is no deadlock in a multiple instance resource type system.
There is a cycle in the graph: P1-R1-P3-R2-P1, thus there is a deadlock in the system.
There is no deadlock in the system, since there is a safe sequence for processes to
run.
Question 8 Given the following resource allocation graph, provide the name of the edge from R2 to P2
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
Question 9 Given the code of two semaphore atomic operation, where S is initialized by 3. Suppose
Correct process P1 calls wait(S), and P2 calls wait(S) before P1 calling signal(S). Which of the
following is incorrect?
Mark 1.00 out of
1.00
void wait(semaphore *S)
Remove flag
S->value--;
if (S->value<0) {
/
Add the requested process P into S->L;
block(P);
S->value++;
if (S->value<=0) {
wakeup(P);
Select one:
S can not be initialized by 3
Remove flag
A B C A B
C A B C
P0 0 1 0 0 0
0 0 0 0
P1 2 0 0 2 0
2
P2 3 0 3 0 0
0
P3 2 1 1 1 0
0
P4 0 0 2 0 0
2
Select one:
The system is in a safe state since P0 P2 P1 P3 P4 is a safe sequence
The system is in a safe state since P0 P2 P3 P1 P4 is a safe sequence
The disk has the ability to read/write the processes' requests concurrently, thus there is
no race condition
The operating system is responsible for managing disk - the shared resource
Remove flag
void wait(int &S)
while (S<=0);
S--;
/
S++;
Select one:
When the resource is in use, and another process call wait(), the CPU is waste to run
the while loop.
Question 15 Given the following resource allocation graph, provide the name of the edge from R2 to P1
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
/
The operating system is responsible for handling critical section on main memory
among running processes
Question 17 Given the code of two semaphore atomic operation, where S is initialized by 1. Suppose
Correct process P1 calls wait(S), and P2 calls wait(S) before P1 calling signal(S). Which of the
following is incorrect?
Mark 1.00 out of
1.00
void wait(semaphore *S)
Flag question
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
/
remove a process P from S->L;
wakeup(P);
Select one:
P2 is put into the waiting queue L of S
Question 18 Given the following resource allocation graph. What is the correct name of the edge from
Correct R3 to P3?
Flag question
/
Select one:
Assignment edge.
Claim edge.
Request edge.
Flag question A php page in a webserver connects to a Database Management System (such as
Microsoft SQL Server)
A web browser views a webpage from a web server.
13 14 15 16
Question 1 Which is INCORRECT about process control block
17 18 19 20 Correct (PCB)?
Special purpose
Embedded
Flag question RR
FIFO
15
10
Flag question
Answer: 7
15
10
60
80
70
Question 11
Correct
Flag question
Suppose a system uses SJN (or SJF) CPU scheduling
algorithm. The processes information (arrival time,
duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is
the average waiting time of the processes?
Select one:
2
Flag question
Answer: P1, P3, P2, P4, P3
Flag question
Answer: P1 P3 P4 P2
FIFO
a=a+b
add AX, BX
37
17
27
Process management
Flag question
Answer: 15.75
Finish review
Question 1 Suppose a paging system has the page fault rate=0.3%; the memory access time is: 250
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Flag question
Answer: 85
Question 2 A system does NOT use Translation Look-aside Buffer (TLB) for address translation in
Correct paging (1 level page table). Suppose the access time of the memory is 200ms; Which is the
Effective Access Time (EAT) of the system?
Mark 1.00 out of
1.00
Select one:
Flag question
160 ms
200 ms
180 ms
400 ms
Question 3 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (3, 106) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Answer: 3306
Flag question
Flag question
Question 5 Suppose a system uses second chance page replacement algorithm with 6 frames. The
Correct values of the reference bits of the frames are 1 1 0 1 1 0. The current position of the pointer
is at 2nd frame. When the page replacement is called, show the values of the reference bits
Mark 1.00 out of
(e.g. 1 1 0 1 1 0)?
1.00
Flag question
Answer: 1 0 0 1 1 0
Question 6 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00
Flag question
0 1291 1
1 12 0
2 5 1
3 23 1
4 132 0
Calculate the physical address of the logical address 986? (e.g. 18932
or error)
Answer: 1322970
Question 7 Suppose a system uses paging (1 level page table), and the access time of memory is 200
Correct ms. Calculate the time to access the memory from a reference (p,d)?
/
Mark 1.00 out of
Answer: 400
1.00
Flag question
Question 8 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00
Flag question
0 1291 1
1 12 0
2 5 1
3 23 1
4 132 0
Calculate the physical address of the logical address 3782? (e.g. 1893
2 or error)
Answer: 24262
Question 9 Suppose a paging system has the page fault rate=0.08%; the memory access time is: 150
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 38
Flag question
Question 10 Suppose a system uses paging (1 level page table) with Translation Look-aside Buffer
Correct (TLB) for address translation. Which statement is INCORRECT?
Select one:
/
Mark 1.00 out of The physical address is f*frame_size+d, where f is the corresponding frame of p
1.00
It always takes at least a TLB access and a 2 memory accesses for a reference (p, d)
Remove flag
Question 11 Suppose a system uses paging on demand without a Translation Look-aside Table (TLB).
Correct The memory access time is 200 nano seconds; page-fault service time is 7 miliseconds;
page-fault rate is 1/1000. Which is the Effective Access Time (EAT) of the system?
Mark 1.00 out of
1.00
Select one:
Flag question
9.2 micro seconds
6.2 micro seconds
Question 12 Suppose a system uses paging (1-level page table) with the frame size of 4KB; the address
Correct register is 32bits. Which is the CORRECT split of the address register?
(page-offset)=(19:13)
(page-offset)=(21:11)
Question 13 Suppose a paging system has the page fault rate=0.3%; the memory access time is: 200
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 106
Flag question
Question 14 A system uses proportional memory allocation method. There are 3 processes in the
Correct system: P1, P2, P3 with the size of 138KB, 96KB, and 164KB, correspondingly. Suppose
the memory size is 180KB, and the frame size is 2KB, calculate the number of frames
Mark 1.00 out of
allocated for processes P1, P2, P3 (e.g. 23:34:12)?
1.00
Flag question
Answer: 31:22:37
/
Question 15 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (4, 106) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Flag question
Answer: 4806
Remove flag It is the situation where page fault rate is high, the time for serving page faults is high
CPU utilization is low when thrashing occurs
Question 17 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (1, 402) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Answer: invalid
Flag question
Question 18 Suppose a paging system has the page fault rate=0.08%; the memory access time is: 320
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 18
Flag question
Flag question
Answer: 12
Question 20 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00
/
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
13 14 15 16
Question 1 Suppose a system uses SJN (or SJF) scheduling
17 18 19 20 Correct algorithm. The processes information (arrival time,
Show one page at duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5).
Mark 1.00 out of
a time Calculate the response time of P4 ?
1.00
[Link] Page 1 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Flag question the time quantum is 15. Which is the running order
of the processes?
Select one:
P1, P3, P2, P4, P3, P4, P3
Select one:
10
20
15
[Link] Page 2 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Answer:
P1, P3, P2, P4, P3
Select one:
20
[Link] Page 3 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
10
12
add AX, BX
a=a+b
Flag question
Answer: 7
[Link] Page 4 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
17
16
15
18
CPU utilization
RAM utilization
0.2
0.3
0.4
[Link] Page 5 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
algorithm
Answer:
P1 P2 P3 P2 P4 P2
[Link] Page 6 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
0
10
15
Finish review
[Link] Page 7 of 7
UETOTS Nguyễn Thị Huệ
Question 1 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Correct information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Remove flag
Answer: 63
Embedded
/
Question 4 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
P4 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of
Correct processes are P1(21), P2(10), P3(6). Which is the throughput of the system?
0.1
Question 6 Suppose a system uses SRTF scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,15). Show the order (e.g. P2, P1,
P3, P4) in which the processes are run?
Mark 1.00 out of
1.00
Answer: P1, P3, P2, P4, P3
Remove flag
Question 8 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0
10
15
20 /
Question 9 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes
Correct information (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total
waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Remove flag
17
16
18
15
Question 10 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Remove flag
Question 12 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Answer: 3
Remove flag
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
/
Because we need to utilize the memory more effectively
Question 14 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P2?
Mark 1.00 out of
1.00
Select one:
Remove flag
5
20
0
10
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 17 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the throughput of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0.04
0.02
0.01
0.03
/
Question 18 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program may have several processes
Flag question An application may have several processes, a process may have several programs
An application has only one program, a program has only one process
An application may have several programs, a program has only one process
Sequential system,
Uni-programming operating system
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
UETOTS Phan Công Hậu
Flag question Once a process is executed, it can only be switched into terminated state
Question 2 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15. Which is
the response time of P2?
Mark 1.00 out of
1.00
Select one:
Flag question
10
20
15
Question 3 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several processes, a process may have several programs
Flag question An application may have several programs, a program may have several processes
An application may have several programs, a program has only one process
An application has only one program, a program has only one process
Flag question Valid states are new, ready, running, waiting and terminated
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the process
Correct are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
37
Response time
Question 8 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Flag question
Question 9 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 10 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of P1 ?
Flag question
Is an instance of a program
Question 12 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
18
15
16
17
Question 13 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of process P3 ?
/
Question 14 Which module should NOT be implemented in the kernel of operating systems?
Correct
Select one:
Mark 1.00 out of
1.00 Process management module
Networking module
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Question 17 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Answer: P1 P3 P2 P4
Flag question
Question 19 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of process P2 ?
10
Question 20 Select INCORRECT description about the main tasks of operating systems
Correct
Select one:
Mark 1.00 out of
1.00 Provide database management systems (e.g. MS SQL Server)
/
Finish review
/
UETOTS Phan Anh
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
Because the system has many processes to run and they need to be treated equally
Because we need to utilize the memory more effectively
[Link]();
add AX, BX
/
Question 4 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
15
20
10
0
Quick-term scheduler
Long-term scheduler
Uni-programming
Multi-programming
Question 8 Select the best description about operating systems for computers
Correct
Select one:
/
Mark 1.00 out of They are applications
1.00
They are libraries
Flag question
They are software that are between users and computer hardware
They are firmware
Question 10 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the
Correct process are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
27
37
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
Remove flag Allow operating systems on the same hardware to use some resources (such as IP,
port, domain name,...) independently
Utilize RAM and CPU more effectively
Allow multiple operating system to run on the same hardware
/
Question 13 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
C++
C
Question 15 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
10
0
20
15
Embedded system
Sequential system,
Round robin
None of the above
Layered
Micro-kernel
Question 20 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Answer: 15.75
Flag question
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
You are logged in as Phan Anh (Log out)
S2INT2206_9_1920
/
17/3/2019 Bài kiểm tra số 1 (lần 2)
UETOTS Lê Nam Khánh
Question 1 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Flag question
Answer: 3
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
process P4 ?
Mark 1.00 out of
1.00
Answer: 12
Flag question
Question 3 Select the best description about the resources a computer may have
Correct
Select one:
Mark 1.00 out of
1.00 CPU, RAM, Disks
Flag question CPU, RAM and anything that can connect to the computer, such as CD, network card,
...
[Link] 1/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 4 Suppose a system uses Round Robin (RR) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Show the order (e.g. P2, P1, P3, P4) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1, P3, P2, P4
Waiting time
Question 6 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
SRTF
[Link] 2/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 9 Which is INCORRECT about the criteria to evaluate a good CPU scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 Maximize turnaround time
Question 10 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Flag question
Answer: 15.75
FIFO
Question 12 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
Question 14 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 0.00 out of
1.00
Flag question
Answer: 62
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of
process P2 ?
Mark 1.00 out of
1.00
Select one:
Flag question
10
8
12
13 14 15 16
Question 1 Which is INCORRECT about process control block
17 18 19 20 Correct (PCB)?
Special purpose
Embedded
Flag question RR
FIFO
15
10
Flag question
Answer: 7
15
10
60
80
70
Question 11
Correct
Flag question
Suppose a system uses SJN (or SJF) CPU scheduling
algorithm. The processes information (arrival time,
duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is
the average waiting time of the processes?
Select one:
2
Flag question
Answer: P1, P3, P2, P4, P3
Flag question
Answer: P1 P3 P4 P2
FIFO
a=a+b
add AX, BX
37
17
27
Process management
Flag question
Answer: 15.75
Finish review
Bài làm
Chứng minh ba tính chất trên được đảm bảo:
* Mutual exclusion được đảm bảo bởi vì
- P0 và P1 đều ở trong CS nếu và chỉ nếu flag[0] = flag[1]=true và chỉ nếu turn = i
với mỗi Pi (không thể xảy ra)
* Chứng minh thỏa mãn yêu cầu về progess và bounded waiting
- Pi không thể vào CS nếu và chỉ nếu bị kẹt tại vòng lặp while() với điều kiện
flag[i] = true và tủn = j
- Nếu Pj không muốn vào CS thì flag[j] = false và do đó Pi có thể vào CS
- Nếu Pj đã bật flag[j] = true và đang chờ tại while() thì chỉ có hai trường hợp là
turn = i và turn =j
- Nếu turn = i thì Pi vào CS. Nếu turn = j thì Pj vào CS nhưng sẽ bật flag[j] = false
khi thoát ra => cho phép Pi vào CS
- Nhưng nếu Pj có đủ thời gian bật flag[j] = true thì Pj cũng phải gán turn = i
- Vì Pi không thay đổi trị của biến turn khi đang kẹt trong vòng lặp while() , Pi sẽ
chờ để vào CS nhiều nhất là sau một lần Pj vào CS ( bounded waiting)
Bài 2 trang 19:
Bài làm
Đoạn mã trên thỏa mãn hai tính chất đầu, không thỏa mãn tính chất chờ đợi có giới
hạn
- Biến chia sẻ lock được khởi tạo bởi giá trị false
- Mỗi progess Pi có biến cục bộ key
- Process Pi nào thấy giá trị lock = false thì được vào CS. Process Pi sẽ loại trừ các
process Pi khác khi thiết lập lock = true.
Cho nên, mutual exclusion được đảm bảo nếu Pi vào CS, các process Pj khác đều
đang busy waiting
- Khi Pi ra khỏi CS, quá trình lựa chọn process Pj vào CS kế tiếp là tùy ý = >
Không đảm bảo điều kiện bounded waiting. Do đó có thể xảy ra starvation (bị bỉ
đói)
Chọn một giải pháp khắc phục tình trạng bế tắc viết lại tiến trình cho nhà triết học i
Bài làm
Ta có tiến trình cho các nhà triết học i:
Với bài toán trên thì khi 5 nhà triết học đều đói và lấy đũa cùng một lúc => họ đợi
nhau và không ai có đủ đũa để ăn => xảy ra tình trạng bế tắc
Giải pháp khắc phục tình trạng bế tắc: chỉ cho phép một nhà triết học lấy đũa khi
cả 2 chiếc đũa trái và phải ở trạng thái sẵn sàng.
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
UETOTS Thái Huy Nhật Quang
Question 1 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the average waiting time of
the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
2
3
5
4
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P1 ?
Question 3 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
16
17
18
15
[Link] 1/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
Question 4 Suppose a system uses SRTF (or preemtive SJF) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,24), P2(20,40), P3(30,10), P4(50,15). Show the order
(e.g. P1 P3 P1 P4 ...) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1 P2 P3 P4
Round robin
Question 6 Which is INCORRECT about Shortest Job First (SJF) CPU scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be selected to be run
Flag question Shortest remaining time first (SRTF) CPU scheduling algorithm is the same as SJF
It is also a priority scheduling algorithm
Question 7 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P3 ?
Question 8 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the response time of process P2?
8
12
Question 12 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0,20), P2(30,10),P3(20,40), P4(40,25), and the time quantum is 15. Which is the
total waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
60
70
50
40
Question 13 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program has only one process
Flag question An application has only one program, a program has only one process
[Link] 3/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
An application may have several processes, a process may have several programs
An application may have several programs, a program may have several processes
Question 15 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Flag question
Answer: P1 P3 P2 P4
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Flag question The shortest remaining time process will be selected to run
It is also a priority scheduling algorithm
Question 17 Suppose a system uses FCFS CPU scheduling algorithm. The duration of the processes is
Correct P1(21), P2(10), P3(6) (and this is also the order of the processes in the queue). Calculate the total
waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 52
Flag question
13 14 15 16
Question 1 Suppose a system uses SJN (or SJF) scheduling
17 18 19 20 Correct algorithm. The processes information (arrival time,
Show one page at duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5).
Mark 1.00 out of
a time Calculate the response time of P4 ?
1.00
[Link] Page 1 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Flag question the time quantum is 15. Which is the running order
of the processes?
Select one:
P1, P3, P2, P4, P3, P4, P3
Select one:
10
20
15
[Link] Page 2 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Answer:
P1, P3, P2, P4, P3
Select one:
20
[Link] Page 3 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
10
12
add AX, BX
a=a+b
Flag question
Answer: 7
[Link] Page 4 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
17
16
15
18
CPU utilization
RAM utilization
0.2
0.3
0.4
[Link] Page 5 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
algorithm
Answer:
P1 P2 P3 P2 P4 P2
[Link] Page 6 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
0
10
15
Finish review
[Link] Page 7 of 7
UETOTS Nguyễn Thị Huệ
Question 1 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Correct information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Remove flag
Answer: 63
Embedded
/
Question 4 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
P4 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of
Correct processes are P1(21), P2(10), P3(6). Which is the throughput of the system?
0.1
Question 6 Suppose a system uses SRTF scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,15). Show the order (e.g. P2, P1,
P3, P4) in which the processes are run?
Mark 1.00 out of
1.00
Answer: P1, P3, P2, P4, P3
Remove flag
Question 8 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0
10
15
20 /
Question 9 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes
Correct information (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total
waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Remove flag
17
16
18
15
Question 10 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Remove flag
Question 12 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Answer: 3
Remove flag
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
/
Because we need to utilize the memory more effectively
Question 14 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P2?
Mark 1.00 out of
1.00
Select one:
Remove flag
5
20
0
10
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 17 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the throughput of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0.04
0.02
0.01
0.03
/
Question 18 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program may have several processes
Flag question An application may have several processes, a process may have several programs
An application has only one program, a program has only one process
An application may have several programs, a program has only one process
Sequential system,
Uni-programming operating system
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
UETOTS Phan Công Hậu
Flag question Once a process is executed, it can only be switched into terminated state
Question 2 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15. Which is
the response time of P2?
Mark 1.00 out of
1.00
Select one:
Flag question
10
20
15
Question 3 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several processes, a process may have several programs
Flag question An application may have several programs, a program may have several processes
An application may have several programs, a program has only one process
An application has only one program, a program has only one process
Flag question Valid states are new, ready, running, waiting and terminated
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the process
Correct are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
37
Response time
Question 8 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Flag question
Question 9 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 10 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of P1 ?
Flag question
Is an instance of a program
Question 12 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
18
15
16
17
Question 13 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of process P3 ?
/
Question 14 Which module should NOT be implemented in the kernel of operating systems?
Correct
Select one:
Mark 1.00 out of
1.00 Process management module
Networking module
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Question 17 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Answer: P1 P3 P2 P4
Flag question
Question 19 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of process P2 ?
10
Question 20 Select INCORRECT description about the main tasks of operating systems
Correct
Select one:
Mark 1.00 out of
1.00 Provide database management systems (e.g. MS SQL Server)
/
Finish review
/
UETOTS Phan Anh
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
Because the system has many processes to run and they need to be treated equally
Because we need to utilize the memory more effectively
[Link]();
add AX, BX
/
Question 4 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
15
20
10
0
Quick-term scheduler
Long-term scheduler
Uni-programming
Multi-programming
Question 8 Select the best description about operating systems for computers
Correct
Select one:
/
Mark 1.00 out of They are applications
1.00
They are libraries
Flag question
They are software that are between users and computer hardware
They are firmware
Question 10 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the
Correct process are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
27
37
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
Remove flag Allow operating systems on the same hardware to use some resources (such as IP,
port, domain name,...) independently
Utilize RAM and CPU more effectively
Allow multiple operating system to run on the same hardware
/
Question 13 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
C++
C
Question 15 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
10
0
20
15
Embedded system
Sequential system,
Round robin
None of the above
Layered
Micro-kernel
Question 20 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Answer: 15.75
Flag question
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
You are logged in as Phan Anh (Log out)
S2INT2206_9_1920
/
17/3/2019 Bài kiểm tra số 1 (lần 2)
UETOTS Lê Nam Khánh
Question 1 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Flag question
Answer: 3
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
process P4 ?
Mark 1.00 out of
1.00
Answer: 12
Flag question
Question 3 Select the best description about the resources a computer may have
Correct
Select one:
Mark 1.00 out of
1.00 CPU, RAM, Disks
Flag question CPU, RAM and anything that can connect to the computer, such as CD, network card,
...
[Link] 1/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 4 Suppose a system uses Round Robin (RR) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Show the order (e.g. P2, P1, P3, P4) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1, P3, P2, P4
Waiting time
Question 6 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
SRTF
[Link] 2/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 9 Which is INCORRECT about the criteria to evaluate a good CPU scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 Maximize turnaround time
Question 10 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Flag question
Answer: 15.75
FIFO
Question 12 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
Question 14 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 0.00 out of
1.00
Flag question
Answer: 62
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of
process P2 ?
Mark 1.00 out of
1.00
Select one:
Flag question
10
8
12
13 14 15 16
Question 1 Which is INCORRECT about process control block
17 18 19 20 Correct (PCB)?
Special purpose
Embedded
Flag question RR
FIFO
15
10
Flag question
Answer: 7
15
10
60
80
70
Question 11
Correct
Flag question
Suppose a system uses SJN (or SJF) CPU scheduling
algorithm. The processes information (arrival time,
duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is
the average waiting time of the processes?
Select one:
2
Flag question
Answer: P1, P3, P2, P4, P3
Flag question
Answer: P1 P3 P4 P2
FIFO
a=a+b
add AX, BX
37
17
27
Process management
Flag question
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
UETOTS Thái Huy Nhật Quang
Question 1 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the average waiting time of
the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
2
3
5
4
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P1 ?
Question 3 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
16
17
18
15
[Link] 1/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
Question 4 Suppose a system uses SRTF (or preemtive SJF) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,24), P2(20,40), P3(30,10), P4(50,15). Show the order
(e.g. P1 P3 P1 P4 ...) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1 P2 P3 P4
Round robin
Question 6 Which is INCORRECT about Shortest Job First (SJF) CPU scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be selected to be run
Flag question Shortest remaining time first (SRTF) CPU scheduling algorithm is the same as SJF
It is also a priority scheduling algorithm
Question 7 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P3 ?
Question 8 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the response time of process P2?
8
12
Question 12 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0,20), P2(30,10),P3(20,40), P4(40,25), and the time quantum is 15. Which is the
total waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
60
70
50
40
Question 13 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program has only one process
Flag question An application has only one program, a program has only one process
[Link] 3/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
An application may have several processes, a process may have several programs
An application may have several programs, a program may have several processes
Question 15 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Flag question
Answer: P1 P3 P2 P4
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Flag question The shortest remaining time process will be selected to run
It is also a priority scheduling algorithm
Question 17 Suppose a system uses FCFS CPU scheduling algorithm. The duration of the processes is
Correct P1(21), P2(10), P3(6) (and this is also the order of the processes in the queue). Calculate the total
waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 52
Flag question
16 17 18 19 20
Question 1 Which is NOT a deadlock handling method?
Show one page at a Correct
time Select one:
Mark 1.00 out of
Finish review Ensure the system never enters deadlock state
1.00
Flag question
Flag question
Select one:
3 trong 18 3:36 CH, 26/04/2020
Kiểm tra chương 3+4 [Link]
When the resource is in use, and another process call
wait(), the CPU is waste to run the while loop.
Flag question
Select one:
FINISH=(T, F, T), WORK=(12)
Flag question
Select one:
The minimum value of empty is -1.
It is a counting semaphore.
Flag question
Answer: Assignment
Flag question
Select one:
Flag question
Process reader Q:
Select one:
To safely access the data_set
Question 10
Correct
Flag question
Select one:
The maximum value of full is N.
It is a counting semaphore.
Waiting semaphore
Remove flag
Select one:
FINISH=(F, T, T, F, T), WORK=(6, 4, 3)
Flag question
Select one:
The minimum value of empty is 0.
It is a binary semaphore.
It is a counting semaphore.
deadlock avoidance
deadlock prediction
Question 17
Flag question
Select one:
Request edge.
Assignment edge.
Claim edge.
Flag question
Select one:
Assignment edge.
Request edge.
Claim edge.
Flag question
Select one:
Assignment edge.
Claim edge.
Request edge.
Finish review
13 14 15 16
Question 1 Given the following system information:
17 18 19 20 Correct
ALLOCATION
Show one page at Mark 1.00 out of
REQUEST AVBALABLE
a time 1.00
PROCESS A B C
A B C A B
C
P0 0 1
0 0 0 0
0 0 0
P1 2 0
0 2 0 2
P2 3 0
3 0 0 1
[Link] Page 1 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P3 2 1
1 1 0 0
P4 0 0
2 0 0 2
Select one:
There algorithm results in FINISH=(T, F, T, F, F),
thus P1, P3 and P4 are in a deadlock.
Flag question
[Link] Page 2 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Select one:
Claim edge.
Request edge.
Assignment edge.
[Link] Page 3 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(T, T, F), WORK=(10)
[Link] Page 4 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
[Link] Page 5 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Select one:
1
-1
NULL
[Link] Page 6 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
var val=0;
waitForNewRequest();
if(found){
hit+=1;
val=hit;
Respond();
Select one:
Respond();
if(found){ ...}
waitForNewRequest();
[Link] Page 7 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
do {
wait(conner[i]);
wait(conner[(i+1)%4]);
Get_Over_The_Crossroad
(i);
signal(conner[i]);
signal(conner[(i+1)%4]
;
Continue_Going(i);
[Link] Page 8 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
} while (TRUE);
Select one:
At a time, only a car can go through the
crossroad
PROCESS A B C
A B C A B
C
[Link] Page 9 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 0
1 0 7 5
3 2 3 0
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(T, T, T, T, F), WORK=(9, 5, 5)
[Link] Page 10 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
[Link] Page 11 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
remove a proce
ss P from S->L;
wakeup(P);
Select one:
Since we have the waiting queue, there no
need to have the variable S->value in the
semaphore S
PROCESS A B C
A B C A B
C
P0 0
1 0 7 5
3 2 3 0
[Link] Page 12 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(T, F, T, T, F), WORK=(9, 5, 6)
Flag question
[Link] Page 13 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Select one:
Assignment edge.
Claim edge.
Request edge.
//Some code
int val=buf;
[Link] Page 14 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
buf=val
Select one:
The globally shared variable buf will always
get an incorrect value when there are more
than 2 instances of the code running.
//Some code
[Link] Page 15 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
val += count();//2. A
time consuming function
buf=val; //3.
val=val*4; //4.
Select one:
There is a race condition in the code.
[Link] Page 16 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
Answer:
Claim
PROCESS A B
C A B C
A B C
[Link] Page 17 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
P0 0
3 0 7 5
3 2 1 0
P1 3
0 2 3 2
2
P2 3
0 2 9 0
2
P3 2
1 1 2 2
2
P4 0
0 2 4 3
3
Select one:
FINISH=(F, T, F, F, F), WORK=(2, 1, 0)
[Link] Page 18 of 20
Kiểm tra chương 3+4 4/26/20, 16:29
Flag question
Pro Allocation
Max
Available
A B
C A B
C A B
C
P0 0 0
1 0 0
1 1 5
2
P1 1 0
0 1 7
5
P2 1 3
5 2 3
5
P3 0 6
3 0 6
5
P4 0 0
1 0 6
5
Select one:
[Link] Page 19 of 20
UETOTS Phan Công Hậu
Flag question Once a process is executed, it can only be switched into terminated state
Question 2 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15. Which is
the response time of P2?
Mark 1.00 out of
1.00
Select one:
Flag question
10
20
15
Question 3 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several processes, a process may have several programs
Flag question An application may have several programs, a program may have several processes
An application may have several programs, a program has only one process
An application has only one program, a program has only one process
Flag question Valid states are new, ready, running, waiting and terminated
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the process
Correct are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
37
Response time
Question 8 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Flag question
Question 9 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 10 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of P1 ?
Flag question
Is an instance of a program
Question 12 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
18
15
16
17
Question 13 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of process P3 ?
/
Question 14 Which module should NOT be implemented in the kernel of operating systems?
Correct
Select one:
Mark 1.00 out of
1.00 Process management module
Networking module
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Question 17 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Answer: P1 P3 P2 P4
Flag question
Question 19 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of process P2 ?
10
Question 20 Select INCORRECT description about the main tasks of operating systems
Correct
Select one:
Mark 1.00 out of
1.00 Provide database management systems (e.g. MS SQL Server)
/
Finish review
/
UETOTS Phan Anh
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
Because the system has many processes to run and they need to be treated equally
Because we need to utilize the memory more effectively
[Link]();
add AX, BX
/
Question 4 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
15
20
10
0
Quick-term scheduler
Long-term scheduler
Uni-programming
Multi-programming
Question 8 Select the best description about operating systems for computers
Correct
Select one:
/
Mark 1.00 out of They are applications
1.00
They are libraries
Flag question
They are software that are between users and computer hardware
They are firmware
Question 10 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of the
Correct process are P1(20), P2(11), P3(6). Which is the average waiting time of the processes?
27
37
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
Remove flag Allow operating systems on the same hardware to use some resources (such as IP,
port, domain name,...) independently
Utilize RAM and CPU more effectively
Allow multiple operating system to run on the same hardware
/
Question 13 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
C++
C
Question 15 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Flag question
10
0
20
15
Embedded system
Sequential system,
Round robin
None of the above
Layered
Micro-kernel
Question 20 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Answer: 15.75
Flag question
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
You are logged in as Phan Anh (Log out)
S2INT2206_9_1920
/
UETOTS Nguyễn Thị Huệ
Question 1 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Correct information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Remove flag
Answer: 63
Embedded
/
Question 4 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
P4 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 5 Suppose a system uses FCFS CPU scheduling algorithm. The duration and order of
Correct processes are P1(21), P2(10), P3(6). Which is the throughput of the system?
0.1
Question 6 Suppose a system uses SRTF scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,15). Show the order (e.g. P2, P1,
P3, P4) in which the processes are run?
Mark 1.00 out of
1.00
Answer: P1, P3, P2, P4, P3
Remove flag
Question 8 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the response time of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0
10
15
20 /
Question 9 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes
Correct information (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total
waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Remove flag
17
16
18
15
Question 10 Suppose a system uses SJF scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,20),P3(20,40), P4(35,15). Show the order (e.g. P2 P1 P3 P4) in
which the processes are run?
Mark 1.00 out of
1.00
Answer: P1 P3 P4 P2
Remove flag
Question 12 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Answer: 3
Remove flag
Flag question Many reasons: Many processes; Utilize system resources more effectively; Don’t let
users wait; ...
/
Because we need to utilize the memory more effectively
Question 14 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the waiting time of P2?
Mark 1.00 out of
1.00
Select one:
Remove flag
5
20
0
10
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Remove flag
Answer: 7
Question 17 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0, 25), P3(20, 40), P2(30, 10), P4(35, 25), and the time quantum is 15.
Which is the throughput of P1?
Mark 1.00 out of
1.00
Select one:
Remove flag
0.04
0.02
0.01
0.03
/
Question 18 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program may have several processes
Flag question An application may have several processes, a process may have several programs
An application has only one program, a program has only one process
An application may have several programs, a program has only one process
Sequential system,
Uni-programming operating system
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
UETOTS Phan Anh
Question 1 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and the pointer is 4
byte. Given the logical address x=98364. Which is the correct information about the location
Mark 1.00 out of
of the above address?
1.00
Question 2 Given the following RAID system in the following figure. Suppose each disk is 500GB,
Correct which is the maximum size of data can be stored on the system?
Flag question
Select one:
approximate 1 TB
approximate 3 TB /
approximate 1.5 TB
approximate 2 TB
Question 3 Suppose a level-6 RAID system has 12 hard-disks of size 500 GB. How much is the
Correct performance of the system improved?
Question 4 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 53; Disk request string is 98, 183, 37, 122, 14, 124, 65, 67. Suppose SSTF disk
scheduling algorithm is used, calculate the total cylinders the head has to move to serve the
Mark 1.00 out of
above requests (e.g. 432)?
1.00
Flag question
Answer: 236
Question 5 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 75 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14. Suppose LOOK disk scheduling algorithm is used, calculate the total number of
Mark 1.00 out of
cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 277
Question 6 A system uses linked list disk allocation with the block size of 2KB; the pointer size of 4
Correct bytes. Suppose a file has the size of 15.5MB. Calculate the offset in the block containing
data at file offset (from 0) 68 KB?
Mark 1.00 out of
1.00
Answer: 140
Remove flag
Question 7 Suppose a system uses (1-level) indexed allocation with the block size of 4KB; the pointer
Correct size of 4 bytes. A file has the size of 3MB. Which is the correct location at the file offset
(from 0) 27 KB?
Mark 1.00 out of
1.00
Select one:
Remove flag
(block index, offset)=(7, 3071) /
(block index, offset)=(8, 3071)
(block index, offset)=(7, 3072)
(block index, offset)=(8, 3072)
Question 8 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the
Correct size of 12.3MB. Which is the correct location of the file offset (from 0) 415 KB?
Question 9 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 161; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS disk scheduling
algorithm is used, calculate the total cylinders the head has to move to serve the above
Mark 1.00 out of
requests (e.g. 432)?
1.00
Flag question
Answer: 496
Question 10 Given the following RAID system in the following figure. How much is the performance of
Correct the system improved?
Flag question
Select one:
2 times
4 times
5 times
3 times
/
Question 11 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 2KB, and the pointer is 4
bytes. Given a valid logical address x=2493668. Which is the correct information about the
Mark 1.00 out of
location of the above address?
1.00
Question 12 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 53 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14, 124, 65, 67. Suppose C-LOOK disk scheduling algorithm is used (serving direction
Mark 1.00 out of
is from 0 to 199), calculate the total number of cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 322
Question 13 A system uses extent-based disk allocation with the block size of 2KB. An extent consists of
Correct 100 blocks; a file has the size of 25.3MB. Calculate the extent number (starting from 0) at
file offset (from 0) 14MB?
Mark 1.00 out of
1.00
Answer: 71
Flag question
Question 14 A system uses linked list disk allocation with the block size of 2KB; the pointer size of 4
Correct bytes. Suppose a file has the size of 15.5MB. Calculate the block number (starting from 0)
of the location at file offset (from 0) 68 KB?
Mark 1.00 out of
1.00
Answer: 34
Flag question
Question 15 Suppose a system uses (1-level) indexed allocation with the block size of 4KB; the pointer
Correct size of 4 bytes. A file has the size of 3MB. Which is the correct location at the file offset
(from 0) 35KB?
Mark 1.00 out of
1.00
Select one:
Flag question
(block index, offset)=(8, 3072)
Question 16 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 56 with the direction toward the cylinder 199; The disk request string is 98, 183, 37,
122, 14. Suppose LOOK disk scheduling algorithm is used, calculate the total number of
Mark 1.00 out of
cylinders the head has to move (e.g. 432)?
1.00
Flag question
Answer: 296
Question 17 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Incorrect double indirect pointer, 1 triple indirect pointer; the block size is 2KB, and the pointer is 4
bytes. Given a valid logical address x=2493668. Which is the correct information about the
Mark 0.00 out of
location of the above address?
1.00
Question 18 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the
Correct cylinder 17; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS disk scheduling
algorithm is used, calculate the total cylinders the head has to move to serve the above
Mark 1.00 out of
requests (e.g. 432)?
1.00
Flag question
Answer: 374
Question 19 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1
Correct double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and the pointer is 4
byte. Given the logical address x=54984. Which is the correct information about the location
Mark 1.00 out of
of the above address?
1.00
/
Question 20 Given the following RAID-2 system in the following figure. Suppose each disk is 120 GB,
Correct which is the maximum size of data can be stored on the system?
Flag question
Select one:
approximate 720 GB
approximate 480 GB
approximate 240 GB
approximate 360 GB
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
/
/
/
/
/
/
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
13 14 15 16
Question 1 Suppose a system uses SJN (or SJF) scheduling
17 18 19 20 Correct algorithm. The processes information (arrival time,
Show one page at duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5).
Mark 1.00 out of
a time Calculate the response time of P4 ?
1.00
[Link] Page 1 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Flag question the time quantum is 15. Which is the running order
of the processes?
Select one:
P1, P3, P2, P4, P3, P4, P3
Select one:
10
20
15
[Link] Page 2 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Answer:
P1, P3, P2, P4, P3
Select one:
20
[Link] Page 3 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
10
12
add AX, BX
a=a+b
Flag question
Answer: 7
[Link] Page 4 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
17
16
15
18
CPU utilization
RAM utilization
0.2
0.3
0.4
[Link] Page 5 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
algorithm
Answer:
P1 P2 P3 P2 P4 P2
[Link] Page 6 of 7
Bài kiểm tra chương 1 + 2 4/5/20, 21:01
Select one:
0
10
15
Finish review
[Link] Page 7 of 7
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
13 14 15 16
Question 1 A UNIX file system with the block size of 4KB;
17 18 19 20 Correct pointer size of 4 bytes; 12 direct pointers; 1
Show one page at indirect pointer; 1 double indirect pointer; and 1
Mark 1.00 out of
a time triple indirect pointer. Which is the maximum
1.00
number of index blocks the system can use to
Finish review Flag question create a file?
Select one:
3+1024+1024*1024
1024*1024
3+1024*2+1024*1024
1024*2+1024*1024
Answer: 35840
[Link] Page 1 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
DOUPLE INDIRECT POINTER
(index_block,block,offset)=(186, 245,0)
Answer: 387
[Link] Page 2 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
(extent number, block number, offset)=(61, 43,
0)
Answer: 506
Answer: 307
[Link] Page 3 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Answer: 296
Flag question
Select one:
3
2
4
Select one:
SINGLE INDIRECT POINTER, (block,offset)=
(112, 16)
[Link] Page 4 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
DOUPLE INDIRECT POINTER
(index_block,block,offset)=(9, 88, 852)
9 times
10 times
12 times
[Link] Page 5 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
1.00
Flag question
Select one:
approximate 1 TB
approximate 1.5 TB
approximate 2 TB
approximate 2.5 TB
Flag question
Select one:
approximate 0.5 TB
approximate 1.5 TB
approximate 1 TB
approximate 1.75 TB
[Link] Page 6 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Answer: 512
[Link] Page 7 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
Select one:
SINGLE INDIRECT POINTER (block,offset)=
(598, 3300)
Flag question
Select one:
approximate 1 TB
approximate 1.5 TB
approximate 2 TB
approximate 3 TB
Finish review
[Link] Page 8 of 9
Bài kiểm tra chương 7 + 8 6/14/20, 15:36
[Link] Page 9 of 9
UETOTS Lưu Lê Tuấn Đạt
Question 1 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 175 with the direction toward the cylinder 0; The disk request string is
Correct 98, 183, 37, 122, 14. Suppose SCAN disk scheduling algorithm is used, calculate the total number of cylinders the head moved (e.g. 432)?
Flag question
Question 2 A UNIX file system with the block size of 4KB; pointer size of 4 bytes; 12 direct pointers; 1 indirect pointer; 1 double indirect pointer; and 1 triple indirect pointer.
Correct Which is the maximum number of index blocks the system can use to create a file?
Question 3 Suppose a system uses RAID 5 with 4 disks, given 4 blocks in the corresponding disks (1 0 1 0) (1 1 1 0) (1 0 0 0) (0 0 1 0), calculate the parity block of the four
Correct blocks (e.g. 1 0 1 0).
Remove flag
Question 4 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 161; the disk request string is 28, 83, 137, 12, 141. Suppose FCFS
Correct disk scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 5 The disk partition is 500GB (1GB=1024MB, 1MB=1024KB, ...); the block size is 1KB. Suppose a system uses linked list disk allocation. Which is the suitable data
Correct type of the pointer (e.g. long)?
Flag question
Question 6 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 16; Disk request string is 98, 183, 37, 122, 14. Suppose FCFS disk
Correct scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 7 Suppose a system uses (1-level) indexed allocation with the block size of 16KB; the pointer size of 4 bytes. Calculate the maximum file size in MB (e.g. 5) the system
Correct can create?
Remove flag
Question 8 A system uses 2 level indexed allocation with block size of 4KB; pointer size of 4 bytes. Suppose a file has the size of 20MB. Which is the location of file offset (from
Correct 0) 156 KB?
Question 9 Consider a stable storage system, suppose the crash occurs before writing the first copy. Which is correct about the read protocol to recover the data?
Correct
Select one:
Mark 1.00 out of
The new data is not written, so the two copies of the data are incorrect
1.00
The two copies of old data are intact, so no need to do anything
Remove flag
Replace the first copy with the second
Erase the two copies of the old data
Question 10 Given the following RAID system in the following figure. How much is the performance of the system improved?
Correct
Flag question
Select one:
3 times
4 times
2 times
5 times
Question 11 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1 double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and
Correct the pointer is 4 bytes. Given a valid logical address x=123668. Which is the correct information about the location of the above address?
Question 12 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0) 1
Correct MB?
Question 13 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0)
Correct 415 KB?
Question 14 A UNIX file system has 12 direct pointers (named from 1 to 12), 1 single indirect pointer, 1 double indirect pointer, 1 triple indirect pointer; the block size is 1KB, and
Correct the pointer is 4 byte. Given the logical address x=6874. Which is the correct information about the location of the above address?
Question 15 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 163; Disk request string is 98, 183, 37, 122, 14. Suppose FCFS disk
Correct scheduling algorithm is used, calculate the total cylinders the head has to move to serve the above requests (e.g. 432)?
Flag question
Question 16 Consider a stable storage system, suppose the crash occurs during writing the second copy. Which is correct about the read protocol to recover the data?
Correct
Select one:
Mark 1.00 out of
Second copy is bad, while the first copy is good, thus, replace the second with the first
1.00
It is impossible to recover the data
Remove flag
The first copy is good, just use this one
The second is bad, so the two copies are useless
Question 17 A UNIX file system with the block size of 4KB; pointer size of 4 bytes; 12 direct pointers; 1 indirect pointer; 1 double indirect pointer; and 1 triple indirect pointer.
Correct Which is the maximum file size when the (single) indirect pointer is used?
Question 19 Suppose a system uses contiguous disk allocation with the block size of 2KB. A file has the size of 12.3MB. Which is the correct location of the file offset (from 0)
Correct 511KB?
Question 20 Suppose a disk has 200 cylinders (marked from 0 to 199); the head is currently at the cylinder 53 with the direction toward the cylinder 0; The disk request string is
Incorrect 98, 183, 37, 122, 14, 124, 65, 67. Suppose SCAN disk scheduling algorithm is used, calculate the total number of cylinders the head has to move to serve the above
requests (e.g. 432)?
Mark 0.00 out of
1.00
Answer: 236
Flag question
Finish review
Question 1 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the response time of
process P3 ?
Mark 1.00 out of
1.00
Flag question
Answer: 3
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
process P4 ?
Mark 1.00 out of
1.00
Answer: 12
Flag question
Question 3 Select the best description about the resources a computer may have
Correct
Select one:
Mark 1.00 out of
1.00 CPU, RAM, Disks
Flag question CPU, RAM and anything that can connect to the computer, such as CD, network card,
...
[Link] 1/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 4 Suppose a system uses Round Robin (RR) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Show the order (e.g. P2, P1, P3, P4) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1, P3, P2, P4
Waiting time
Question 6 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of
P1 ?
Mark 1.00 out of
1.00
Answer: 7
Flag question
SRTF
[Link] 2/5
17/3/2019 Bài kiểm tra số 1 (lần 2)
Question 9 Which is INCORRECT about the criteria to evaluate a good CPU scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 Maximize turnaround time
Question 10 Suppose a system uses FCFS CPU scheduling algorithm, the processes information (arrival
Correct time, duration) is P1(0,21), P2(30,10),P3(20,40), P4(40,25). Calculate the average waiting
time of the processes?
Mark 1.00 out of
1.00
Flag question
Answer: 15.75
FIFO
Question 12 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Incorrect
Select one:
Mark 0.00 out of
1.00 It is also a priority scheduling algorithm
Flag question The shortest remaining time process will be selected to run
The shortest process will be run first
It is the preemptive Shortest Job First (SJF) algorithm
Question 14 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes
Incorrect information (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the
time quantum is 15. Calculate the total waiting time of the processes?
Mark 0.00 out of
1.00
Flag question
Answer: 62
Question 15 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the turnaround time of
process P2 ?
Mark 1.00 out of
1.00
Select one:
Flag question
10
8
12
13 14 15 16
Question 1 Given the following system information, and process P1
17 18 19 20 Correct requests (1, 0, 2) more resources:
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 1
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(F, F, T, T, T), WORK=(7, 5, 2)
Flag question
PROCESS A B C
A B C A B
C
P0 0 1 0
0 0 0 0
0 0
P1 2 0 0
2 0 2
P2 3 0 3
0 0 0
P3 2 1 1
1 0 0
P4 0 0 2
0 0 2
Select one:
The algorithm results in FINISH=(T, T, T, T, T),
WORK=(7, 2, 6), thus there is no deadlock.
Flag question
Select one:
Claim edge.
Assignment edge.
Request edge.
int buff[N];
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
wait(mutex);
Read(buff);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
The semaphore mutex is used to ensure this
constraint.
wait(empty);
wait(mutex);
Write (item);
signal(mutex);
signal(full);
} while (TRUE);
Read process Q:
do {
wait(full);
wait(mutex);
Read(item);
signal(mutex);
signal(empty);
} while (TRUE);
no problem at all
Flag question
wait(empty);
wait(mutex);
Write (item);
signal(mutex);
signal(full);
} while (TRUE);
Read process Q:
do {
wait(full);
wait(mutex);
Read(item);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
NULL
-1
//Write process P:
do {
wait(empty);
wait(mutex);
Write(item,buf);
signal(mutex);
signal(full);
} while (TRUE);
//Read process Q:
do {
wait(full);
wait(mutex);
Read(item,buf);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
P will be put into the waiting list of mutex
Flag question
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(T, F, T) WORK=(12)
FINISH=(T, F, F) WORK=(12)
FINISH=(F, T, F) WORK=(12)
FINISH=(T, T, T) WORK=(12)
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Select one:
1
NULL
-1
Question 14
Correct
Flag question
Which is incorrect about Semaphore?
Select one:
One important statement in signal (or V) operator is
to increase the integer by 1.
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 2
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(F, F, F, T, F), WORK=(3, 3, 2)
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(F, F, F), WORK=(4)
P0 5
10 3
P1 2
4
P2 2
9
Select one:
FINISH=(F, F, F), WORK=(4)
PROCESS A B C
A B C A B
C
P0 0 1 0
7 5 3 3
3 2
P1 2 0 0
3 2 2
P2 3 0 2
9 0 2
P3 2 1 1
2 2 2
P4 0 0 2
4 3 3
Select one:
FINISH=(T, T, T, T, T), WORK=(10, 5, 7)
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
remove a process P
from S->L;
wakeup(P);
Select one:
S can not be initialized by 3
Finish review
Flag question
PROCESS TAPES TAPES TAPES
P0 5 10 3
P1 2 4
P2 2 9
Which is the correct value of FINISH and WORK vectors during the running of
Banker's algorithm?
Select one:
FINISH=(T, T, T) WORK=(12)
FINISH=(T, F, T) WORK=(12)
FINISH=(F, T, F) WORK=(12)
FINISH=(T, F, F) WORK=(12)
/
Question 2 Given the two bellow processes sharing three semaphores full, empty, mutex, and a buffer
Correct buff having initial N empty slots:
Flag question
int buff[N];
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
wait(mutex);
/
Read(buff);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
The minimum value of full is -1.
Question 4 Given the following resource allocation graph, provide the name of the edge from R2 to P2
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
Remove flag
A B C A B
C A B C
/
P0 0 0 1 0 0
1 1 5 2
P1 1 0 0 1 7
5
P2 1 3 5 2 3
5
P3 0 6 3 0 6
5
P4 0 0 1 0 6
5
Select one:
P0 P2 P1 P3 P4 is a safe sequence, the request can be granted immediately
Question 6 Which is CORRECT about the goal of mutual exclusion condition of critical section?
Correct
Select one:
Mark 1.00 out of
1.00 It tries to utilize the shared resource more effectively
Remove flag /
Select one:
There is no deadlock in a multiple instance resource type system.
There is a cycle in the graph: P1-R1-P3-R2-P1, thus there is a deadlock in the system.
There is no deadlock in the system, since there is a safe sequence for processes to
run.
Question 8 Given the following resource allocation graph, provide the name of the edge from R2 to P2
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
Question 9 Given the code of two semaphore atomic operation, where S is initialized by 3. Suppose
Correct process P1 calls wait(S), and P2 calls wait(S) before P1 calling signal(S). Which of the
following is incorrect?
Mark 1.00 out of
1.00
void wait(semaphore *S)
Remove flag
S->value--;
if (S->value<0) {
/
Add the requested process P into S->L;
block(P);
S->value++;
if (S->value<=0) {
wakeup(P);
Select one:
S can not be initialized by 3
Remove flag
A B C A B
C A B C
P0 0 1 0 0 0
0 0 0 0
P1 2 0 0 2 0
2
P2 3 0 3 0 0
0
P3 2 1 1 1 0
0
P4 0 0 2 0 0
2
Select one:
The system is in a safe state since P0 P2 P1 P3 P4 is a safe sequence
The system is in a safe state since P0 P2 P3 P1 P4 is a safe sequence
The disk has the ability to read/write the processes' requests concurrently, thus there is
no race condition
The operating system is responsible for managing disk - the shared resource
Remove flag
void wait(int &S)
while (S<=0);
S--;
/
S++;
Select one:
When the resource is in use, and another process call wait(), the CPU is waste to run
the while loop.
Question 15 Given the following resource allocation graph, provide the name of the edge from R2 to P1
Correct (Assignment, Claim,or Request)?
Flag question
/
Answer: Assignment
/
The operating system is responsible for handling critical section on main memory
among running processes
Question 17 Given the code of two semaphore atomic operation, where S is initialized by 1. Suppose
Correct process P1 calls wait(S), and P2 calls wait(S) before P1 calling signal(S). Which of the
following is incorrect?
Mark 1.00 out of
1.00
void wait(semaphore *S)
Flag question
S->value--;
if (S->value<0) {
block(P);
S->value++;
if (S->value<=0) {
/
remove a process P from S->L;
wakeup(P);
Select one:
P2 is put into the waiting queue L of S
Question 18 Given the following resource allocation graph. What is the correct name of the edge from
Correct R3 to P3?
Flag question
/
Select one:
Assignment edge.
Claim edge.
Request edge.
Flag question A php page in a webserver connects to a Database Management System (such as
Microsoft SQL Server)
A web browser views a webpage from a web server.
15
10
60
80
70
Question 11
Correct
Flag question
Suppose a system uses SJN (or SJF) CPU scheduling
algorithm. The processes information (arrival time,
duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is
the average waiting time of the processes?
Select one:
2
Flag question
Answer: P1, P3, P2, P4, P3
Flag question
Answer: P1 P3 P4 P2
FIFO
a=a+b
add AX, BX
37
17
27
Process management
Flag question
Answer: 15.75
Finish review
Question 1 Suppose a paging system has the page fault rate=0.3%; the memory access time is: 250
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Flag question
Answer: 85
Question 2 A system does NOT use Translation Look-aside Buffer (TLB) for address translation in
Correct paging (1 level page table). Suppose the access time of the memory is 200ms; Which is the
Effective Access Time (EAT) of the system?
Mark 1.00 out of
1.00
Select one:
Flag question
160 ms
200 ms
180 ms
400 ms
Question 3 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (3, 106) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Answer: 3306
Flag question
Flag question
Question 5 Suppose a system uses second chance page replacement algorithm with 6 frames. The
Correct values of the reference bits of the frames are 1 1 0 1 1 0. The current position of the pointer
is at 2nd frame. When the page replacement is called, show the values of the reference bits
Mark 1.00 out of
(e.g. 1 1 0 1 1 0)?
1.00
Flag question
Answer: 1 0 0 1 1 0
Question 6 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00
Flag question
0 1291 1
1 12 0
2 5 1
3 23 1
4 132 0
Calculate the physical address of the logical address 986? (e.g. 18932
or error)
Answer: 1322970
Question 7 Suppose a system uses paging (1 level page table), and the access time of memory is 200
Correct ms. Calculate the time to access the memory from a reference (p,d)?
/
Mark 1.00 out of
Answer: 400
1.00
Flag question
Question 8 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00
Flag question
0 1291 1
1 12 0
2 5 1
3 23 1
4 132 0
Calculate the physical address of the logical address 3782? (e.g. 1893
2 or error)
Answer: 24262
Question 9 Suppose a paging system has the page fault rate=0.08%; the memory access time is: 150
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 38
Flag question
Question 10 Suppose a system uses paging (1 level page table) with Translation Look-aside Buffer
Correct (TLB) for address translation. Which statement is INCORRECT?
Select one:
/
Mark 1.00 out of The physical address is f*frame_size+d, where f is the corresponding frame of p
1.00
It always takes at least a TLB access and a 2 memory accesses for a reference (p, d)
Remove flag
Question 11 Suppose a system uses paging on demand without a Translation Look-aside Table (TLB).
Correct The memory access time is 200 nano seconds; page-fault service time is 7 miliseconds;
page-fault rate is 1/1000. Which is the Effective Access Time (EAT) of the system?
Mark 1.00 out of
1.00
Select one:
Flag question
9.2 micro seconds
6.2 micro seconds
Question 12 Suppose a system uses paging (1-level page table) with the frame size of 4KB; the address
Correct register is 32bits. Which is the CORRECT split of the address register?
(page-offset)=(19:13)
(page-offset)=(21:11)
Question 13 Suppose a paging system has the page fault rate=0.3%; the memory access time is: 200
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 106
Flag question
Question 14 A system uses proportional memory allocation method. There are 3 processes in the
Correct system: P1, P2, P3 with the size of 138KB, 96KB, and 164KB, correspondingly. Suppose
the memory size is 180KB, and the frame size is 2KB, calculate the number of frames
Mark 1.00 out of
allocated for processes P1, P2, P3 (e.g. 23:34:12)?
1.00
Flag question
Answer: 31:22:37
/
Question 15 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (4, 106) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Flag question
Answer: 4806
Remove flag It is the situation where page fault rate is high, the time for serving page faults is high
CPU utilization is low when thrashing occurs
Question 17 Suppose a system uses segmentation memory allocation. The content of the segment table
Correct (limit, base) of a process is [(1000, 1400), (400, 6300), (400, 4300), (1100, 3200), (1000,
4700)]. Calculate the physical address of the reference (1, 402) (e.g. a number or invalid)?
Mark 1.00 out of
1.00
Answer: invalid
Flag question
Question 18 Suppose a paging system has the page fault rate=0.08%; the memory access time is: 320
Correct nano seconds; and the page fault handling time is: 7 milli seconds. How many times the
performance is slowdown? (eg. 87).
Mark 1.00 out of
1.00
Answer: 18
Flag question
Flag question
Answer: 12
Question 20 Given the 1-level page table of a process as bellow, with the frame size=1KB.
Correct
FRAME VALID
Mark 1.00 out of
1.00