Javatpoint Logo
Javatpoint Logo

GATE 2018 CS Set 3

9) The following are some events that occur after a device controller issues an interrupt while process L is under execution.

(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.

Which of the following is the correct order in the which the events above occur?

  1. QPTRS
  2. PTRSQ
  3. TRPQS
  4. QTPRS

Answer: A

Explanation:

GATE CS Set 3

The above figure describes the simple interrupt processing. According to this option (A) will be the correct order in the which the events above occurred.


10) Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is M units if the corressponding memory page is available in memory, and D units if the memory access causes a page fault. It has been experimental measured that the average time taken for a memory access in the process is X units. Which one of the following is the correct expression for the page fault rate experienced by the process?

  1. (D - M) / (X - M)
  2. (X - M) / (D - M)
  3. (D - X) / (D - M)
  4. (X - M) / (D - X)

Answer: B

Explanation:

Suppose P be the page fault rate.

We know,

Average memory access time = (1- page fault rate) × memory access time when no page fault occurred + Page fault rate × Memory access time when page fault occured.

   X = (1-P) M + PD
    X = M - PM + PD
    X = M + P (D - M)
    X - M = P (D - M)

Hence,
    P = (X - M) / (D - M)


11) In an Entity-Relationship (ER) model, suppose R is a many-to-one relationship from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in R and that the cardinality of E1 is greater that the cardinality of E2. Which one of the following is true about R?

  1. Every entity in E1 is associated with exactly one entity in E2.
  2. Some entity in E1 is associated with more than one entity in E2.
  3. Every entity in E2 is associated with exactly one entity in E1.
  4. Every entity in E2 is associated with at most one entity in E1.

Answer: A

Explanation:

Given,
Relation (R) is many to one

GATE CS Set 3

Two Entity Set -> E1 and E2
Cardinality of E1 > Cardinality of E2

Note: Cardinality of a set/Entity set is the number of instances/elements in that set.

Therefore,

GATE CS Set 3

1. Every entity in E1 is associated with exactly one entity in E2 or no entity in E1 can be related to more than one entity in E2 and
2. An entity in E2 can be related to more than one entity in E1.


12) Consider the following two tables and four queries in SQL.

Book (isbn, bname), Stock (isbn, copies)

Query 1:

Query 2:

Query 3:

Query 4:

Which one of the queries above is certain to have an output that is a superset of the outputs of the other three queries?

  1. Query 1
  2. Query 2
  3. Query 3
  4. Query 4

Answer: D

Explanation:

We know that the FULL OUTER JOIN combines all left and right outer joins along With Null Values and returns all rows (matched or unmatched) from the tables on both sides of the join clause. In this Left Outer Join Only Display in relation Table As Left side Entities and Right Outer Join Display All in Right Side Entities.

Hence, option (D) is a correct answer.


13) Match the following:

Field Length in bits
P. UDP Header's Port Number I. 48
Q. Ethernet MAC Address II. 8
R. IPv6 Next Header III. 32
S. TCP Header's Sequence Number IV. 16

  1. P-III, Q-IV, R-II, S-I
  2. P-II, Q-I, R-IV, S-III
  3. P-IV, Q-I, R-II, S-III
  4. P-IV, Q-I, R-III, S-II

Answer: C

Explanation:

UDP header Port Number - 16 bits

Ethernet MAC address - it is in 6-byte in length i.e. 48 bits

IPv6 next header - It indicates either the first extension header or the protocol in the upper layer such as TCP, UDP, or ICMPv6. Its size is 8 bits.

TCP Header's Sequence Number - 32 bits

Hence, the correct option is (C).


14) Consider the following statements regarding the slow start phase of the TCP congestion control algorithm. Note that cwnd stands for the TCP congestion window and MSS denotes the Maximum Segment Size.

(i) The cwnd increase by 2 MSS on every successful aknowledgement.
(ii) The cwnd approximately doubles on every successful acknolfgedment.
(iii) The cwnd increase by 1 MSS every round trip time.
(iv) The cwnd approximately doubles every round trip time.

Which one of the following is correct?

  1. Only (ii) and (iii) are true
  2. Only (i) and (iii) are true
  3. Only (iv) is true
  4. Only (i) and (iv) are true

Answer: C

Explanation:

The slow-start phase of TCP congestion control begins initially with a cwnd of 1, 2, 4 or 10 MSS. Each time when an acknowledgment (ACK) is received the value of the Congestion Window will be increased by one segment, effectively doubling the window size each round-trip time (approximately exponential).

The congestion control (cwnd) increase by 1 MSS on every successful acknowledgment.

Therefore, only statement (iv) is correct.

Hence, Option (C) is the correct option.


15) Two people, P and Q, decide to independently roll two identical dice, each with 6 faces, numbered 1 to 6. The person with the lower number wins. In case of a tie, they roll the dice repeatedly until there is no tie. Define a trial as a throw of the dice by P and Q. Assume that all 6 numbers on each dice are equi-probable and that all trials are independent. The probability (rounded to 3 decimal places) that one of them wins on the third trial is _____.

  1. 0.469
  2. 0.346
  3. 0.023
  4. 0.043

Answer: C

Explanation:

Let A be the event of both P and Q getting the same number on dice in one trial and B be the event of both P and Q getting the different numbers on the dice in one trial.

Therefore, P(A) = 6/36 = 1/6 and P(B) = 30/36 = 5/6

Hence, The probability that one of them (P or Q) wins on the third trial is

= P(A ∩ A ∩ B)
= P(A) P(A) P(B)
= 1/6 * 1/6 * 5/6
= 5/216
= 0.023


16) The value ofGATE CS Set 3correct to three decimal places (assuming that π = 3.14) is _______ .

  1. 0.289
  2. 0.398
  3. 0.829
  4. 0.429

Answer: A

Explanation:

put x2 = t
2xdx = dt
t will range from 0 to x2/16
Now our new Integral is:GATE CS Set 3
GATE CS Set 3= 1/2 [sin(.616225)-0] = 0.5779 / 2

= 0.289


GATE 2018 CS Set 3-1
GATE 2018 CS Set 3-3
GATE 2018 CS Set 3-4
GATE 2018 CS Set 3-5
GATE 2018 CS Set 3-6
GATE 2018 CS Set 3-7
GATE 2018 CS Set 3-8
GATE Introduction





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA