GATE 2016 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2016 (Session 2)

65 questions

MCQ 38 · NAT 271-mark 30 · 2-mark 35

Questions 56–60 of 65

Q56Parsing2 marksMCQ−0.67 if wrong
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example,
int a[10][3];
The grammars use D as the start symbol,and use six terminal symbols int ;id[]num.
Grammar G1            Grammar G2
D → int L;            D → int L;
L → id [E             L → id E
E → num]              E → E[num]
E → num] [E           E → [num]

Which of the grammars correctly generate the declaration mentioned above?

Q57CPU Scheduling2 marksNAT
Consider the following processes, with the arrival time and the length of the CPU burst given in milli seconds.The scheduling algorithm used is preemptive shortest remaining-time first.
Process Arrival Time Burst Time P1 0 10 P2 3 6 P3 7 1 P4 8 3
The average turn around time of these processes is milliseconds.

Q58Process Synchronization2 marksMCQ−0.67 if wrong
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?

Q59Process Synchronization2 marksNAT
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 12V(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 ________.

Q60Cache Memory2 marksNAT
A file system uses an in-memory cache to cache disk blocks.The miss rate of the cache is shown in the figure. The latency to read a block from the cache is 1 ms and to read a block from the disk is 10ms. Assume that the cost of checking whether a block exists in the cache is negligible. Available cache sizes are in multiples of 10MB.
0 0 10 10 20 20 30 30 40 40 50 50 60 60 70 70 80 80 90 90 Miss rate (%) Cache size (MB)
The smallest cache size required to ensure an average read latency of less than 6ms is_________ MB.