Question 1
Consider the following two-process synchronization solution.
Process 0 Process 1
Entry: loop while (turn == 1); Entry: loop while (turn == 0);
(critical section) (critical section)
Exit: turn = 1; Exit turn = 0;
The shared variable turn is initialized to zero. Which one of the following is TRUE?
This is a correct two-process synchronization solution.
This solution violates mutual exclusion requirement.
This solution violates progress requirement.
This solution violates bounded wait requirement.
Question 2
Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is ________.
7
8
9
10
Question 3
In an Ethernet local area network, which one of the following statements is TRUE ?
A station stops to sense the channel once it starts transmitting a frame.
The purpose of the jamming signal is to pad the frames that are smaller than the minimum frame size.
A station continues to transmit the packet even after the collision is detected.
The exponential backoff mechanism reduces the probability of collision on retransmissions
Question 4
Consider a 128×103 bits/second satellite communication link with one-way propagation delay of 150 milliseconds. Selective retransmission (repeat) protocol is used on this link to send data with a frame size of 1 kilobyte. Neglect the transmission time of acknowledgment. The minimum number of bits required for the sequence number field to achieve 100% utilization is ___________
2
4
6
8
Question 5
A network has a data transmission bandwidth of 20 × 106 bits per second. It uses CSMA/CD in the MAC layer. The maximum signal propagation time from one node to another node is 40 microseconds. The minimum size of a frame in the network is _________ bytes.
Note : This question was asked as Numerical Answer Type.
200
250
400
1200
Question 6
Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following is TRUE?
I. Quicksort runs in Θ(n2) time
II. Bubblesort runs in Θ(n2) time
III. Mergesort runs in Θ(n) time
IV. Insertion sort runs in Θ(n) time
I and II only
I and III only
II and IV only
I and IV only
Question 7
Let A1, A2, A3, and A4 be four matrices of dimensions 10 x 5, 5 x 20, 20 x 10, and 10 x 5, respectively. The minimum number of scalar multiplications required to find the product A1A2A3A4 using the basic matrix multiplication method is
1500
2000
500
100
Question 8
The value printed by the following program is
void f(int* p, int m)
{
m = m + 5;
*p = *p + m;
return;
}
void main()
{
int i=5, j=10;
f(&i, j);
printf("%d", i+j);
}
10
20
30
40
Question 9
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
LRU (Least Recently Used)
OPT (Optimal Page Replacement)
MRU (Most Recently Used)
FIFO (First In First Out)
Question 10
Consider the following program:
int f(int *p, int n)
{
if (n <= 1) return 0;
else return max(f(p+1,n-1),p[0]-p[1]);
}
int main()
{
int a[] = {3,5,2,6,4};
printf("%d", f(a,5));
}
Note: max(x,y) returns the maximum of x and y. The value printed by this program is
2
3
4
5
There are 65 questions to complete.