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

GATE 2024 (Session 2)

65 questions

MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35

Questions 46–50 of 65

Q46Process Synchronization2 marksMSQ
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global variable x (initialized to 0). The threads execute the code shown below.

// code of T1
wait(s1);
x = x+1;
print(x);
wait(s2);
signal(s1);

// code of T2
wait(s1);
x = x+1;
print(x);
signal(s2);
signal(s1);
Which of the following outcomes is/are possible when threads T1 and T2 execute concurrently?

One or more options are correct.

Q47Matrix Algebra2 marksMSQ
Let AA be an n×nn \times n matrix over the set of all real numbers RR. Let BB be a matrix obtained from AA by swapping two rows. Which of the following statements is/are TRUE?

One or more options are correct.

Q48Stack2 marksMSQ
Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is empty, as shown below.

400(Top)300200100\begin{array}{|c|} \hline 400 (Top) \\ \hline 300 \\ \hline 200\\ \hline 100 \\ \hline \end{array}
Stack S1

\begin{array}{|c|} \hline \\ \hline \\ \hline \end{array}
Stack S2

Only the following three operations are available:

PushToS2: Pop the top element from S1 and push it on S2.
PushToS1: Pop the top element from S2 and push it on S1.
GenerateOutput: Pop the top element from S1 and output it to the user.

Note that the pop operation is not allowed on an empty stack and the push operation is not allowed on a full stack.

Which of the following output sequences can be generated by using the above operations?

One or more options are correct.

Q49Number System2 marksMSQ
Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?

One or more options are correct.

Q50Combinational Circuit2 marksMSQ
Consider 4-variable functions f1,f2,f3,f4f 1, f 2, f 3, f 4 expressed in sum-of-minterms form as given below.
f1=∑(0,2,3,5,7,8,11,13)f2=∑(1,3,5,7,11,13,15)f3=∑(0,1,4,11)f4=∑(0,2,6,13)\begin{aligned} & f 1=\sum(0,2,3,5,7,8,11,13) \\ & f 2=\sum(1,3,5,7,11,13,15) \\ & f 3=\sum(0,1,4,11) \\ & f 4=\sum(0,2,6,13) \end{aligned}

f1 f2 f3 f4 AND OR XOR Y
With respect to the circuit given above, which of the following options is/are CORRECT?

One or more options are correct.