Exams › GATE › Technical › Computer Science and Information Technology Set 2 (C S2)
3 questions with worked solutions.
Q1. Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
Answer: A deadlock is possible with 2PL
Deadlocks can occur in the Two Phase Locking protocol because transactions may hold locks while waiting for other locks to be released, leading to a situation where two or more transactions are waiting indefinitely for each other.
Answer: Header Checksum
The Header Checksum is recalculated by routers each time an IP packet is forwarded to ensure data integrity, as the packet may have been altered during transit. This modification is necessary to reflect any changes in the packet's contents or routing information.
Answer: The function call fX("abcd") will always return a value
The function fX counts the number of characters in the string pointed to by 'a' by iterating through it until it reaches the null terminator. Since the input '"abcd"' is a valid string, the function will successfully return the length of the string, which is always a value.