GATE 2026 (Session 2)
65 questions
MCQ 35 · MSQ 11 · NAT 191-mark 30 · 2-mark 35
Questions 16–20 of 65
Which one of the following options is not a property of Boolean Algebra?
Note: is OR operation, is AND operation, and is NOT operation
Note: is OR operation, is AND operation, and is NOT operation
Answer: (B)
Let us check each law of Boolean algebra one by one:
- : This is the commutative law for OR. It is a valid property.
- : This is the commutative law for AND. It is also valid.
- : This is the complement law for OR. A variable OR-ed with its complement covers both cases, so the result is . It is valid.
- : This is wrong. The real complement law for AND is . A variable AND-ed with its complement can never be true. Exactly one of is and the other is , so their AND is always , not .
Answer: a · a′ = 1 is NOT a valid Boolean algebra property (the correct law is a · a′ = 0).
- : This is the commutative law for OR. It is a valid property.
- : This is the commutative law for AND. It is also valid.
- : This is the complement law for OR. A variable OR-ed with its complement covers both cases, so the result is . It is valid.
- : This is wrong. The real complement law for AND is . A variable AND-ed with its complement can never be true. Exactly one of is and the other is , so their AND is always , not .
Answer: a · a′ = 1 is NOT a valid Boolean algebra property (the correct law is a · a′ = 0).
In C runtime environment, which one of the following is stored in heap?
Answer: (C)
Look at how the C runtime memory model stores each item:
- A static variable declared inside a function goes in the data/BSS segment, not the heap. It lives for the whole program.
- An array declared inside a function that is not static and not dynamically allocated is a local (automatic) variable. It is kept on the stack.
- The return address of a function call is pushed onto the stack. It is part of the function's activation record (call frame).
- Only memory taken with (or similar dynamic allocation calls) comes from the heap. The programmer controls its lifetime until is called.
Answer: A dynamically allocated array of integers created using malloc()
- A static variable declared inside a function goes in the data/BSS segment, not the heap. It lives for the whole program.
- An array declared inside a function that is not static and not dynamically allocated is a local (automatic) variable. It is kept on the stack.
- The return address of a function call is pushed onto the stack. It is part of the function's activation record (call frame).
- Only memory taken with (or similar dynamic allocation calls) comes from the heap. The programmer controls its lifetime until is called.
Answer: A dynamically allocated array of integers created using malloc()
Consider the following two statements about interrupt handling mechanisms in a CPU.
: In non-vectored interrupt mechanism, it usually takes more time to start the Interrupt Service Routine (ISR) when compared to that in a vectored interrupt mechanism.
: In daisy-chain interrupt mechanism, the CPU polls all the input devices individually to determine the source of the interrupt.
Which one of the following options is correct with respect to and
: In non-vectored interrupt mechanism, it usually takes more time to start the Interrupt Service Routine (ISR) when compared to that in a vectored interrupt mechanism.
: In daisy-chain interrupt mechanism, the CPU polls all the input devices individually to determine the source of the interrupt.
Which one of the following options is correct with respect to and
Answer: (C)
S1: In a non-vectored interrupt scheme, the CPU usually has to poll each device. Or it runs a fixed interrupt-service routine that then finds out which device raised the interrupt. This is how it gets the interrupt source and the ISR address, and it costs extra time. In a vectored scheme, the interrupting device gives the address of its own ISR directly (or a lookup table gives it). So non-vectored handling usually takes more time to start the ISR. S1 is true.
S2: In a daisy-chain setup, the devices are joined in series in priority order. The interrupt-acknowledge signal (or the job of saying "who interrupted") passes along the chain from one device to the next. The CPU does not poll every device one by one. That description fits a different scheme, "software polling," and not daisy-chaining. So S2 is false.
Answer: S1 is true and S2 is false.
S2: In a daisy-chain setup, the devices are joined in series in priority order. The interrupt-acknowledge signal (or the job of saying "who interrupted") passes along the chain from one device to the next. The CPU does not poll every device one by one. That description fits a different scheme, "software polling," and not daisy-chaining. So S2 is false.
Answer: S1 is true and S2 is false.
Consider the following three ANSI-C programs, and .
Which one of the following statements is true?
Which one of the following statements is true?
Answer: (A)
P1: There is a global . Inside there is another, local . C allows this. The local one shadows the global one inside the scope of . It compiles without error.
P2: We have and right after it , both in the same block. This redeclares the identifier in one scope. That is a compile-time error.
P3: We have and then . Here too is declared again in the same scope, and this time the types differ. This is also a compile-time error.
Answer: Only P1 will compile without any error.
P2: We have and right after it , both in the same block. This redeclares the identifier in one scope. That is a compile-time error.
P3: We have and then . Here too is declared again in the same scope, and this time the types differ. This is also a compile-time error.
Answer: Only P1 will compile without any error.
Consider concurrent execution of two transactions and in a DBMS, both of which access a data object . For these two transactions to not conflict on , which one of the following statements must be true?
Answer: (A)
Two operations from different transactions on the same data object "conflict" (in the standard DBMS concurrency-control sense) exactly when at least one of them is a write. So the read-write, write-read and write-write pairs all conflict, because the order of execution can change the result.
The only case with no conflict is when both transactions only read . Reads do not interfere with each other in any order, since neither one changes the value of .
Answer: Both T1 and T2 only read A.
The only case with no conflict is when both transactions only read . Reads do not interfere with each other in any order, since neither one changes the value of .
Answer: Both T1 and T2 only read A.