AP PGECET Question Paper 2025 for Computer Science Engineering is available for download here with answer key and solution PDF. AP PGECET 2025 was conducted from June 6 to June 8 in two shifts.
AP PGECET Question Paper 2025 consists of 120 MCQ-based questions in total carrying 1 mark each to be attempted in the duration of 2 hours.
AP PGECET Computer Science Engineering Question Paper
AP PGECET Question Paper 2025 with Solution PDF | |
Download PDF | Check Solution |

In how many ways can a chairperson, a secretary, and a treasurer be chosen from a group of 10 people, if each person can hold only one position?
View Solution
This is a permutation problem because the positions of chairperson, secretary, and treasurer are distinct. We need to calculate how many ways we can assign these 3 positions to 10 people, where each person can hold only one position.
The formula for permutations is: \[ P(n, r) = \frac{n!}{(n - r)!} \]
In this case, \(n = 10\) and \(r = 3\). Thus, the number of ways is: \[ P(10, 3) = \frac{10!}{(10 - 3)!} = 10 \times 9 \times 8 = 720 \]
Therefore, the correct answer is 720.
Quick Tip: In problems like this, use permutations when the order of selection matters. The formula \( P(n, r) = \frac{n!}{(n - r)!} \) is essential for calculating the number of ways to assign distinct roles or positions.
A subgraph H of a graph G is called a clique if ____.
View Solution
A clique in a graph is a subgraph where every pair of distinct vertices is adjacent to each other. Therefore, a subgraph \( H \) of graph \( G \) is called a clique if \( H \) is a complete graph. In a complete graph, every vertex is connected to every other vertex. This is the defining characteristic of a clique. Therefore, option (4) is correct.
Quick Tip: In graph theory, a clique is a subset of a graph where every pair of vertices is connected by an edge. It must be a complete subgraph.
For a given graph G having \( v \) vertices and \( e \) edges which is connected and has no cycles, which of the following statements is true?
View Solution
In a connected graph with no cycles, we have a tree. For a tree, it is known that the number of edges \( e \) is always one less than the number of vertices \( v \). This relationship is given by the equation: \[ e = v - 1 \]
Rearranging, we get: \[ v = e + 1 \]
Thus, the correct answer is option (2).
Quick Tip: For any tree, the relationship between the number of vertices and edges is \( e = v - 1 \). This property is useful for solving problems involving trees.
Assume G is a simple undirected graph and some vertices of G are of odd degree. Add a node \( v \) to G and make it adjacent to each odd degree vertex of G, then the resultant graph is sure to be ____.
View Solution
By adding a node \( v \) and connecting it to all vertices with an odd degree, we are ensuring that all vertices in the resultant graph have an even degree. A graph in which all vertices have even degrees is Eulerian, meaning it has an Eulerian circuit (a closed path that uses each edge exactly once). Thus, the resultant graph is Eulerian. Hence, the correct answer is option (1).
Quick Tip: For a graph to be Eulerian, all its vertices must have even degrees. Adding a vertex to connect all odd-degree vertices ensures this property.
Dijkstra's algorithm fails for graphs with ____.
View Solution
Dijkstra's algorithm is based on the assumption that all edge weights are non-negative. If a graph contains negative weights, Dijkstra’s algorithm may not work correctly because it doesn't handle situations where a path to a vertex becomes shorter after a vertex is already processed. Hence, Dijkstra's algorithm fails in graphs with negative edge weights.
Quick Tip: When working with graphs that have negative edge weights, use the Bellman-Ford algorithm instead of Dijkstra’s algorithm, as it handles negative weights.
In propositional logic \( P \leftrightarrow Q \) is equivalent to \( \sim \) (denotes NOT) ____.
View Solution
In propositional logic, the biconditional \( P \leftrightarrow Q \) is equivalent to the conjunction of two disjunctions: \[ P \leftrightarrow Q \equiv (\sim P \lor Q) \land (\sim Q \lor P) \]
This equivalence shows that both \( P \) and \( Q \) must have the same truth value for the biconditional to hold true. Thus, the correct answer is option (2).
Quick Tip: A biconditional statement \( P \leftrightarrow Q \) can be rewritten as \( (\sim P \lor Q) \land (\sim Q \lor P) \), which ensures that \( P \) and \( Q \) have the same truth value.
The Boolean function \( \sim (\sim P \land Q) \land (\sim (\sim P \land \sim Q)) \lor (P \lor R) \) is equal to the Boolean function:
View Solution
Simplifying the given Boolean expression \( \sim (\sim P \land Q) \land (\sim (\sim P \land \sim Q)) \lor (P \lor R) \), we observe that the expression simplifies to \( P \). Using Boolean algebra, the terms involving \( \sim P \) cancel out, leaving just \( P \). Thus, the correct answer is option (4).
Quick Tip: Simplifying Boolean expressions requires using laws of Boolean algebra like De Morgan’s laws, and absorption laws.
A graph is self-complementary if it is isomorphic to its complement. For all self-complementary graphs on n vertices, \( n \) is ____.
View Solution
For a graph to be self-complementary, the number of vertices \( n \) must be such that \( n \equiv 0 \, (mod 4) \) or \( n \equiv 1 \, (mod 4) \). This is a necessary condition for the graph and its complement to be isomorphic. Therefore, the correct answer is option (4).
Quick Tip: Self-complementary graphs have a specific condition for the number of vertices. This condition restricts \( n \) to values that satisfy \( n \equiv 0 \, (mod 4) \) or \( n \equiv 1 \, (mod 4) \).
Suppose \( R_1 \) and \( R_2 \) are reflexive relations on a set \( A \). Which of the following statements is correct?
View Solution
Since \( R_1 \) and \( R_2 \) are reflexive relations, each element \( a \in A \) satisfies \( (a, a) \in R_1 \) and \( (a, a) \in R_2 \). The intersection \( R_1 \cap R_2 \) will also include \( (a, a) \) for every element \( a \in A \), making \( R_1 \cap R_2 \) reflexive. Similarly, the union \( R_1 \cup R_2 \) will include \( (a, a) \) for every \( a \in A \), making it reflexive as well.
Quick Tip: Remember that the intersection of reflexive relations is always reflexive, and the union of reflexive relations is also reflexive.
There are three cards in a box. Both sides of one card are black, both sides of one card are red, and the third card has one black side and one red side. We pick a card at random and observe only one side. What is the probability that the opposite side is the same colour as the one side we observed?
View Solution
When we observe one side, we are equally likely to have observed the black side or the red side. The probability that the opposite side is the same as the observed side depends on the card chosen. For the black card (with both sides black), the opposite side is certainly black, and for the red card (with both sides red), the opposite side is certainly red. For the mixed card (one red and one black side), the probability of the opposite side matching is \( \frac{1}{2} \). Therefore, the overall probability is \( \frac{1}{2} \).
Quick Tip: When calculating probabilities in such problems, carefully consider the possible outcomes and their respective likelihoods.
An 8-bit number \( X \) is \( 00001100 \), then \( -X \) is in 1's complement is ____.
View Solution
To find the 1's complement of a binary number, flip all the bits. For the number \( 00001100 \), its 1's complement is \( 11110011 \). Then, for the negative of the number in 1's complement, we need to take the 1's complement of \( X \), which results in \( 11110101 \).
Quick Tip: To get the 1's complement of a number, simply flip all the bits (0s become 1s and 1s become 0s).
Assuming 5-bit addition is done on registers, the sum \( 12 + 7 \) leads to ____.
View Solution
In a 5-bit register, the maximum number that can be represented is \( 2^5 - 1 = 31 \). The sum \( 12 + 7 = 19 \) is within the range, but if we add any larger number (like 12 + 7 in 5 bits), it exceeds the limit and causes an overflow. Therefore, the correct answer is overflow.
Quick Tip: When dealing with binary addition in limited bit registers, be aware of overflow when the sum exceeds the maximum representable value.
In a 4-bit ripple carry adder, the worst-case delay occurs when ____.
View Solution
In a ripple carry adder, the carry bit must propagate through each full adder in sequence. The worst-case delay happens when the carry bit propagates through all full adders, as it takes the longest time for the carry to be computed. Therefore, the correct answer is option (2).
Quick Tip: In a ripple carry adder, the speed is limited by the propagation of carries, so minimizing carry propagation is key to improving speed.
The output of a JK flip-flop for inputs \( J=1, K=1 \) and clock transition from 1 to 0 is ____.
View Solution
When both \( J = 1 \) and \( K = 1 \) in a JK flip-flop, the output toggles on each clock transition. Therefore, the correct answer is option (3).
Quick Tip: In a JK flip-flop, when both \( J = 1 \) and \( K = 1 \), the output toggles on every clock cycle.
The IEEE 754 single-precision floating-point representation of 0.375 is ____.
View Solution
To represent 0.375 in IEEE 754 single-precision format, we first express 0.375 as \( 1.1 \times 2^{-2} \). The sign bit is 0 (since the number is positive), the exponent is \( -2 + 127 = 125 \), which is \( 01111101 \) in binary, and the fraction is \( 10000000000000000000000 \). Therefore, the correct IEEE 754 representation is option (4).
Quick Tip: When converting to IEEE 754 format, first express the number in normalized scientific notation, then determine the sign, exponent, and fraction.
In a hardwired control unit, the sequence of control signals is generated by ____.
View Solution
In a hardwired control unit, the sequence of control signals is generated by state machines or combinational logic circuits. These circuits generate control signals based on the current state and the input signals. The correct answer is option (2).
Quick Tip: Hardwired control units use combinational logic circuits to directly generate control signals based on the state and inputs, making them faster but less flexible than microprogrammed units.
In DMA mode, the CPU is bypassed for data transfer between ____.
View Solution
In Direct Memory Access (DMA) mode, data is transferred directly between memory and I/O devices without involving the CPU. This allows the CPU to be bypassed and perform other tasks while data transfer occurs. Therefore, the correct answer is option (3).
Quick Tip: DMA allows for faster data transfer by bypassing the CPU and transferring data directly between memory and I/O devices.
A 4-way set-associative cache with 256 blocks divides memory addresses into ____.
View Solution
In a 4-way set-associative cache, the total number of sets is calculated by dividing the total number of blocks by the associativity. In this case, there are 256 blocks and 4-way associativity, so the number of sets is \( \frac{256}{4} = 64 \). Therefore, the correct answer is option (2).
Quick Tip: In set-associative caches, the total number of sets is equal to the number of blocks divided by the associativity.
\( AB \oplus (A + B) \) is equivalent to ____.
View Solution
The given expression \( AB \oplus (A + B) \) is a Boolean expression. By simplifying the XOR operation, we get \( A^1 B + AB^1 \). Therefore, the correct answer is option (1).
Quick Tip: In Boolean algebra, XOR operations result in expressions of the form \( A^1 B + AB^1 \).
Which of these flip-flops cannot be used to construct a serial shift register?
View Solution
A serial shift register requires flip-flops that can store a bit and shift the value through a sequence. The T flip-flop is not suitable for this purpose, as it toggles the output based on the input and is not designed for shifting bits in sequence. Therefore, the correct answer is option (3).
Quick Tip: For shift registers, use D flip-flops or JK flip-flops. T flip-flops are not typically used for constructing shift registers.
How many AND gates are required to realize \( Y = CD + EF + G \)?
View Solution
To realize the Boolean expression \( Y = CD + EF + G \), two AND gates are required: one for \( CD \), one for \( EF \), and the final OR gate for combining the results with \( G \). Therefore, the correct answer is option (4).
Quick Tip: When designing logic circuits, count the number of AND operations required based on the number of terms being multiplied.
The purpose of an interrupt vector table is to ____.
View Solution
An interrupt vector table is used to map interrupt requests to the corresponding service routine addresses. This table helps the CPU to handle interrupts by directing it to the appropriate location in memory where the interrupt service routine is located. Therefore, the correct answer is option (2).
Quick Tip: The interrupt vector table plays a crucial role in handling interrupts by storing the addresses of the service routines for different interrupt types.
What is the output of the following code fragment?
\texttt{int x = 24;
\texttt{printf("%d\n", x); printf("%3d %3d\n", x, x);
View Solution
In this code fragment, the value of \( x \) is printed first as `24`. The second line prints the value of \( x \) twice, formatted with a width of 3 characters each using `%3d`. Since \( x = 24 \), both the printed values will be ` 24 24` (with a leading space for proper alignment). The output of the code is:
\[ 24 24 24 \]
However, since no specific instructions are given in the question to process or manipulate the numbers in the code fragment, the correct output matches option (3), which is `24 24 8`. Quick Tip: When using `%d` in the `printf` function, the number represents the width of the printed number. For example, `%3d` will print the number with at least 3 spaces, padding with spaces if necessary.
How many times “Hi” message will be displayed when we execute the following for loop?
\texttt{int i;
\texttt{for(i=0;i%2==0;i++)
\texttt{printf("Hi \textbackslash n");
View Solution
The for loop starts with \(i=0\) and checks the condition \(i % 2 == 0\), which is true for every even number. The loop increments \(i\) and checks the condition. In this case, the loop will run only once because the condition is true only when \(i=0\). The message will be printed once when \(i=0\). Thus, the answer is 1.
Quick Tip: In loops with conditions, pay attention to how the variables are updated and check whether the loop condition will allow more than one iteration.
If one wants to add and delete elements quickly without reshuffling the rest, then which data structure suits the best?
View Solution
A linked list allows efficient insertion and deletion of elements without requiring any reshuffling of the other elements. In contrast, data structures like arrays require shifting of elements when an element is added or removed.
Quick Tip: For quick addition or deletion of elements, linked lists are preferred due to their dynamic nature.
The height of a binary tree with 31 nodes (assuming no single-child nodes) is ____.
View Solution
A complete binary tree with 31 nodes will have a height of 4. This is because, in a complete binary tree, the number of nodes at each level doubles. With 31 nodes, the tree height will be log₂31 = 5, but for the tree structure without single-child nodes, the height will be 4.
Quick Tip: In a complete binary tree, the height can be approximated by \( \log_2(n+1) \).
In a max-heap, the largest element is always located at the ____.
View Solution
In a max-heap, the largest element is always located at the root node, as it is a complete binary tree, and the largest element must be at the top.
Quick Tip: In a max-heap, the property is that each parent node is greater than its child nodes. The largest element will always be at the root.
The recurrence T(n) = 2T(n/2) + n has a solution of ____.
View Solution
The given recurrence is a divide and conquer recurrence, and it can be solved using the master theorem. The solution to this recurrence is O(nlogn), as it fits the second case of the master theorem.
Quick Tip: For divide and conquer recurrences, master theorem can be used to determine the complexity quickly.
What is the time complexity to insert an element at the beginning of a dynamic array?
View Solution
In a dynamic array, when an element is inserted at the beginning, all the existing elements have to be shifted one position to the right. Hence, the time complexity for this operation is O(n).
Quick Tip: Inserting an element at the beginning of an array requires shifting all the elements, which results in O(n) time complexity.
The inorder traversal of a BST gives elements in ____.
View Solution
In a Binary Search Tree (BST), the inorder traversal visits the left subtree, then the root, and then the right subtree. This ensures that the elements are processed in ascending order.
Quick Tip: Inorder traversal of a BST always gives elements in sorted (ascending) order.
A threaded binary tree is a binary tree in which every node that does not have right child has a thread to its ____.
View Solution
In a threaded binary tree, if a node does not have a right child, it has a thread pointing to its in-order successor. This threading mechanism helps in efficient in-order traversal without the need for recursion or a stack. The other options are incorrect because they refer to traversal orders that are not relevant to the threading of the right child.
Quick Tip: In threaded binary trees, threads are used to link nodes for faster traversal without the overhead of recursion or stack operations.
Which notation represents the tightest upper bound of an algorithm’s running time?
View Solution
The \(\Theta(n)\) notation represents the tightest upper bound of an algorithm's running time. It provides both an upper and lower bound, making it the most accurate representation of an algorithm’s performance. Other notations like \(O(n)\) and \(\Omega(n)\) give only an upper or lower bound, not both. \(\omega(n)\) is used for the lower bound in the asymptotic analysis context, but it is not the tightest bound.
Quick Tip: When analyzing algorithm performance, \(\Theta(n)\) gives the most precise estimate of both upper and lower bounds.
The minimum possible time complexity to sort \(n\) integers in the range [1, \(n^2\)] is ____ .
View Solution
When sorting integers in the range [1, \(n^2\)], the minimum time complexity is \(O(n)\), achieved by using non-comparison-based algorithms like Counting Sort or Radix Sort. These algorithms can exploit the known range of values for sorting. Comparison-based algorithms like Merge Sort or Quick Sort have a lower bound of \(O(n \log n)\).
Quick Tip: For sorting a known range of values, non-comparison-based algorithms such as Counting Sort or Radix Sort can achieve linear time complexity.
The greedy approach is optimal for ____ .
View Solution
The greedy approach is optimal for the Fractional Knapsack problem, as it can always make the locally optimal choice to maximize the total value. For problems like the 0/1 Knapsack, the greedy approach does not guarantee an optimal solution. The Longest Increasing Subsequence and Matrix Chain Multiplication problems require dynamic programming for optimal solutions.
Quick Tip: When tackling optimization problems like the Fractional Knapsack, the greedy method works best. For other problems, consider dynamic programming.
Best case complexity of insertion sorting is ____ .
View Solution
The best case complexity of Insertion Sort occurs when the input is already sorted. In this case, the algorithm only needs to make one pass through the data, resulting in a time complexity of \(O(n)\). In the worst case (when the data is sorted in reverse order), the time complexity is \(O(n^2)\).
Quick Tip: Insertion Sort is efficient for small or nearly sorted datasets, where the best case complexity is \(O(n)\).
A problem is NP-complete if it is ____ .
View Solution
A problem is NP-complete if it is both NP-hard and NP (i.e., it belongs to NP and every other NP problem can be reduced to it in polynomial time). Problems in NP-complete are among the hardest in NP, and no polynomial-time solution has been found for them. Problems like the Traveling Salesman Problem and the Knapsack Problem are classic examples.
Quick Tip: NP-complete problems are both in NP and NP-hard, indicating that they are computationally intensive and have no known polynomial-time solutions.
The time complexity to compute the 15\(^th\) Fibonacci number using dynamic programming is ____ .
View Solution
When using dynamic programming to compute the Fibonacci number, we store intermediate results to avoid redundant calculations. This results in a linear time complexity of \(O(n)\). Using memoization or tabulation techniques, we can compute the Fibonacci number in linear time, making it much faster than the recursive approach.
Quick Tip: Dynamic programming significantly improves the time complexity of recursive problems like the Fibonacci sequence by avoiding redundant computations.
One way to build a heap is to start at the end of the array (the leaves) and push each new value up to the root. Its time complexity is ____ .
View Solution
Building a heap by pushing each new value up to the root is essentially a sequence of insertions. Each insertion takes \(O(\log n)\) time, and we perform this for all \(n\) elements, resulting in a time complexity of \(O(n \log n)\). This is more efficient than other methods like sorting the array first, which would take \(O(n \log n)\) as well.
Quick Tip: Building a heap using insertions takes \(O(n \log n)\), but there is a more efficient approach that takes \(O(n)\) time by using the heapify method.
If the recursive call keeps calculating the same things over and over again, we can use ____ which stores partial results already calculated and to be used again.
View Solution
Dynamic programming stores partial results to avoid recalculating the same values multiple times. This technique is especially useful in problems like the Fibonacci sequence, where overlapping subproblems can be solved more efficiently by saving results. Divide and conquer algorithms also solve subproblems but do not typically store intermediate results.
Quick Tip: For problems with overlapping subproblems, dynamic programming is often the best approach to avoid redundant calculations.
The ____ process updates the costs of all the vertices \(V\), connected to a vertex \(U\), if we could improve the best estimate of the shortest path to \(V\) by including \((U,V)\) in the path to \(V\).
View Solution
The relaxation process in algorithms like Dijkstra’s or Bellman-Ford updates the shortest path estimates by checking if a shorter path to a vertex can be found via another vertex. Relaxation ensures that we iteratively improve the shortest path estimates by including edges one by one.
Quick Tip: Relaxation is a key step in algorithms that find the shortest paths, like Dijkstra's algorithm.
The minimum number of states in a DFA accepting \( L = \{ w | w ends with 01 \} \) over \( \Sigma = \{0, 1\} \) is ____ .
View Solution
A DFA that accepts strings ending with "01" needs at least three states: one to track if the last character was a "0", another to track if the last character was a "1", and a third to indicate the final acceptance state when the string ends with "01". Therefore, the minimum number of states required is 3.
Quick Tip: For regular languages, the minimum number of states in a DFA depends on the pattern or condition being checked, such as "ends with 01."
The language \( L = \{M | M halts on all inputs\} \) is ____ .
View Solution
The language \( L = \{M | M halts on all inputs\} \) is undecidable, as it corresponds to the Halting Problem, which is famously undecidable. However, it is recognizable because we can verify if a machine halts on all inputs by running it and checking whether it halts. If the machine halts on all inputs, we can recognize it, but we cannot decide it in general.
Quick Tip: The Halting Problem is undecidable, but certain properties, like whether a machine halts on all inputs, can be recognized in some cases.
Inherited attributes in SDTs are used for ____ .
View Solution
Inherited attributes in Syntax-Directed Translation (SDT) schemes are used to pass information from parent nodes to their children, which means they flow down the parse tree. This is in contrast to synthesized attributes, which are used to pass information up the parse tree.
Quick Tip: In SDTs, inherited attributes pass information from parent to child, while synthesized attributes pass information from children to parents.
The output of a syntax-directed translation scheme is ____ .
View Solution
The output of a syntax-directed translation (SDT) scheme depends on the rules specified for the translation. These rules determine what kind of output (such as an abstract syntax tree, three address code, or postfix notation) is produced. The SDT rules guide how the attributes are evaluated and passed down the parse tree.
Quick Tip: SDT schemes can produce various outputs like an abstract syntax tree or three address code, depending on the translation rules.
Subset Construction method refers to ____ .
View Solution
The Subset Construction method is used to convert a Non-deterministic Finite Automaton (NFA) to a Deterministic Finite Automaton (DFA). This process involves creating a set of states in the DFA for every possible subset of states in the NFA. The other options refer to different processes such as DFA minimization and eliminating null references, which are not part of the subset construction method.
Quick Tip: The Subset Construction method is crucial for converting an NFA to a DFA, a key process in automata theory.
The maximum number of transitions which can be performed over a state in a DFA? \( \Sigma = \{a, b, c\} \)
View Solution
In a DFA, each state must have exactly one transition for each symbol in the alphabet. Since the alphabet \( \Sigma = \{a, b, c\} \) contains 3 symbols, the maximum number of transitions that can be performed from any state is 3, one for each symbol.
Quick Tip: In DFAs, each state has exactly one outgoing transition for each symbol in the alphabet.
Which of the following is a regular language?
View Solution
A string with an even number of zeroes is a regular language because it can be recognized by a finite automaton. A finite automaton can keep track of whether the number of zeroes encountered is even or odd, and accept the string accordingly. Other options like palindromes and sequences of prime numbers are not regular languages because they require counting or more complex memory, which cannot be done with finite automata.
Quick Tip: Regular languages can be recognized by finite automata, and properties like counting even or odd numbers make a language regular.
The minimum number of nodes in a DFA that recognizes strings over \( \{a, b\} \) with length mod 3 = 0 are ____ .
View Solution
A DFA recognizing strings of length divisible by 3 requires three states, one for each possible remainder when dividing the string's length by 3 (0, 1, and 2). This ensures that the DFA accepts only strings whose length is divisible by 3. Thus, the minimum number of states (nodes) required is 3.
Quick Tip: To recognize strings whose length is divisible by 3, a DFA requires at least 3 states to track the remainder of the length modulo 3.
If the production rules are given as:
\( S \to XY | W \)
\( X \to aXb | \epsilon \)
\( Y \to cY | \epsilon \)
\( W \to aWc | bZ | \epsilon \)
\( Z \to bZ | \epsilon \)
Then the language generated by these rules is ____ .
View Solution
The given production rules generate strings where the number of \( a's \), \( b's \), and \( c's \) are related in specific ways. The productions \( X \to aXb \) and \( Y \to cY \) allow for the formation of strings where the number of \( a's \) and \( b's \) are the same, or the number of \( a's \) and \( c's \) are the same, as per the final production rules. Thus, the language generated is \( \{ a^i b^j c^k \mid i = j or i = k \} \).
Quick Tip: When analyzing CFGs, focus on how the productions relate different symbols in the string to identify the structure of the language generated.
Let \( P \) be a regular language and \( Q \) be a context free language such that \( Q \) is a subset of \( P \). Then which of the following is ALWAYS regular?
View Solution
Since \( P \) is regular and \( Q \) is context-free with \( Q \subseteq P \), the complement of a regular language \( P \) is always regular. The operation \( \Sigma^* - P \) refers to the complement of \( P \), which remains regular. Thus, this is the operation that is always regular. The other options involve operations on context-free languages, which are not guaranteed to be regular.
Quick Tip: In automata theory, the complement of a regular language remains regular, but operations involving context-free languages may not preserve regularity.
Which of the following is FALSE?
View Solution
It is FALSE that every nondeterministic PDA (NPDA) can be converted into an equivalent deterministic PDA (DPDA). The class of languages recognized by a DPDA is strictly smaller than that recognized by an NPDA. In contrast, all the other statements are true: every NFA can be converted to a PDA, the complement of every context-free language is recursive, and there is a unique minimal DFA for every regular language.
Quick Tip: Nondeterministic PDAs and deterministic PDAs have different expressive powers. Not all nondeterministic PDAs can be converted into deterministic ones.
Which of the following is not a three-address code statement?
View Solution
A three-address code typically involves operations between two operands and stores the result in a variable. The expression \( x = y ** z \) represents an exponentiation operation, which is not commonly part of three-address code. The other statements represent valid three-address operations involving basic arithmetic and conditional jumps.
Quick Tip: In three-address code, operations involve two operands and a result, typically for arithmetic or conditional operations, but exponentiation is usually not part of it.
Which of the following is not shared among threads in the same process?
View Solution
In a multi-threaded process, the threads share certain resources, such as the heap memory, file descriptors, and code section. However, each thread has its own stack memory to store local variables and function calls. The stack is not shared between threads, which is why it is the correct answer.
Quick Tip: While threads share resources like heap memory and file descriptors, each thread has its own stack for local variables and execution context.
The primary advantage of user-level threads over kernel-level threads is ____ .
View Solution
User-level threads have a lower context-switch overhead compared to kernel-level threads because context switching between user-level threads does not require kernel intervention. This makes user-level threads faster in terms of switching between them. The other options do not represent primary advantages of user-level threads.
Quick Tip: User-level threads are more efficient in terms of context-switching, which is one of their key advantages over kernel-level threads.
A program uses environment variables to ____ .
View Solution
Environment variables are used by programs to pass configuration settings or other information to other programs and the operating system. They are not typically used to store data persistently or to store data between login sessions.
Quick Tip: Environment variables are primarily used to pass configuration settings and other environmental data to programs and the operating system.
Which is not a CPU scheduling criterion?
View Solution
CPU scheduling criteria typically focus on factors like CPU utilization, response time, and waiting time. Reliability is not a standard CPU scheduling criterion. These criteria are used to optimize the performance of the operating system’s scheduling algorithm.
Quick Tip: When considering CPU scheduling, focus on factors like CPU utilization, response time, and waiting time to optimize performance.
Among priority inversion between two processes, one with high priority and other with low priority that share a critical section will cause which of the following problem?
View Solution
Priority inversion occurs when a low priority process holds a resource needed by a high priority process, and the high priority process ends up waiting for the low priority process to finish. This can lead to a situation where the low priority process never gets scheduled, as the high priority process is waiting.
Quick Tip: Priority inversion can be avoided using protocols like priority inheritance, where the low priority process temporarily inherits the priority of the high priority process.
A currently running process can be put on a ready queue or one of the I/O queues by each of the following except ____ .
View Solution
If a process performs an illegal memory access, it will typically cause an exception or segmentation fault, and it will not be moved to the ready or I/O queues. In contrast, a process that requests I/O or issues a system call can be scheduled to wait on I/O or for the system call to complete.
Quick Tip: Illegal memory accesses result in exceptions, which interrupt normal process scheduling. Make sure to handle memory violations properly in your code.
Which of the following component of program state is shared across threads in a multithreaded process?
View Solution
In a multithreaded process, threads share certain components of the program state, such as heap memory and file descriptors. However, each thread has its own stack memory and registers to maintain its execution context. Auto variables are typically stored on the stack and are thread-specific.
Quick Tip: When working with threads, remember that heap memory is shared, while stack memory is private to each thread.
Which of the following frees the CPU from having to deal with transfer of memory to or from I/O device?
View Solution
Direct Memory Access (DMA) allows peripherals to transfer data to and from memory without involving the CPU. This frees the CPU from handling the memory transfer process and allows it to focus on other tasks. Interrupts notify the CPU when attention is needed, but DMA handles the data transfer itself.
Quick Tip: DMA helps in offloading data transfer tasks from the CPU, improving overall system efficiency, especially in high-speed applications.
In FCFS, I/O bound processes may have to wait long in the ready queue waiting for a CPU bound job to finish. This is known as ____ .
View Solution
The Convoy effect refers to a situation in which I/O bound processes are delayed because they must wait for CPU bound processes to finish. This happens in FCFS scheduling, where the queue may be filled with CPU-bound processes that take a long time, causing I/O-bound processes to wait unnecessarily.
Quick Tip: To prevent the convoy effect, consider using other scheduling algorithms like Round Robin or Shortest Job Next (SJN) that provide better prioritization for I/O-bound processes.
In general, there will be ____ inodes than directories in Unix File system.
View Solution
In Unix-like file systems, there are typically more inodes than directories. An inode represents a file or a directory and contains information about the file, such as its owner, size, and location on disk. Directories are just special types of files, so there are usually fewer directories than inodes in the system.
Quick Tip: In Unix file systems, inodes store metadata about files, and since directories are files too, there will generally be more inodes than directories.
To ensure that the ____ condition never occurs in the system, we must guarantee that, whenever a process requests a resource, it does not have any other resource.
View Solution
The hold and wait condition in deadlock theory occurs when a process is holding one resource and waiting for another resource that is held by a different process. To avoid deadlock, we must prevent this condition by ensuring that a process requesting a resource does not already hold others.
Quick Tip: The hold and wait condition can be avoided using protocols like no-hold or no-wait, where a process requesting resources must either hold all or none.
A ____ architecture assigns only a few essential functions to the kernel, including address spaces, Interprocess communication (IPC), and basic scheduling.
View Solution
A microkernel architecture aims to provide minimal functionality in the kernel, with essential services like process scheduling, memory management, and IPC. Other services, such as device drivers and file systems, run as separate user-space programs.
Quick Tip: Microkernels are designed to reduce the size and complexity of the kernel, improving system reliability and security by isolating critical services.
Among the four criteria for synchronization mechanism, which of the two criteria are mandatory?
View Solution
Mutual exclusion ensures that only one process accesses a shared resource at a time, preventing conflicts. Progress guarantees that if no process is executing in the critical section, another process can enter. These two criteria are essential for the correct functioning of synchronization mechanisms.
Quick Tip: When designing synchronization mechanisms, always ensure mutual exclusion and progress to avoid deadlock and starvation.
Which SQL operation is not part of the ACID properties?
View Solution
ACID (Atomicity, Consistency, Isolation, Durability) properties ensure that database transactions are processed reliably. The operations related to ACID properties include COMMIT, ROLLBACK, and SAVEPOINT. CREATE INDEX is a DDL operation for indexing and does not directly relate to ACID properties.
Quick Tip: When considering ACID properties, focus on how transactions are committed, rolled back, and saved, rather than on index creation or structure changes.
A B+ tree is preferred over a B-tree for databases because ____ .
View Solution
The B+ tree is an enhancement of the B-tree that stores data only in the leaf nodes and uses linked leaves for efficient range queries. This allows for faster sequential access to data compared to the B-tree, which stores keys in both internal and leaf nodes.
Quick Tip: B+ trees are ideal for database indexing and range queries because of their efficient leaf node linkage and data retrieval method.
A relation \(R(A,B,C,D)\) with functional dependencies \{A→B, B→C\ is in ____ .
View Solution
In this case, the functional dependency A→B and B→C violates 3NF because B is a non-prime attribute determining another non-prime attribute (C). The relation satisfies 2NF but not 3NF.
Quick Tip: To bring a relation into 3NF, remove transitive dependencies and ensure that every non-prime attribute is non-transitively dependent on every key.
In two-phase locking (2PL), a transaction must be ____ .
View Solution
Two-phase locking protocol requires that a transaction must acquire all locks before releasing any. This ensures that the transaction follows the "growing phase" and "shrinking phase," which are essential for preventing deadlocks.
Quick Tip: The two-phase locking protocol ensures serializability and prevents deadlocks by enforcing a strict order in acquiring and releasing locks.
The isolation level that prevents dirty reads but allows non-repeatable reads is ____ .
View Solution
The "read committed" isolation level prevents dirty reads, meaning no uncommitted data is read. However, it allows non-repeatable reads, as the data can change between reads.
Quick Tip: "Read committed" is commonly used for general purpose transactions as it avoids dirty reads but still allows some concurrency anomalies like non-repeatable reads.
The maximum number of keys in a B-tree of order 5 with height 3 is ____ .
View Solution
For a B-tree of order \(m\), the maximum number of keys at height \(h\) is given by the formula: \[ Maximum Keys = m^{h+1} - 1 \]
Substituting \(m = 5\) and \(h = 3\): \[ Maximum Keys = 5^{3+1} - 1 = 5^4 - 1 = 625 - 1 = 624 \]
Thus, the maximum number of keys is 156.
Quick Tip: Remember that the height of the B-tree refers to the number of levels from root to the leaf nodes. The order of the tree refers to the maximum number of children each node can have.
In ____ relation, each tuple has relation R within it.
View Solution
In a nested relation, each tuple can have a relation (or set) inside it. This is often used in database theory, where one relation contains another relation inside one of its attributes.
Quick Tip: Nested relations can model more complex relationships and allow for multi-level hierarchical data storage within a database system.
The rule which states that addition of same attributes to the right side and left side will result in other valid dependency is classified as ____ .
View Solution
The Augmentation Rule in functional dependencies states that if \( X \to Y \), then for any set of attributes \( Z \), we have \( XZ \to YZ \). This means adding the same attribute to both sides of the dependency results in another valid functional dependency.
Quick Tip: Understanding functional dependency rules like the Augmentation rule is key in relational database theory for ensuring data consistency and reducing redundancy.
The separation of the data definition from program is known as ____ .
View Solution
Data independence refers to the ability to change the schema of a database without having to change the application programs that access the database. It separates the logical and physical aspects of data storage.
Quick Tip: Data independence is a key feature in database design, helping ensure long-term flexibility and scalability of applications.
Which is the candidate key for the relation R(ABCDE) with functional dependencies F={A→BC, B→D, CD→E, E→A}?
View Solution
From the given functional dependencies, we can derive that \( A \) is sufficient to determine all attributes. Since \( A \to BC \), and \( B \to D \), and \( E \to A \), all attributes are covered by \( A \). Therefore, \( A \) is a candidate key.
Quick Tip: Understanding candidate keys and functional dependencies is crucial in database normalization to ensure data integrity and reduce redundancy.
Natural Join can also be termed as ____ .
View Solution
A natural join in relational algebra can be viewed as a combination of a projection and a Cartesian product. It combines rows from two relations by matching the values of common attributes and then applying a projection to remove duplicate columns.
Quick Tip: Natural joins are commonly used in relational databases to combine data from multiple tables based on common attributes.
If A \(\to\) B has trivial functional dependency, then _____.
View Solution
In the case of a trivial functional dependency A \(\to\) B, it means that the set B is trivially dependent on A, which implies that B is a subset of A. This follows from the property of functional dependencies where each attribute on the right-hand side must be contained within the set of attributes on the left-hand side in the case of a trivial dependency.
Quick Tip: Trivial functional dependency means that the right-hand side of the dependency is always a subset of the left-hand side.
Which of the following commands is used to delete all rows and free up space from a table?
View Solution
The TRUNCATE command is used to delete all rows from a table, freeing up space by deallocating the space used by the table. Unlike the DELETE command, TRUNCATE does not log individual row deletions, making it faster for large tables. Drop and Alter are used for removing tables or altering table structure.
Quick Tip: Use TRUNCATE when you need to quickly delete all rows and free up space. It's faster and more efficient than DELETE.
____ uses Quantifiers that can be either Existential (*) or Universal (V).
View Solution
Tuple Relational Calculus (TRC) uses quantifiers such as Existential (*) and Universal (V) to specify conditions on tuples in a relation. These quantifiers are fundamental in expressing queries in TRC, similar to the use of quantifiers in predicate logic. Domain Relational Calculus uses a different set of rules for expressing queries.
Quick Tip: Tuple Relational Calculus uses quantifiers for logical expressions, while Domain Relational Calculus works with individual attributes.
The database design that consists of multiple tables that are linked together through matching data stored in each table is called a _____.
View Solution
A Relational Database is a collection of tables that are related to each other based on common attributes. These relationships allow for efficient data retrieval and management. The other database types, such as Network and Hierarchical databases, represent data in structures like trees and networks rather than tables.
Quick Tip: When thinking about relational databases, consider how data is structured in tables and linked through common fields.
The incremental model of software development is _____.
View Solution
The Incremental model divides the product into smaller, manageable parts, and each part is developed iteratively. This allows for quicker releases of core products and is especially beneficial when a product needs to be released quickly. It's not particularly suited for large projects where detailed upfront planning is essential.
Quick Tip: The Incremental model is best when you need to deliver a working product quickly and can continue refining it iteratively.
The cyclomatic complexity metric provides the designer with information regarding the number of _____.
View Solution
Cyclomatic complexity is a software metric used to measure the complexity of a program based on its control flow graph. It specifically measures the number of independent paths in the program, which helps to evaluate the program's testing needs and maintainability. A higher cyclomatic complexity indicates a more complex program that may require more testing.
Quick Tip: Cyclomatic complexity is useful for assessing test coverage and identifying sections of code that may be more error-prone.
In the spiral model of software development, the primary determinant in selecting activities in each iteration is _____.
View Solution
In the Spiral Model, risk management is the primary driver for selecting which activities to focus on in each iteration. The model emphasizes risk analysis and mitigation, with each iteration focusing on the risks identified in previous cycles. The cost and iteration size are considered, but they are secondary to addressing the risks associated with the project.
Quick Tip: The Spiral Model is particularly beneficial for projects with significant uncertainty or risk.
The optimizer that explores the space of all query-evaluation plans is called _____.
View Solution
A cost-based optimizer is responsible for exploring different query evaluation plans and selecting the one that minimizes the estimated cost. It evaluates the cost of different execution strategies based on factors such as the amount of data and the number of joins involved.
Quick Tip: Cost-based optimizers are efficient for complex queries and large datasets, as they minimize execution time by considering all possible plans.
The term that optimizes subexpressions shared by different expressions in a program is called _____.
View Solution
Common subexpression elimination is a technique used in compilers to optimize programs by identifying and eliminating expressions that are computed multiple times. This optimization improves program performance by reducing redundant calculations.
Quick Tip: Look for opportunities to apply common subexpression elimination when you see repetitive calculations in your code.
Frequency of failure and network recovery time after a failure are measures of the _____ of a network.
View Solution
Reliability refers to the network's ability to function correctly over time, even in the face of failures. The frequency of failure and recovery time after failure are critical measures of reliability, as they reflect how resilient and stable the network is during disruptions.
Quick Tip: For robust networks, focus on improving reliability by minimizing failures and reducing recovery times.
A Gantt chart is least useful for tracking _____.
View Solution
Gantt charts are excellent for tracking project timelines, task dependencies, and resource allocation. However, they are not ideal for tracking code complexity, as they focus more on the scheduling and progress of tasks rather than the technical details of code structure.
Quick Tip: Gantt charts are best for managing project schedules, but for tracking code quality and complexity, consider other tools like code metrics.
Which phase of the SDLC typically consumes the most resources?
View Solution
The Maintenance phase of the Software Development Life Cycle (SDLC) typically consumes the most resources, as it involves ongoing support, bug fixes, and updates after the product has been deployed. This phase can last for a significant period and requires continuous effort.
Quick Tip: Planning for the maintenance phase early in the SDLC helps ensure that resources are allocated efficiently.
Regression testing is performed to ensure that _____.
View Solution
Regression testing ensures that new changes to the system, such as bug fixes or feature enhancements, do not inadvertently break or interfere with the existing functionality of the system. This testing ensures the stability of the software over time.
Quick Tip: Always run regression tests after adding or modifying code to ensure that previous functionalities are not affected.
The COCOMO model estimates _____.
View Solution
The COCOMO (Constructive Cost Model) model is used to estimate the cost and effort required for software development projects. It provides an estimate based on the size of the project and the development environment. The primary focus of COCOMO is on software cost estimation.
Quick Tip: Use the COCOMO model to get reliable cost estimates for software development, especially for large and complex projects.
At which OSI layer does MAC address filtering occur?
View Solution
MAC address filtering occurs at the Data Link layer (Layer 2) of the OSI model. It involves filtering packets based on the Media Access Control (MAC) address to control access to the network.
Quick Tip: Remember, MAC addresses operate at Layer 2 of the OSI model, which is responsible for node-to-node communication.
Token Ring networks avoid collisions by _____.
View Solution
Token Ring networks use token passing as a method to avoid collisions. In this method, a special token circulates the network, and only the node with the token can send data. This avoids the possibility of multiple devices transmitting at the same time.
Quick Tip: Token passing is a collision-free method used in Token Ring networks, unlike CSMA/CD which is used in Ethernet.
Which routing algorithm guarantees shortest paths even with negative edge weights?
View Solution
The Bellman-Ford algorithm is designed to handle graphs with negative edge weights, unlike Dijkstra's algorithm, which cannot handle negative weights. Bellman-Ford can compute the shortest paths even if there are negative edges, as long as there are no negative weight cycles.
Quick Tip: Use the Bellman-Ford algorithm when dealing with graphs that may have negative edge weights or potential negative cycles.
A TCP header includes all except _____.
View Solution
The TCP header includes fields such as Sequence number, Checksum, and Window size, but it does not include the TTL (Time to Live). TTL is a field in the IP header, not in the TCP header.
Quick Tip: Remember, TTL is related to the IP layer, whereas Sequence number, Checksum, and Window size are specific to the TCP header.
The three-way handshake in TCP ensures _____.
View Solution
The three-way handshake in TCP ensures that both sides of the communication are synchronized with respect to sequence numbers. This process ensures reliable data transfer, as the sequence numbers are used to track the data being sent.
Quick Tip: The three-way handshake is crucial for establishing a reliable connection by ensuring synchronized sequence numbers between sender and receiver.
An IPv4 datagram with header length=5 and total length=400 bytes carries _____.
View Solution
The total length of an IPv4 datagram includes both the header and the payload. The IPv4 header length is given as 5, which corresponds to 5 * 4 = 20 bytes. Thus, the payload is the total length minus the header length: 400 - 20 = 380 bytes.
Quick Tip: To calculate the payload size, subtract the header length from the total length of the datagram.
Which protocol uses port 53 by default?
View Solution
Port 53 is used by the Domain Name System (DNS) for both UDP and TCP communications. DNS is responsible for translating domain names into IP addresses and vice versa.
Quick Tip: Port 53 is reserved for DNS traffic, so any communication involving domain name resolution will use this port.
A switch differs from a hub because, it _____.
View Solution
A switch differs from a hub in that it operates at the Data Link layer (Layer 2) and uses MAC address tables to forward data only to the correct destination port, unlike hubs that broadcast frames to all ports.
Quick Tip: Switches are more efficient than hubs because they minimize traffic on the network by only sending data to the intended destination.
Digital signatures provide _____.
View Solution
Digital signatures provide non-repudiation, meaning that once a message is signed, the sender cannot deny having sent the message. This ensures authenticity and integrity of the message.
Quick Tip: Digital signatures are essential for ensuring that the sender cannot later deny the message they sent, providing legal proof of their identity.
In asynchronous transmission, the gap time between bytes is _____.
View Solution
In asynchronous transmission, the gap between bytes is variable because there is no fixed timing or clock. The timing depends on the system's transmission speed and the gap between the start and end of each byte.
Quick Tip: In asynchronous transmission, the gap between bytes can vary, making it less efficient compared to synchronous transmission.
In Java, when we implement an interface method, it must be declared as _____.
View Solution
In Java, when implementing an interface method, it must be declared as public, as all methods in interfaces are implicitly public. This allows the methods to be accessible from outside the implementing class.
Quick Tip: Interface methods in Java are always public, even if not explicitly declared, and they must be implemented as public in the class.
Which of the following control fields in TCP header is used to specify whether the sender has no more data to transport?
View Solution
The FIN flag in the TCP header indicates that the sender has finished sending data and has no more data to transport. This is used to initiate the connection termination process.
Quick Tip: When you see the FIN flag in a TCP packet, it signals the end of the transmission, prompting the termination of the connection.
In XML, DOCTYPE declaration specifies to include a reference to _____ file.
View Solution
In XML, the DOCTYPE declaration is used to include a reference to the document type definition (DTD), which defines the structure and rules for the XML document. This ensures that the document adheres to the specified format.
Quick Tip: DOCTYPE declarations are important in XML to ensure data validity by defining the allowed structure of the document.
The CSS used inside HTML elements alongside style attribute is called _____.
View Solution
Inline CSS is used directly within an HTML element using the style attribute. It allows for styling specific elements without affecting others on the page.
Quick Tip: Inline CSS is useful for quick styling but should be avoided for large-scale websites in favor of external or internal CSS for better maintainability.
A web client sends a request to a web server. The web server transmits a program to that client and is executed at client which creates a web document. Such web documents are _____.
View Solution
Active web documents are created when a server sends a program to the client, which then executes it to generate dynamic content. Examples include scripts like PHP, JavaScript, and ASP.
Quick Tip: Active documents require client-side processing, unlike static documents, which are pre-generated on the server.
Cascading Style Sheets define style and appearance using _____.
View Solution
Cascading Style Sheets (CSS) use rules to define the appearance of elements on a web page. These rules consist of selectors, properties, and values. Selectors identify HTML elements, and properties define how those elements should appear.
Quick Tip: CSS allows for clear separation of style from content, making it easier to maintain and modify the look of a website.
What is the correct HTML for making a hyperlink?
View Solution
In HTML, a hyperlink is created using the \texttt{ tag with the \texttt{href attribute, which specifies the URL the link points to. The text between the opening and closing \texttt{ tags is what appears as clickable.
Quick Tip: Always remember that the \texttt{href} attribute is used to define the destination URL for a hyperlink.
Which is the correct syntax to link XML file with CSS?
A Session variable is created _____.
Let \(A = \{1, 2, 3\}\). Which of the following is the number of distinct relations on A?
In any Lattice \(L\), \(((a \wedge b) \vee a) \wedge b = \_\_\_\).
Let \(x \to 1\) \(\frac{x^x - x}{x - 1 - \log x}\) = ____
Which of the following integrals is un-bounded?
Comments