GATE 2003
107 questions
MCQ 1071-mark 107
Questions 101–105 of 107
Consider three data items D1,D2 and D3 and the following execution schedule of transactions T1,T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively.
Which of the following statements is correct?
Which of the following statements is correct?
Answer: (D)
Take the operations in time order and build the precedence graph. On , writes before reads and writes it, so . On , writes before reads and writes it, so . The graph has a cycle, so the schedule is not conflict serializable.
Next, check view serializability. The cycle already shows that no order works if we look at these two conflicts, but view equivalence is a different test, so check it directly by contradiction:
Answer: (D)
Next, check view serializability. The cycle already shows that no order works if we look at these two conflicts, but view equivalence is a different test, so check it directly by contradiction:
- Initial read
reads from the initial database, and modifies . So must run before .
That is,
- Final write
In the given schedule, the final write of is done by , and also writes , that is .
This means must run after .
That is,
Answer: (D)
Which of the following scenarios may lead to an irrecoverable error in a database system?
Answer: (D)
An irrecoverable error happens when a transaction commits after reading data written by a transaction that later fails.
- (A) A transaction writes an item after another transaction has read it. The reader may get an unrepeatable read or a phantom tuple if it reads again, but it never depends on uncommitted data written by someone else. No irrecoverable error.
- (B) Both transactions only read the item. No problem.
- (C) The item was written by a transaction that has already committed, so that write will not be rolled back. No problem.
- (D) This is a dirty read. Suppose the transaction that read the uncommitted data commits, and the transaction that wrote it then fails and rolls back. The reader has committed a result based on a value that never existed, and it cannot be undone. This is an irrecoverable error.
Answer: (D)
- (A) A transaction writes an item after another transaction has read it. The reader may get an unrepeatable read or a phantom tuple if it reads again, but it never depends on uncommitted data written by someone else. No irrecoverable error.
- (B) Both transactions only read the item. No problem.
- (C) The item was written by a transaction that has already committed, so that write will not be rolled back. No problem.
- (D) This is a dirty read. Suppose the transaction that read the uncommitted data commits, and the transaction that wrote it then fails and rolls back. The reader has committed a result based on a value that never existed, and it cannot be undone. This is an irrecoverable error.
Answer: (D)
Host A is sending data to host B over a full duplex link. A and B are using the sliding window protocol for flow control. The send and receive window sizes are 5 packets each. Data packets (sent only from A to B) are all 1000 bytes long and the transmission time for such a packet is 50 . Acknowledgment packets (sent only from B to A), are very small and require negligible transmission time. The propagation delay over the link is 200 . What is the maximum achievable throughput in this communication ?
Answer: (B)
Transmission time , propagation delay , so .
To keep the link fully busy we need packets in flight. The window is only packets, so
.
Link bandwidth .
Maximum throughput .
Check: packets of bytes are sent in one cycle of , and B/s.
Answer: (B)
To keep the link fully busy we need packets in flight. The window is only packets, so
.
Link bandwidth .
Maximum throughput .
Check: packets of bytes are sent in one cycle of , and B/s.
Answer: (B)
A 2 km long brodcast LAN has bps bandwidth and uses CSMA/CD. The signal travels along the wire at 2*m/s. What is the minimum packet size that can be used on this network ?
Answer: (D)
In CSMA/CD, a collision can be detected only if the transmission time (which depends on the packet size) is greater than twice the propagation delay.
Propagation delay here:
Transmission time for bytes:
This gives:
So the answer is none of these.
Correct Answer:
Propagation delay here:
Transmission time for bytes:
This gives:
So the answer is none of these.
Correct Answer:
The subnet mask for a particular network is 255.255.31.0 Which of the following pairs of IP addresses could belong to this network ?
Answer: (D)
Two addresses belong to the same network if ANDing each with the mask gives the same result. The mask 255.255.31.0 has in the third octet, so only the last 5 bits of the third octet are kept. The mask has 0 in the fourth octet, so the last octet is ignored.
(A) 172.57.x.x and 172.56.x.x: the second octet is kept in full (mask 255), and 57 differs from 56. So the networks differ.
(B) 191.203.x.x and 191.234.x.x: 203 differs from 234. So the networks differ.
(C) 10.35.28.2 AND mask (), and 10.35.29.4 AND mask (). They differ.
(D) 128.8.129.43 AND mask (, and ), and 128.8.161.55 AND mask (, and ). They match.
Answer: (D)
(A) 172.57.x.x and 172.56.x.x: the second octet is kept in full (mask 255), and 57 differs from 56. So the networks differ.
(B) 191.203.x.x and 191.234.x.x: 203 differs from 234. So the networks differ.
(C) 10.35.28.2 AND mask (), and 10.35.29.4 AND mask (). They differ.
(D) 128.8.129.43 AND mask (, and ), and 128.8.161.55 AND mask (, and ). They match.
Answer: (D)