Question 1
The following is a code with two threads, producer and consumer, that can run in parallel. Further, S and Q are binary semaphores equipped with the standard P and V operations.
semaphore S = 1, Q = 0; integer x;
producer: consumer: while (true) do while (true) do P(S); P(Q); x = produce (); consume (x); V(Q); V(S); done done Which of the following is TRUE about the program above?
The process can deadlock
One of the threads can starve
Some of the items produced by the producer may be lost
Values generated and stored in 'x' by the producer will always be consumed before the producer can generate a new value
Question 2
An operating system implements a policy that requires a process to release all resources before making a request for another resource. Select the TRUE statement from the following:
Both starvation and deadlock can occur
Starvation can occur but deadlock cannot occur
Starvation cannot occur but deadlock can occur
Neither starvation nor deadlock can occur
Question 3
If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process, then the policy will
degenerate to shortest job first
degenerate to priority scheduling
degenerate to first come first serve
none of the above
Question 4
Data transmitted on a link uses the following 2D parity scheme for error detection:
Each sequence of 28 bits is arranged in a 4×7 matrix (rows r0 through r3, and columns d7 through d1) and is padded with a column d0 and row r4 of parity bits computed using the Even parity scheme. Each bit of column d0 (respectively, row r4) gives the parity of the corresponding row (respectively, column). These 40 bits are transmitted over the data link.
The table shows data received by a receiver and has n corrupted bits. What is the minimum possible value of n?
1
2
3
4
Question 5
The minimum frame size required for a CSMA/CD based computer network running at 1 Gbps on a 200m cable with a link speed of 2 × 108m/s is
125 bytes
250 bytes
500 bytes
None of these
Question 6
A 1Mbps satellite link connects two ground stations. The altitude of the satellite is 36,504 km and speed of the signal is 3 × 108 m/s. What should be the packet size for a channel utilization of 25% for a satellite link using go-back-127 sliding window protocol? Assume that the acknowledgment packets are negligible in size and that there are no errors during communication.
120 bytes
60 bytes
240 bytes
90 bytes
Question 7
How many bytes of data can be sent in 15 seconds over a serial link with baud rate of 9600 in asynchronous mode with odd parity and two stop bits in the frame?
10,000 bytes
12,000 bytes
15,000 bytes
27,000 bytes
Question 8
Which of the following is TRUE?
The cost of searching an AVL tree is θ (log n) but that of a binary search tree is O(n)
The cost of searching an AVL tree is θ (log n) but that of a complete binary tree is θ (n log n)
The cost of searching a binary search tree is O (log n ) but that of an AVL tree is θ(n)
The cost of searching an AVL tree is θ (n log n) but that of a binary search tree is O(n)
Question 9
If we use Radix Sort to sort n integers in the range (nk/2,nk], for some k>0 which is independent of n, the time taken would be?
Θ(n)
Θ(kn)
Θ(nlogn)
Θ(n2)
Question 10
Arrange the following functions in increasing asymptotic order:
A. n1/3
B. en
C. n7/4
D. n log9n
E. 1.0000001n
A, D, C, E, B
D, A, C, E, B
A, C, D, E, B
A, C, D, B, E
There are 85 questions to complete.