CS and IT Gate 2017 Set-1 Questions with Answer

Ques 53 Gate 2017 Set-1


Let X be a Gaussian random variable with mean 0 and variance σ2. Let Y = max(X,0) where max(a,b) is the maximum of a and b. The median of Y is _____.


(0) is the correct answer.

Ques 54 Gate 2017 Set-1


Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:

Process Arrival Time Brust Time
P1 0 7
P2 3 3
P3 5 5
P4 6 2


If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _______ milliseconds.


(a) is the correct answer.

Ques 55 Gate 2017 Set-1


Recall that Belady’s anomaly is that the pages-fault rate may increase as the number of allocated frames increases. Now consider the following statements:

S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady’s anomaly.
S2: LRU page replacement algorithm suffer from Belady’s anomaly .


Which of the following is CORRECT?

A

S1 is true, S2 is true

B

S1 is true, S2 is false

C

S1 is false , S2 is true

D

S1 is false, S2 is false


(B) is the correct answer.

Given:
Two statements regarding Belady's anomaly:
S1: Random page replacement algorithm suffers from Belady’s anomaly.
S2: LRU page replacement algorithm suffers from Belady’s anomaly.
To find:
Which of the statements S1 and S2 are correct.
Solution:
Let me check statement S2 first.
A page replacement algorithm is free from Belady's anomaly if it belongs to the class of stack algorithms.
For a stack algorithm, the set of pages in memory for n frames is always a subset of the pages in memory for n + 1 frames.
Since LRU (Least Recently Used) is a stack algorithm, it can never suffer from Belady's anomaly.
So, statement S2 is false.
Now let me check statement S1.
The Random page replacement algorithm randomly picks a page to replace.
Because of this random choice, it does not satisfy the inclusion property of stack algorithms.
Since it is not a stack algorithm, it can exhibit Belady's anomaly where increasing the number of frames leads to more page faults.
So, statement S1 is true.
Therefore, S1 is true and S2 is false.
Answer: (B) S1 is true, S2 is false

Ques 56 Gate 2017 Set-1


A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:

A

x = 1, y = 2

B

x = 2, y = 1

C

x = 2, y = 2

D

x = 1, y = 1


(d) is the correct answer.

PROCESSED

Ques 57 Gate 2017 Set-1


Threads of a process share

A

global variables but not heap

B

heap but not global variables.

C

neither global variables nor heap.

D

both heap and global variables.


(d) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......