1
GATE CSE 2022
+1
-0.33

Consider four processes P, Q, R and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t = 0. There is exactly one context switch from S to Q, exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?

A
P = 4, Q = 10, R = 6, S = 2
B
P = 2, Q = 9, R = 5, S = 1
C
P = 4, Q = 12, R = 5, S = 4
D
P = 3, Q = 7, R = 7, S = 3
2
GATE CSE 2022
Numerical
+1
-0.33

Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string

7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is _____________.

3
GATE CSE 2022
+1
-0.33

What is printed by the following ANSI C program?


#include <stdio.h>
int main(int argc, char *argv[ ]) {
int x = 1, z[2] = {10, 11};
int *p = NULL;
p = &x;
*p = 10;
p = &z[1];
*(&z[0] + 1) += 3;
printf("%d, %d, %d\n", x, z[0], z[1]);
return 0;
}


A
1, 10, 11
B
1, 10, 14
C
10, 14, 11
D
10, 10, 14
4
GATE CSE 2022
+1
-0.33

What is printed by the following ANSI C program?


#include <stdio.h>
int main(int argc, char *argv[ ]) {
int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9},
{10, 11, 12, 13, 14, 15, 16, 17, 18},
{19, 20, 21, 22, 23, 24, 25, 26, 27}};
int i = 0, j = 0, k = 0;
for(i = 0; i < 3; i++) {
for(k = 0; k < 3; k++)
printf("%d"",a[i][j][k]);
printf("\n");
}
return 0;
}


A
$$\matrix{ 1 & 2 & 3 \cr {10} & {11} & {12} \cr {19} & {20} & {21} \cr }$$
B
$$\matrix{ 1 & 4 & 7 \cr {10} & {13} & {16} \cr {19} & {22} & {25} \cr }$$
C
$$\matrix{ 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 8 & 9 \cr }$$
D
$$\matrix{ 1 & 2 & 3 \cr {13} & {14} & {15} \cr {25} & {26} & {27} \cr }$$
GATE CSE Papers
2023
2022
2020
2019
2018
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
EXAM MAP
Medical
NEET