GATE Computer Science Exam Practice paper - 2 Online Test

Consider the following transactions with data items P and Q initialized to zero:

T1 :read (P);

read (Q);

if P = 0 then Q := Q + 1 ;

write (Q).

T2 : read (Q);

read (P);

if Q = 0 then P := P + 1 ;

write (P).

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

Consider the 3 processes, P1, P2 and P3 shown in the table.

Process Arrival time Time Units Required

P1 0 5

P2 1 7

P3 3 4

The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling

with CPU quantum of 2 time units) are

Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of

memory location X, increments it by the value i, and returns the old value of X. It is used in the

pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable

initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value

corresponds to the lock being not available.


while (Fetch_And_Add(L,1))

L = 1;



L = 0;


This implementation

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available

with it: The ISP wants to give half of this chunk of addresses to Organization A,

and a quarter to Organization B, while retaining the remaining with itself. Which of the following is

a valid allocation of addresses to A and B?

Suppose a circular queue of capacity (n -1) elements is implemented with an array of n elements.

Assume that the insertion and deletion operations are carried out using REAR and FRONT as array

index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full

and queue empty are

A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect

block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the

size of each disk block address is 8 Bytes. The maximum possible file size in this file system is

Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D)

over a network of two routers (R1 and R2) and three links (L1, L2, and L3). L1 connects S to R1; L2

connects R1 to R2; and L3 connects R2 to D. Let each link be of length 100 km. Assume signals

travel over each link at a speed of 108 meters per second. Assume that the link bandwidth on each

link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total

sum of transmission and propagation delays in transmitting the file from S to D?


GATE 2014 Computer Science & IT Comprehensive Online Coaching. The most Comprehensive, Thorough, Enthusiastic and Supportive Preparation for GATE 2014 CS and IT. Prepare for GATE 2014 under the guidance of highly experienced instructors.


Umesh Pathak

it's very useful for preparation

1716 days 10 hours 44 minutes ago

Nadakuditi Gopikrishna

it's useful.

2402 days 12 hours 57 minutes ago

Arepalli Gopi

i did n't get the question ....please help me any one

2467 days 9 hours 21 minutes ago


Your Facebook Friends on WizIQ

More Tests By Author

IAS Practice Test -3 on Art & Culture
7 Questions | 784 Attempts

GATE Exam Practice Paper - 3
7 Questions | 509 Attempts

IAS Practice Test -2 on Indian National Movement.
5 Questions | 720 Attempts