GATE 2024 (Session 2)
65 questions
MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35
Questions 26–30 of 65
Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
One or more options are correct.
Answer: (A), (B)
A scan reads every record of the file.
- Heap and sorted files keep records packed in pages that sit next to each other. So each page is read only once, and these files are I/O efficient for a scan.
- Unclustered tree / hash index: following the index, the records lie in random pages. The same page may be read many times, about one I/O for each record. So these are not efficient for a scan.
Answer: (A), (B)
- Heap and sorted files keep records packed in pages that sit next to each other. So each page is read only once, and these files are I/O efficient for a scan.
- Unclustered tree / hash index: following the index, the records lie in random pages. The same page may be read many times, about one I/O for each record. So these are not efficient for a scan.
Answer: (A), (B)
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
One or more options are correct.
Answer: (A), (C), (D)
Let us go through each option:
- (A) 2PL ensures conflict serializability, so only serializable schedules are allowed: TRUE.
- (B) If a lock is taken just before each operation and freed just after it, 2PL is broken, because a lock is released and then a new lock is taken: FALSE.
- (C) A transaction has a growing phase and then a shrinking phase. After the first lock is released, no new lock can be taken (this is the definition): TRUE.
- (D) Deadlock can happen: T1 locks A, T2 locks B, and then each one waits for the lock held by the other: TRUE.
Answer: (A), (C), (D)
- (A) 2PL ensures conflict serializability, so only serializable schedules are allowed: TRUE.
- (B) If a lock is taken just before each operation and freed just after it, 2PL is broken, because a lock is released and then a new lock is taken: FALSE.
- (C) A transaction has a growing phase and then a shrinking phase. After the first lock is released, no new lock can be taken (this is the definition): TRUE.
- (D) Deadlock can happen: T1 locks A, T2 locks B, and then each one waits for the lock held by the other: TRUE.
Answer: (A), (C), (D)
Which of the following statements about IPv4 fragmentation is/are TRUE?
One or more options are correct.
Answer: (B), (C)
Recall the IPv4 fragmentation rules:
- (A) is false and (B) is true. In IPv4, any router can fragment a datagram if the MTU of its outgoing link is smaller than the datagram. It is not only the source.
- (C) is true and (D) is false. Fragments can travel by different routes, so an intermediate router may not see all of them. So reassembly happens only at the destination.
Answer: (B), (C)
- (A) is false and (B) is true. In IPv4, any router can fragment a datagram if the MTU of its outgoing link is smaller than the datagram. It is not only the source.
- (C) is true and (D) is false. Fragments can travel by different routes, so an intermediate router may not see all of them. So reassembly happens only at the destination.
Answer: (B), (C)
Which of the following statements is/are FALSE?
One or more options are correct.
Answer: (B), (D)
Check each statement:
- (A) An attribute grammar is an SDD whose semantic rules have no side effects. This is TRUE, as it is the definition.
- (B) "L-attributed definitions cannot always be evaluated in depth-first order" is FALSE. An L-attributed definition is built so that a left-to-right depth-first traversal of the parse tree can always evaluate it.
- (C) Synthesized attributes can be evaluated by a bottom-up parser during reductions. This is TRUE.
- (D) "All L-attributed definitions based on LR(1) grammars can be evaluated bottom-up" is FALSE. The marker non-terminal method is sure to work only for L-attributed definitions on LL(1) grammars. Adding markers can turn an LR(1) grammar into one that is not LR.
The false statements are B and D.
Answer: (B), (D)
- (A) An attribute grammar is an SDD whose semantic rules have no side effects. This is TRUE, as it is the definition.
- (B) "L-attributed definitions cannot always be evaluated in depth-first order" is FALSE. An L-attributed definition is built so that a left-to-right depth-first traversal of the parse tree can always evaluate it.
- (C) Synthesized attributes can be evaluated by a bottom-up parser during reductions. This is TRUE.
- (D) "All L-attributed definitions based on LR(1) grammars can be evaluated bottom-up" is FALSE. The marker non-terminal method is sure to work only for L-attributed definitions on LL(1) grammars. Adding markers can turn an LR(1) grammar into one that is not LR.
The false statements are B and D.
Answer: (B), (D)
For a Boolean variable , which of the following statements is/are FALSE?
One or more options are correct.
Answer: (B), (C)
Let us test each statement one by one:
- This is TRUE (identity law).
- This is FALSE, because .
- This is FALSE, because (idempotence).
- This is TRUE (complement law).
Answer: and
- This is TRUE (identity law).
- This is FALSE, because .
- This is FALSE, because (idempotence).
- This is TRUE (complement law).
Answer: and