VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/gate-it-2007-2-gq/

⇱ Quiz about Gate IT 2007


Last Updated :
Discuss
Comments

Question 1

Processes P

1

and P

2

use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program.


get_exclusive_access ( ) { if (critical _flag == FALSE) { critical_flag = TRUE ; critical_region () ; critical_flag = FALSE; } }

Consider the following statements.


i. It is possible for both P

1

and P

2

to access critical_region concurrently.


ii. This may lead to a deadlock.


Which of the following holds?

  • (i) is false and (ii) is true

  • Both (i) and (ii) are false

  • (i) is true and (ii) is false

  • Both (i) and (ii) are true

Question 2

Consider the following program:

What is the output of the program for the following input ? 5 2 * 3 3 2 + * +

  • 15

  • 25

  • 30

  • 150

Question 3

Consider the C program given below :

What is the value printed out when this program is executed?

  • 9

  • 8

  • 7

  • 6

Question 4

The address sequence generated by tracing a particular program executing in a pure demand paging system with 100 bytes per page is

0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0410.


Suppose that the memory can store only one page and if x is the address which causes a page fault then the bytes from addresses x to x + 99 are loaded on to the memory.

How many page faults will occur ?

  • 0

  • 4

  • 7

  • 8

Question 5

The minimum positive integer p such that 3p modulo 17 = 1 is

  • 5

  • 8

  • 12

  • 16

Question 6

The function f is defined as follows: 

Assuming that arbitrarily large integers can be passed as a parameter to the function, consider the following statements.
1. The function f terminates for finitely many different values of n ≥ 1. 
ii. The function f terminates for infinitely many different values of n ≥ 1. 
iii. The function f does not terminate for finitely many different values of n ≥ 1. 
iv. The function f does not terminate for infinitely many different values of n ≥ 1. 
Which one of the following options is true of the above?

  • (i) and (iii)

  • (i) and (iv)

  • (ii) and (iii)

  • (ii) and (iv)

Question 7

Consider a weighted undirected graph with positive edge weights and let uv be an edge in the graph. It is known that the shortest path from the source vertex s to u has weight 53 and the shortest path from s to v has weight 65. Which one of the following statements is always true?

  • weight (u, v) < 12

  • weight (u, v) ≤ 12

  • weight (u, v) > 12

  • weight (u, v) ≥ 12

Question 8

Consider the program below in a hypothetical language which allows global variable and a choice of call by reference or call by value methods of parameter passing.

Which one of the following options represents the correct output of the program for the two parameter passing mechanisms?

  • Call by value : i = 70, j = 10; Call by reference : i = 60, j = 70

  • Call by value : i = 50, j = 60; Call by reference : i = 50, j = 70

  • Call by value : i = 10, j = 70; Call by reference : i = 100, j = 60

  • Call by value : i = 100, j = 60; Call by reference : i = 10, j = 70

Question 9

Which of the following input sequences for a cross-coupled R-S flip-flop realized with two NAND gates may lead to an oscillation ?

  • 11, 00

  • 01, 10

  • 10, 01

  • 00, 11

Question 10

The following circuit implements a two-input AND gate using two 2-1 multiplexers. What are the values of X1, X2, X3 ?

  • X1=b, X2=0, X3=a

  • X1=b, X2=1, X3=b

  • X1=a, X2=b, X3=1

  • X1=a, X2=0, X3=b

Tags:

There are 82 questions to complete.

Take a part in the ongoing discussion