The PYQ practice room
GATE CS 2014 Set 1
All 65 solved GATE CS 2014 Set 1 questions in exam order. Open a question, commit to an answer, and learn from the step-by-step solution. One question at a time.
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.Questions
65
Paper marks
100
Question formats
2
MCQ · NAT
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyWhich of the following options is the closest in meaning to the phrase underlined in the sentence below? It is fascinating to see life forms cope with varied environmental…Think it through. Then check your answer.Question
Which of the following options is the closest in meaning to the phrase underlined in the sentence below?It is fascinating to see life forms cope with varied environmental conditions.Correct answer
(B) adapt to
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The phrase "cope with" means to deal effectively with something difficult. In the context of life forms and environmental conditions, "adapt to" (meaning to become adjusted to new conditions) is the closest in meaning. "Adopt to" is grammatically incorrect (adopt means to choose or take up). "Adept in" means skilled at. "Accept with" means to receive.2
Q2MCQ1 markEasyChoose the most appropriate word from the options given below to complete the following sentence. He could not understand the judges awarding her the first prize, because he…Think it through. Then check your answer.Question
Choose the most appropriate word from the options given below to complete the following sentence.He could not understand the judges awarding her the first prize, because he thought that her performance was quite __________.Correct answer
(C) mediocre
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence implies a contrast: he could not understand why she won, which means he must have thought her performance was not good. "Mediocre" means of only moderate quality; not very good. This fits the context. "Superb" and "exhilarating" are positive adjectives which would justify the prize. "Medium" is typically used for size or state, not quality of performance.3
Q3MCQ1 markEasyIn a press meet on the recent scam, the minister said, "The buck stops here". What did the minister convey by the statement?Think it through. Then check your answer.Question
In a press meet on the recent scam, the minister said, "The buck stops here". What did the minister convey by the statement?Correct answer
(C) He will assume final responsibility
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The idiom "the buck stops here" is used to indicate that the speaker accepts ultimate responsibility for decisions and actions and will not pass the blame to anyone else.4
Q4NAT1 markEasyIf , compute .Think it through. Then check your answer.Question
If , compute .Correct answer
96 to 96
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the equation:Expanding the left-hand side using the algebraic identity , where and :To find the value of , subtract 2 from both sides of the equation:Therefore, the value of is 96.5
Q5MCQ1 markMediumThe roots of are real and positive. and are real. Then hasThink it through. Then check your answer.Question
The roots of are real and positive. and are real. Then hasCorrect answer
(D) 4 real roots
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the roots of the quadratic equation be and .
Given that the roots are real and positive, we have and .The second equation is .
Since , we can rewrite the equation as:Let . The equation becomes , which is identical in form to the original equation. Therefore, the roots for are the same as the roots for the original equation:Substituting back :1. or (since )2. or (since )Assuming the roots and are distinct (as is implied by the option for 4 roots), we get 4 distinct real roots: .Thus, the equation has 4 real roots.6
Q6MCQ2 marksEasyThe Palghat Gap (or Palakkad Gap), a region about 30 km wide in the southern part of the Western Ghats in India, is lower than the hilly terrain to its north and south. The exact…Think it through. Then check your answer.Question
The Palghat Gap (or Palakkad Gap), a region about 30 km wide in the southern part of the Western Ghats in India, is lower than the hilly terrain to its north and south. The exact reasons for the formation of this gap are not clear. It results in the neighbouring regions of Tamil Nadu getting more rainfall from the South West monsoon and the neighbouring regions of Kerala having higher summer temperatures.What can be inferred from this passage?Correct answer
(C) The low terrain of the Palghat Gap has a significant impact on weather patterns in neighbouring parts of Tamil Nadu and Kerala
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The passage states that the existence of the Palghat Gap results in neighbouring regions of Tamil Nadu getting more rainfall and neighbouring regions of Kerala having higher summer temperatures. This implies that the physical geography (low terrain) of the gap influences the weather patterns (rainfall and temperature) in the adjacent areas.(A) is incorrect because the passage states the reasons for the formation of the gap are not clear.
(B) is incorrect because the passage describes the gap as lower than the hills to its north and south, but does not explicitly describe the elevation of the neighbouring regions in Tamil Nadu and Kerala.
(D) is incorrect because the passage lists higher temperatures and higher rainfall as separate results of the gap, not that one causes the other.7
Q7MCQ2 marksEasyGeneticists say that they are very close to confirming the genetic roots of psychiatric illnesses such as depression and schizophrenia, and consequently, that doctors will be able…Think it through. Then check your answer.Question
Geneticists say that they are very close to confirming the genetic roots of psychiatric illnesses such as depression and schizophrenia, and consequently, that doctors will be able to eradicate these diseases through early identification and gene therapy.On which of the following assumptions does the statement above rely?Correct answer
(B) Certain psychiatric illnesses have a genetic basis
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The argument states that geneticists are close to confirming the genetic roots of psychiatric illnesses and concludes that doctors will be able to eradicate them through gene therapy. This conclusion relies on the fundamental assumption that these illnesses indeed have a genetic basis. If they did not, confirming genetic roots would be impossible, and gene therapy would not be a viable eradication method. Therefore, the statement relies on the assumption that certain psychiatric illnesses have a genetic basis.8
Q8NAT2 marksMediumRound-trip tickets to a tourist destination are eligible for a discount of 10% on the total fare. In addition, groups of 4 or more get a discount of 5% on the total fare. If the…Think it through. Then check your answer.Question
Round-trip tickets to a tourist destination are eligible for a discount of 10% on the total fare. In addition, groups of 4 or more get a discount of 5% on the total fare. If the one way single person fare is Rs 100, a group of 5 tourists purchasing round-trip tickets will be charged Rs _________.Correct answer
850 to 850
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Calculate the total base fare:- One-way fare per person = Rs 100
- Round-trip fare per person =
- Number of tourists = 5
- Total base fare =
- Round-trip discount = 10% on the total fare.
- Group discount (4 or more) = 5% on the total fare.
- Since both discounts are "on the total fare", they are additive.
- Total discount percentage =
- Total discount amount =
- Amount charged =
9
Q9NAT2 marksEasyIn a survey, 300 respondents were asked whether they own a vehicle or not. If yes, they were further asked to mention whether they own a car or scooter or both. Their responses…Think it through. Then check your answer.Question
In a survey, 300 respondents were asked whether they own a vehicle or not. If yes, they were further asked to mention whether they own a car or scooter or both. Their responses are tabulated below. What percent of respondents do not own a scooter?Men Women Own vehicle Car 40 34 Scooter 30 20 Both 60 46 Do not own vehicle 20 50 Correct answer
48 to 48
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total respondents = 300.Respondents who do not own a scooter fall into two categories:1.Those who own a vehicle but only a car (and not a scooter).2.Those who do not own a vehicle at all.From the table:- Car only:
- Men: 40
- Women: 34
- Total Car + 34 = 7420 + 50 = 7074 + 70 = 144$.
10
Q10NAT2 marksHardWhen a point inside of a tetrahedron (a solid with four triangular surfaces) is connected by straight lines to its corners, how many (new) internal planes are created with these…Think it through. Then check your answer.Question
When a point inside of a tetrahedron (a solid with four triangular surfaces) is connected by straight lines to its corners, how many (new) internal planes are created with these lines? _____________Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A tetrahedron has 4 vertices. Let the vertices be and the internal point be . When is connected to the corners (), the lines are formed.The new internal planes are formed by the point and pairs of vertices (which correspond to the edges of the tetrahedron). A plane is defined by 3 non-collinear points. The internal planes are the triangles formed by and the edges of the tetrahedron.The edges of the tetrahedron are . There are 6 edges in a tetrahedron.
For each edge (e.g., ), a new internal plane is created.Since there are 6 edges, there are 6 new internal planes (). These planes divide the original tetrahedron into 4 smaller tetrahedra ().Thus, 6 new internal planes are created.
Computer Science
5511
Q11MCQ1 markEasyConsider the statement "Not all that glitters is gold" Predicate is true if glitters and predicate is true if is gold. Which one of the following…Think it through. Then check your answer.Question
Consider the statement"Not all that glitters is gold"Predicate is true if glitters and predicate is true if is gold. Which one of the following logical formulae represents the above statement?Correct answer
(D) ∃ x: glitters(x) ∧ ¬ gold(x)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To represent the statement "Not all that glitters is gold" in first-order logic, we can break down its meaning step-by-step:1.Analyze the natural language statement:"Not all that glitters is gold" means "It is not the case that everything which glitters is gold."2.Translate "All that glitters is gold" into logic:"Everything that glitters is gold" is represented as:
3.Negate the statement:"Not all that glitters is gold" is the negation of the above formula:
4.Simplify using logical equivalences:- Using the quantifier negation rule, :
- Using the implication equivalence, :
- Applying De Morgan's Laws to the negation:
12
Q12NAT1 markMediumSuppose you break a stick of unit length at a point chosen uniformly at random. Then the expected length of the shorter stick is ________ .Think it through. Then check your answer.Question
Suppose you break a stick of unit length at a point chosen uniformly at random. Then the expected length of the shorter stick is ________ .Correct answer
0.24 to 0.27
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the stick be represented by the interval . We break the stick at a point chosen uniformly at random from the interval . The probability density function (PDF) of is:When the stick is broken at , it is divided into two pieces of lengths and . Let be the random variable representing the length of the shorter piece. Therefore, is defined as:We can express as a function of :Y = \begin{cases} $ X & \text{if } 0 \le X < 0.5 \\$ $ 1 - X & \text{if } 0.5 \le X \le 1 $ \end{cases}To find the expected length of the shorter stick, , we integrate over the probability density of :Since , we split the integral at the boundary point :Evaluating the two integrals separately:1.First integral:2.Second integral:Adding the two parts together:Thus, the expected length of the shorter stick is .13
Q13MCQ1 markMediumLet be a directed graph where is the set of vertices and the set of edges. Then which one of the following graphs has the same strongly connected components as…Think it through. Then check your answer.Question
Let be a directed graph where is the set of vertices and the set of edges. Then which one of the following graphs has the same strongly connected components as ?Correct answer
(B) G₂ = (V, E₂) where E₂ = \(u,v) (v,u) ∈ E\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find which graph has the same strongly connected components (SCCs) as , let us analyze the definition of a strongly connected component and the properties of the given options.1. Definition of Strongly Connected Components (SCCs)
In a directed graph , two vertices and belong to the same strongly connected component if and only if there is a directed path from to and a directed path from to in . We denote this mutual reachability relation as .2. Analysis of Option B: The Transpose Graph
The graph is defined by reversing the direction of all edges in :This graph is known as the transpose graph of , often denoted as .Let us determine the reachability relation in :- A directed path from to exists in if and only if there is a directed path from to in .
- Similarly, a directed path from to exists in if and only if there is a directed path from to in .
3. Why Other Options are Incorrect
- Option A (): is the complement graph. Changing the edge set to non-existent edges completely alters the reachability structure. For example, if is a single directed cycle of 3 vertices (which is strongly connected), its complement will not be strongly connected.
- Option C (): adds transitive shortcut edges of length . This can merge separate SCCs of into a single SCC. For example, if is a path , the SCCs of are , , and . In , we add the edge , but there is still no path back, so the SCCs remain the same in this specific case, but if we have and , adding paths of length can create new cycles and merge components that were not originally connected in both directions. More simply, changes the reachability relation and does not preserve the exact SCC boundaries in all graphs.
- Option D (): modifies the vertex set by removing isolated vertices (). If contains any isolated vertices, they form their own single-vertex SCCs. Removing them means will have fewer SCCs than .
14
Q14NAT1 markMediumConsider the following system of equations: The number of solutions for this…Think it through. Then check your answer.Question
Consider the following system of equations:The number of solutions for this system is __________________Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We have the system of equations:
1)
2)
3)
4) From (1), .
Substitute into (3):
.Substitute into (2):
.Now find :
.Now find :
.We have a unique candidate solution .
We must verify if this satisfies the fourth equation (4):
.The solution satisfies all equations. Since the system is linear and we found a unique solution by substitution, there is exactly 1 solution.15
Q15NAT1 markEasyThe value of the dot product of the eigenvectors corresponding to any pair of different eigenvalues of a 4-by-4 symmetric positive definite matrix is _____________________.Think it through. Then check your answer.Question
The value of the dot product of the eigenvectors corresponding to any pair of different eigenvalues of a 4-by-4 symmetric positive definite matrix is _____________________.Correct answer
0 to 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A key property of real symmetric matrices is that eigenvectors corresponding to distinct eigenvalues are orthogonal. If and are distinct eigenvalues with corresponding eigenvectors and , then the dot product .Therefore, the value is 0.16
Q16MCQ1 markMediumLet the function…Think it through. Then check your answer.Question
Let the functionwhere and denote the derivative of with respect to . Which of the following statements is/are TRUE?(I) There exists such that .
(II) There exists such that .Correct answer
(C) Both I and II
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function is defined as a determinant. Notice the structure of the rows.
Row 1 depends on .
Row 2 is the values of Row 1 evaluated at .
Row 3 is the values of Row 1 evaluated at .When , Row 1 becomes identical to Row 2. A determinant with two identical rows is 0. Thus, .
When , Row 1 becomes identical to Row 3. Thus, .Since is a linear combination of differentiable functions () on the interval , it is continuous and differentiable.
By Rolle's Theorem, since , there exists at least one such that . So, statement (I) is TRUE.To check statement (II), we need to know if is identically zero (constant). If it were constant zero, would always be 0.
Expanding the determinant along the first row:
, where are constants (minors).
Unless all coefficients are zero or the functions cancel out perfectly (which they don't for these specific values), the function is not a constant zero. For example, we can check a point like . The rows would be linearly independent, so .
Since is not constant, its derivative is not identically zero. Thus, there exists some where . So, statement (II) is TRUE.Both statements are true.17
Q17MCQ1 markMediumConsider the following Boolean expression for : The minimal sum-of-products form of isThink it through. Then check your answer.Question
Consider the following Boolean expression for :The minimal sum-of-products form of isCorrect answer
(A) PQ + QR + QS
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given Boolean expression:
Factor out :
Using the absorption law on the first two terms inside the parentheses:
So,
Rearrange terms:
Apply again where and :
So,
Apply again where and :
So,
Expanding the expression:
This is the minimal sum-of-products form.18
Q18NAT1 markEasyThe base (or radix) of the number system such that the following equation holds is____________.Think it through. Then check your answer.Question
The base (or radix) of the number system such that the following equation holds is____________.Correct answer
5 to 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the base of the number system be .
Convert the given equation into decimal form:
Multiply both sides by :
Subtract from both sides:
Since the base must be greater than the largest digit present in the numbers (which is 3), cannot be 0.
Therefore, .19
Q19NAT1 markMediumA machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an…Think it through. Then check your answer.Question
A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is ____________.Correct answer
16383 to 16383
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Instruction Length: The architecture is 32-bit with 1-word long instructions, so each instruction is 32 bits.2.Opcode Bits: To support 45 instructions, we need bits for the opcode.3.Register Operand Bits: There are 64 registers, so each register address requires bits. Since there are two register operands, they take bits.4.Immediate Operand Bits: The remaining bits in the 32-bit instruction are used for the immediate operand.Bits for immediate operand = Total bits - Opcode bits - Register bits
Bits for immediate operand = bits.5.Maximum Value: For an unsigned 14-bit integer, the maximum value is .20
Q20MCQ1 markEasyConsider the following program in C language: [code] Which one of the following statements is TRUE?Think it through. Then check your answer.Question
Consider the following program in C language:Which one of the following statements is TRUE?#include <stdio.h> main() { int i; int *pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Correct answer
(D) On execution, the value printed is 5 more than the integer value entered.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The program declares an integer variableiand a pointerpiinitialized to the address ofi. Thescanffunction reads an integer from standard input and stores it at the address pointed to bypi(which is&i). Thus, the input value is stored ini. Theprintfstatement then prints the value ofi + 5. Therefore, the output is 5 more than the integer value entered.21
Q21MCQ1 markEasyLet be a graph with vertices and edges. What is the tightest upper bound on the running time of Depth First Search on , when is represented as an adjacency…Think it through. Then check your answer.Question
Let be a graph with vertices and edges. What is the tightest upper bound on the running time of Depth First Search on , when is represented as an adjacency matrix?Correct answer
(C) Θ(n²)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a Depth First Search (DFS), every vertex is visited. When a vertex is visited, we must iterate through all possible neighbors to find adjacent vertices. In an adjacency matrix representation, finding the neighbors of a vertex requires scanning the entire row corresponding to that vertex, which takes time. Since there are vertices, the total time complexity is . Note that for an adjacency list, the complexity would be .22
Q22NAT1 markMediumConsider a rooted node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly 4 nodes is…Think it through. Then check your answer.Question
Consider a rooted node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly 4 nodes is . Then the value of is ________.Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine the number of subtrees with exactly 4 nodes, we can perform a post-order traversal (bottom-up approach). For each node, we calculate the size of the subtree rooted at that node as:If , we increment a counter. This process visits each node exactly once and performs constant work at each node. Thus, the time complexity is .Comparing with , we get:
The value of .23
Q23MCQ1 markMediumConsider the directed graph given below. [figure] Which one of the following is TRUE?Think it through. Then check your answer.Question
Consider the directed graph given below.Which one of the following is TRUE?
Correct answer
(C) Both PSRQ and SPRQ are topological orderings.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge from vertex to vertex , comes before in the ordering. A topological ordering is possible if and only if the graph has no directed cycles (i.e., it is a Directed Acyclic Graph or DAG).Let's analyze the given graph for cycles:- There is an edge
P → Q. - There is an edge
Q → S. - There is an edge
S → P.
- There is an edge
24
Q24MCQ1 markMediumLet be a quicksort program to sort numbers in ascending order using the first element as the pivot. Let and be the number of comparisons made by for the inputs…Think it through. Then check your answer.Question
Let be a quicksort program to sort numbers in ascending order using the first element as the pivot. Let and be the number of comparisons made by for the inputs [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?Correct answer
(C) t₁ t₂
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the number of comparisons for each input. In Quicksort, the pivot is compared with every other element in the current sub-array to partition it.For input [1 2 3 4 5] ():1.Pivot = 1. Compare with 2, 3, 4, 5 (4 comparisons). Partition: Left=[], Right=[2, 3, 4, 5].2.Recurse on [2, 3, 4, 5]. Pivot = 2. Compare with 3, 4, 5 (3 comparisons). Partition: Left=[], Right=[3, 4, 5].3.Recurse on [3, 4, 5]. Pivot = 3. Compare with 4, 5 (2 comparisons). Partition: Left=[], Right=[4, 5].4.Recurse on [4, 5]. Pivot = 4. Compare with 5 (1 comparison). Partition: Left=[], Right=[5].Total .For input [4 1 5 3 2] ():1.Pivot = 4. Compare with 1, 5, 3, 2 (4 comparisons). Partition: Left=[1, 3, 2], Right=[5].2.Recurse on [1, 3, 2]. Pivot = 1. Compare with 3, 2 (2 comparisons). Partition: Left=[], Right=[3, 2].3.Recurse on [3, 2]. Pivot = 3. Compare with 2 (1 comparison). Partition: Left=[2], Right=[].Total .Comparing and :
Therefore, .25
Q25MCQ1 markEasyWhich one of the following is TRUE?Think it through. Then check your answer.Question
Which one of the following is TRUE?Correct answer
(C) The language L = \w w has 3k+1 b's for some k ∈ N with Σ = \a, b\\ is regular.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze each option:(A) is a classic Context-Free Language (CFL) but is not regular. A finite automaton cannot count the number of 's to match with 's for arbitrary .(B) is not regular. This can be proven using the Pumping Lemma.(C) means the number of 's is congruent to . This requires counting modulo 3, which can be done with a finite automaton (DFA) having 3 states (representing remainders 0, 1, 2). Since a DFA can be constructed, the language is regular.(D) is a Context-Sensitive Language (CSL) but not regular (and not even Context-Free). It requires checking if the first half of the string is identical to the second half.Therefore, option (C) is the correct statement.26
Q26MCQ1 markEasyConsider the finite automaton in the following figure. [figure] What is the set of reachable states for the input string 0011?Think it through. Then check your answer.Question
Consider the finite automaton in the following figure.What is the set of reachable states for the input string 0011?
Correct answer
(A) \q₀, q₁, q₂\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the transition function. We start at the initial state set .Input string:1.Read '0':
Current set:2.Read '0':
Current set:3.Read '1':
Current set:4.Read '1':
Union: The set of reachable states is .27
Q27MCQ1 markEasyWhich one of the following is FALSE?Think it through. Then check your answer.Question
Which one of the following is FALSE?Correct answer
(D) x = 4 5 ⇒ x = 20 is an example of common subexpression elimination.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Option (D) describes constant folding (evaluating constant expressions at compile time), not common subexpression elimination. Common subexpression elimination involves identifying and reusing results of expressions that are computed more than once.(A) is the definition of a basic block.
(B) Available expression analysis is indeed used to identify common subexpressions.
(C) Live variable analysis is used to identify variables that are defined but never used, allowing for dead code elimination.28
Q28MCQ1 markEasyMatch the following: | Group 1 | Group 2 | |---|---| | 1) Waterfall model | a) Specifications can be developed incrementally | | 2) Evolutionary model | b) Requirements…Think it through. Then check your answer.Question
Match the following:Group 1 Group 2 1) Waterfall model a) Specifications can be developed incrementally 2) Evolutionary model b) Requirements compromises are inevitable 3) Component-based software engineering c) Explicit recognition of risk 4) Spiral development d) Inflexible partitioning of the project into stages Correct answer
(B) 1-d, 2-a, 3-b, 4-c
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
- Waterfall model (1) is known for its sequential nature and inflexible partitioning of the project into stages (d).
- Evolutionary model (2) allows for iterative development, meaning specifications can be developed incrementally (a).
- Component-based software engineering (3) relies on pre-built components, which often means requirements compromises are inevitable (b) to fit the available components.
- Spiral development (4) is characterized by its focus on risk analysis, i.e., Explicit recognition of risk (c).
29
Q29NAT1 markMediumSuppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100,…Think it through. Then check your answer.Question
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The current position of the disk arm is at cylinder 100.
The queue of requests is: .Using SSTF (Shortest Seek Time First), we select the request with the minimum seek time (distance) from the current head position.1.Current Head: 100- Distances: , , , etc.
- Closest is 100. Service 100.
- Serviced so far: 1 (Request 100)
- Remaining Queue:
- Distances: , , , , etc.
- Closest is 105. Service 105.
- Serviced so far: 2 (Requests 100, 105)
- Remaining Queue:
- Distances: , , , , etc.
- Closest is 110. Service 110.
- Serviced so far: 3 (Requests 100, 105, 110)
- Remaining Queue:
- Distances: , , , , .
- Closest is 90. Service 90.
Number of requests serviced before 90 is 3 (100, 105, 110).30
Q30MCQ1 markEasyWhich one of the following is FALSE?Think it through. Then check your answer.Question
Which one of the following is FALSE?Correct answer
(D) Kernel level threads cannot share the code segment.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Option (D) is FALSE. Kernel-level threads belonging to the same process share the same code segment, data segment, and open files, just like user-level threads. They only maintain separate stacks and register sets.(A) is True: The kernel is unaware of user-level threads and manages them as a single process.
(B) is True: Since the kernel sees the process as a single thread of execution, if one user-level thread makes a blocking system call, the entire process is blocked.
(C) is True: User-level thread switching does not require kernel intervention (no mode switch), making it faster.31
Q31MCQ1 markEasyConsider the relation scheme and the set of functional dependencies…Think it through. Then check your answer.Question
Consider the relation scheme and the set of functional dependencies on . What is the key for ?Correct answer
(B) \E, F, H\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the candidate key, we look for attributes that are not on the right-hand side (RHS) of any functional dependency. These attributes must be part of any key.Attributes:
RHS Attributes:
Attributes NOT on RHS: Thus, the candidate key must contain . Let's check the closure of :1.Start with .2. add . Set: .3. add . Set: .4. add . Set: .5. add . Set: .6. add . Set: .Since{E, F, H}+includes all attributes of , is a candidate key.32
Q32MCQ1 markMediumGiven the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table where …Think it through. Then check your answer.Question
Given the following statements:S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.S2: Given the table where and together form the primary key, the following is a valid table definition.Which one of the following statements is CORRECT?CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R)Correct answer
(D) Both S1 and S2 are FALSE.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
S1 is FALSE. WhileCHECKconstraints can enforce domain integrity and some business rules, they cannot fully replaceFOREIGN KEYconstraints. Foreign keys enforce referential integrity (ensuring a value exists in another table) and support cascading actions (ON DELETE CASCADE,ON UPDATE CASCADE), whichCHECKassertions cannot easily replicate without complex triggers or non-standard SQL features.S2 is FALSE. In standard SQL, aFOREIGN KEYmust reference a unique key (Primary Key or Unique Constraint) in the parent table. In table , the primary key is the composite key . The attribute alone is not guaranteed to be unique. Therefore,FOREIGN KEY (a) references Ris invalid because it does not reference a candidate key of .33
Q33MCQ1 markMediumConsider the following three statements about link state and distance vector routing protocols, for a large network with 500 network nodes and 4000 links. [S1] The computational…Think it through. Then check your answer.Question
Consider the following three statements about link state and distance vector routing protocols, for a large network with 500 network nodes and 4000 links.[S1] The computational overhead in link state protocols is higher than in distance vector protocols.
[S2] A distance vector protocol (with split horizon) avoids persistent routing loops, but not a link state protocol.
[S3] After a topology change, a link state protocol will converge faster than a distance vector protocol.Which one of the following is correct about S1, S2, and S3 ?Correct answer
(D) S1 and S3 are true, but S2 is false.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
S1 is TRUE. Link State (LS) protocols (like OSPF) require each node to compute the shortest path tree using Dijkstra's algorithm, which is computationally more intensive ( or ) than the simple Bellman-Ford updates used in Distance Vector (DV) protocols.S2 is FALSE. Split horizon helps reduce routing loops in DV protocols but does not eliminate them entirely (e.g., it doesn't prevent 3-node loops). Conversely, LS protocols build a complete topological map, which inherently prevents persistent routing loops once the databases are synchronized.S3 is TRUE. LS protocols flood link state updates immediately upon a topology change, leading to faster convergence. DV protocols suffer from the "count-to-infinity" problem and slow propagation of routing information, leading to slower convergence.34
Q34MCQ1 markEasyWhich of the following are used to generate a message digest by the network security protocols? (P) RSA (Q) SHA-1 (R) DES (S) MD5Think it through. Then check your answer.Question
Which of the following are used to generate a message digest by the network security protocols?(P) RSA
(Q) SHA-1
(R) DES
(S) MD5Correct answer
(C) Q and S only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A message digest is a fixed-size numeric representation of the contents of a message, computed by a hash function.- (P) RSA: Asymmetric encryption algorithm (used for encryption/digital signatures).
- (Q) SHA-1 (Secure Hash Algorithm 1): A cryptographic hash function used to generate message digests.
- (R) DES (Data Encryption Standard): Symmetric encryption algorithm.
- (S) MD5 (Message Digest Algorithm 5): A cryptographic hash function used to generate message digests.
35
Q35MCQ1 markEasyIdentify the correct order in which the following actions take place in an interaction between a web browser and a web server. 1. The web browser requests a webpage using HTTP. 2.…Think it through. Then check your answer.Question
Identify the correct order in which the following actions take place in an interaction between a web browser and a web server.1.The web browser requests a webpage using HTTP.2.The web browser establishes a TCP connection with the web server.3.The web server sends the requested webpage using HTTP.4.The web browser resolves the domain name using DNS.Correct answer
(A) 4,2,1,3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The correct sequence of actions for a web browser to fetch a webpage is:1.DNS Resolution (4): The browser first needs to resolve the domain name (e.g., www.example.com) to an IP address using the Domain Name System (DNS).2.TCP Connection (2): Once the IP address is known, the browser establishes a TCP connection with the web server (typically via a 3-way handshake).3.HTTP Request (1): After the connection is established, the browser sends an HTTP request for the specific webpage.4.HTTP Response (3): The web server processes the request and sends back the requested webpage using HTTP.Thus, the order is 4, 2, 1, 3.36
Q36NAT2 marksHardConsider a token ring network with a length of 2 km having 10 stations including a monitoring station. The propagation speed of the signal is m/s and the token…Think it through. Then check your answer.Question
Consider a token ring network with a length of 2 km having 10 stations including a monitoring station. The propagation speed of the signal is m/s and the token transmission time is ignored. If each station is allowed to hold the token for 2 µsec, the minimum time for which the monitoring station should wait (in µsec) before assuming that the token is lost is _______.Correct answer
28 to 30
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine if the token is lost, the monitoring station must wait for the maximum possible time it takes for the token to circulate around the ring once, assuming all stations hold it for the maximum allowed time.Given:- Length of network () = 2 km = m
- Propagation speed () = m/s
- Number of stations () = 10
- Token holding time per station () = 2 µsec
2.Calculate Total Token Holding Time:Since there are 10 stations and each can hold the token for 2 µsec:
3.Calculate Total Wait Time:The monitoring station should wait for the propagation delay plus the sum of holding times of all stations.
Answer: 3037
Q37NAT2 marksMediumLet the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum segment size used is 2 KB.…Think it through. Then check your answer.Question
Let the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum segment size used is 2 KB. The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is _________.Correct answer
1100 to 1300
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When a timeout occurs in TCP:1.The threshold () is set to half the current congestion window size.2.The congestion window () is reset to 1 Maximum Segment Size (MSS).3.The system enters Slow Start phase until reaches .4.Then it enters Congestion Avoidance phase.Step-by-step progression:- Start: KB
- Round 1 (Slow Start): doubles KB (Time: 1 RTT)
- Round 2 (Slow Start): doubles KB (Time: 2 RTTs)
- Round 3 (Slow Start): doubles KB (Time: 3 RTTs). Now , switch to Congestion Avoidance.
In this phase, increases by 1 MSS (2 KB) per RTT.
Target is 32 KB. Current is 16 KB.
Number of increments needed = increments.
This takes 8 RTTs.Total Time:
Total RTTs = 3 (Slow Start) + 8 (Congestion Avoidance) = 11 RTTs.
Given RTT = 100 msec.
Total Time = msec.(Note: Depending on implementation details regarding when the window is checked/incremented, ranges like 1100-1500 are sometimes accepted, but 1100 is the precise theoretical minimum.)38
Q38NAT2 marksMediumConsider a selective repeat sliding window protocol that uses a frame size of 1 KB to send data on a 1.5 Mbps link with a one-way latency of 50 msec. To achieve a link utilization…Think it through. Then check your answer.Question
Consider a selective repeat sliding window protocol that uses a frame size of 1 KB to send data on a 1.5 Mbps link with a one-way latency of 50 msec. To achieve a link utilization of 60%, the minimum number of bits required to represent the sequence number field is ________.Correct answer
5 to 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Frame size bits.
Bandwidth bps.
Propagation time sec.
Utilization .Transmission time .Let be the sender window size.
Efficiency
So, the sender window size .In Selective Repeat (SR) protocol, the size of the sender window () and receiver window () are typically equal (). The sequence number space size () must satisfy:
The number of bits () required to represent the sequence numbers is:
bits.39
Q39MCQ2 marksMediumConsider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by and respectively.…Think it through. Then check your answer.Question
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by and respectively. Which one of them is conflict serializable?Correct answer
(D) r₂(x); w₂(x); r₃(x); r₁(x); w₁(x)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine conflict serializability, we build a precedence graph where an edge exists if there is a conflicting operation (RW, WR, WW) on the same data item where comes before .(A)40
Q40MCQ2 marksMediumGiven the following two statements: S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF. S2: is a minimal cover for the set of…Think it through. Then check your answer.Question
Given the following two statements:S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF.
S2: is a minimal cover for the set of functional dependencies .Which one of the following is CORRECT?Correct answer
(A) S1 is TRUE and S2 is FALSE.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
S1: A relation with only two attributesR(A, B)is always in BCNF.- If there are no non-trivial FDs, the key is , and it is in BCNF.
- If
A → B, then is the key. Since the LHS () is a superkey, it is in BCNF. - If
B → A, then is the key. Since the LHS () is a superkey, it is in BCNF. - If
A → BandB → A, both are keys. Both dependencies satisfy BCNF.
Proposed minimal cover .
For to be a cover of , the closure of attributes under must imply all FDs in . Specifically, checkAB → Ein .
Using : . This does not contain . Thus,AB → Ecannot be derived from . Therefore, is not equivalent to .
Thus, S2 is FALSE.41
Q41MCQ2 marksMediumAn operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The…Think it through. Then check your answer.Question
An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of ZAllocation Max X Y Z X Y Z P0 0 0 1 8 4 3 P1 3 2 0 6 2 0 P2 2 1 1 3 3 3
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of ZWhich one of the following is TRUE?Correct answer
(B) Only REQ2 can be permitted.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We are given the Available vector: .Step 1: Calculate Need Matrix
Step 2: Check REQ1 for P0: (0, 0, 2)1.Request Available? True.2.Request Need? True.3.Pretend Allocation:- Available becomes
- P0 Allocation becomes
- P0 Need becomes
- Can P1 finish? Need . Yes. New Avail = .
- Can P2 finish? Need . Yes. New Avail = .
- Can P0 finish? Need . Yes.
Initial Available:1.Request Available? True.2.Request Need? True.3.Pretend Allocation:- Available becomes
- P1 Allocation becomes
- P1 Need becomes
- Can P1 finish? Need . Yes. New Avail = .
- Can P2 finish? Need . Yes. New Avail = .
- Can P0 finish? Need . Yes.
42
Q42NAT2 marksMediumConsider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds. | Process Name | Arrival Time | Execution Time |…Think it through. Then check your answer.Question
Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is ____________________.Process Name Arrival Time Execution Time A 0 6 B 3 2 C 5 4 D 7 6 E 10 3 Correct answer
7.2 to 7.2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We use Shortest Remaining Time First (SRTF) scheduling (preemptive).Timeline:- t=0: A arrives (Burst 6). A starts. (A rem: 6)
- t=3: B arrives (Burst 2). A has run for 3ms (A rem: 3). Compare A(3) vs B(2). B is shorter. Preempt A. B starts.
- t=5: C arrives (Burst 4). B has run for 2ms (B rem: 0). B finishes. Turnaround B = .
- Ready: A(3), C(4). A is shorter. A resumes.
- t=7: D arrives (Burst 6). A has run for 2ms more (A rem: 1). Compare A(1) vs C(4) vs D(6). A is shortest. A continues.
- t=8: A finishes (1ms more). A finishes. Turnaround A = .
- Ready: C(4), D(6). C is shorter. C starts.
- t=10: E arrives (Burst 3). C has run for 2ms (C rem: 2). Compare C(2) vs D(6) vs E(3). C is shortest. C continues.
- t=12: C finishes (2ms more). C finishes. Turnaround C = .
- Ready: D(6), E(3). E is shorter. E starts.
- t=15: E finishes (3ms). E finishes. Turnaround E = .
- Ready: D(6). D starts.
- t=21: D finishes (6ms). D finishes. Turnaround D = .
- A: 8
- B: 2
- C: 7
- D: 14
- E: 5
msec.43
Q43NAT2 marksMediumAssume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the *optimal…Think it through. Then check your answer.Question
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer
7 to 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Optimal Page Replacement replaces the page that will not be used for the longest period of time.
Frames: 3. Reference String: 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6.1.Ref 1: Miss. Frames: {1}. (Fault 1)2.Ref 2: Miss. Frames: {1, 2}. (Fault 2)3.Ref 3: Miss. Frames: {1, 2, 3}. (Fault 3)4.Ref 4: Miss. Frames full. Look ahead: 2, 1, 5, 3...- 2 is needed next at index 4.
- 1 is needed next at index 5.
- 3 is needed next at index 7.
- 3 is the furthest. Replace 3. Frames: {1, 2, 4}. (Fault 4)
6.Ref 1: Hit. Frames: {1, 2, 4}.7.Ref 5: Miss. Look ahead: 3, 2, 4, 6...- 1 is not needed again.
- 2 is needed at index 8.
- 4 is needed at index 9.
- Replace 1. Frames: {5, 2, 4}. (Fault 5)
- 5 is not needed again.
- 2 is needed at index 8.
- 4 is needed at index 9.
- Replace 5. Frames: {3, 2, 4}. (Fault 6)
10.Ref 4: Hit. Frames: {3, 2, 4}.11.Ref 6: Miss. Look ahead: (none). Replace any (e.g., 3). Frames: {6, 2, 4}. (Fault 7)Total Page Faults = 7.44
Q44MCQ2 marksMediumA canonical set of items is given below On input symbol the set hasThink it through. Then check your answer.Question
A canonical set of items is given belowOn input symbol the set hasCorrect answer
(D) neither a shift-reduce nor a reduce-reduce conflict.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The item indicates that a shift is possible only on the input symbol . The item indicates a reduce action. The question specifies the input symbol is . Since the shift item does not match , no shift is possible. A reduce action might be possible if is in , but without a shift action available, there cannot be a shift-reduce conflict. There is only one reduce item, so no reduce-reduce conflict. Thus, neither conflict exists.45
Q45MCQ2 marksEasyLet be a language and be its complement. Which one of the following is NOT a viable possibility?Think it through. Then check your answer.Question
Let be a language and be its complement. Which one of the following is NOT a viable possibility?Correct answer
(C) Both L and L are r.e. but not recursive.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A standard theorem in theory of computation states that if a language and its complement are both recursively enumerable (r.e.), then is recursive (decidable). Therefore, it is impossible for both to be r.e. but NOT recursive. Option (C) describes this impossible scenario.46
Q46MCQ2 marksMediumWhich of the regular expressions given below represent the following DFA? [figure] I) II) III)Think it through. Then check your answer.Question
Which of the regular expressions given below represent the following DFA?
I)
II)
III)Correct answer
(B) I and III only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The DFA has a start state and a final state . Transitions: , , , . This DFA accepts all strings that end in a 1.- III) : Clearly represents all strings ending in 1. Correct.
- I) : reaches . The term represents loops from back to (either reading 1, or reading 0 then some 0s then 1). This correctly describes the language. Correct.
- II) : The first part requires all 0s to precede 1s. The second part requires the string to start with 1. This expression fails to generate strings like (starts with 0, has 0 after 1). Incorrect.
47
Q47NAT2 marksMediumThere are 5 bags labeled 1 to 5. All the coins in a given bag have the same weight. Some bags have coins of weight 10 gm, others have coins of weight 11 gm. I pick 1, 2, 4, 8, 16…Think it through. Then check your answer.Question
There are 5 bags labeled 1 to 5. All the coins in a given bag have the same weight. Some bags have coins of weight 10 gm, others have coins of weight 11 gm. I pick 1, 2, 4, 8, 16 coins respectively from bags 1 to 5. Their total weight comes out to 323 gm. Then the product of the labels of the bags having 11 gm coins is ___.Correct answer
12 to 12
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the weight of coins in bag be .
Let be the number of coins picked from bag . We are given .
The total weight is .
Let , where if the bag has 11 gm coins, and if it has 10 gm coins.
Then,Sum of coins .We need to express 13 as a sum of the values . Since these are powers of 2, the representation is unique (binary representation of 13).This corresponds to , , and .
So, , and .
The bags with 11 gm coins are Bag 1, Bag 3, and Bag 4.
The product of their labels is .48
Q48MCQ2 marksMediumSuppose a polynomial time algorithm is discovered that correctly computes the largest clique in a given graph. In this scenario, which one of the following represents the correct…Think it through. Then check your answer.Question
Suppose a polynomial time algorithm is discovered that correctly computes the largest clique in a given graph. In this scenario, which one of the following represents the correct Venn diagram of the complexity classes P, NP and NP Complete (NPC)?Correct answer
(D) [figure]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Largest Clique problem is an NP-Complete (NPC) problem. If a polynomial-time algorithm is discovered for an NPC problem, it implies that every problem in NP can be reduced to it and then solved in polynomial time. Therefore, .If , then the set P and the set NP are identical. The set of NP-Complete problems (NPC) consists of the "hardest" problems in NP. If , then all problems in NP (except for trivial ones like the empty language and ) are NP-Complete. Thus, NPC is a proper subset of (containing all non-trivial problems).Option (C) correctly depicts a single circle for with as a subset inside it. Option (D) suggests , which is technically incorrect because trivial problems in P are not NP-Complete.49
Q49NAT2 marksMediumThe minimum number of comparisons required to find the minimum and the maximum of 100 numbers is _________________.Think it through. Then check your answer.Question
The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is _________________.Correct answer
147.1 to 148.1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the minimum and maximum of elements using the minimum number of comparisons, the tournament method is used:1.Compare elements in pairs. This takes comparisons.2.The winners of these pairs are candidates for the maximum, and the losers are candidates for the minimum.3.Find the maximum among the winners. This takes comparisons.4.Find the minimum among the losers. This takes comparisons.Total comparisons = .
For even , this simplifies to .For :
Comparisons = .50
Q50MCQ2 marksEasyConsider a hash table with 9 slots. The hash function is . The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15,…Think it through. Then check your answer.Question
Consider a hash table with 9 slots. The hash function is . The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, areCorrect answer
(A) 3, 0, and 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The hash function is . The keys are inserted into slots 0 to 8.Insertions:- Slot 5: [5]
- Slot 1: [28]
- Slot 1: [28, 19] (Collision)
- Slot 6: [15]
- Slot 2: [20]
- Slot 6: [15, 33] (Collision)
- Slot 3: [12]
- Slot 8: [17]
- Slot 1: [28, 19, 10] (Collision)
Slot 0: 0
Slot 1: 3 (28, 19, 10)
Slot 2: 1 (20)
Slot 3: 1 (12)
Slot 4: 0
Slot 5: 1 (5)
Slot 6: 2 (15, 33)
Slot 7: 0
Slot 8: 1 (17)Maximum chain length = 3 (Slot 1)
Minimum chain length = 0 (Slots 0, 4, 7)
Average chain length = Thus, the values are 3, 0, and 1.51
Q51MCQ2 marksMediumConsider the following C function in which size is the number of elements in the array E: [code] The value returned by the function MyX is theThink it through. Then check your answer.Question
Consider the following C function in which size is the number of elements in the array E:int MyX(int *E, unsigned int size) { int Y = 0; int Z; int i, j, k; for(i = 0; i < size; i++) Y = Y + E[i]; for(i = 0; i < size; i++) for(j = i; j < size; j++) { Z = 0; for(k = i; k <= j; k++) Z = Z + E[k]; if (Z > Y) Y = Z; } return Y; }
The value returned by the function MyX is theCorrect answer
(A) maximum possible sum of elements in any sub-array of array E.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionMyXfirst initializesYto the sum of all elements in the arrayE.
Then, it iterates through all possible sub-arrays defined by start indexiand end indexj. For each sub-array, it calculates the sumZ.
IfZis greater thanY,Yis updated toZ.Essentially,Ytracks the maximum sum encountered so far. Since the initial value ofY(total sum) corresponds to the sub-array from0tosize-1, the loop effectively checks every sub-array sum against the current maximum.Therefore, the function returns the maximum sum of elements among all possible sub-arrays ofE.52
Q52MCQ2 marksMediumConsider the following pseudo code. What is the total number of multiplications to be performed? [code]Think it through. Then check your answer.Question
Consider the following pseudo code. What is the total number of multiplications to be performed?D = 2 for i = 1 to n do for j = i to n do for k = j + 1 to n do D = D * 3Correct answer
(C) One-sixth of the product of the 3 consecutive integers.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The number of multiplications corresponds to the number of times the innermost statement executes. The loops are:- from to
- from to
- from to
53
Q53NAT2 marksMediumConsider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on…Think it through. Then check your answer.Question
Consider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on this 6-stage pipeline, the speedup achieved with respect to non-pipelined execution if 25% of the instructions incur 2 pipeline stall cycles is ______________________.Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Number of stages in the pipeline, .For a non-pipelined processor, the execution time per instruction is the sum of the delays of all stages. Since stages are perfectly balanced:For the pipelined processor, the ideal CPI (Cycles Per Instruction) is 1. However, there are stalls.
Percentage of instructions with stalls = 25%.
Stall cycles per such instruction = 2.Average stall cycles per instruction:The actual CPI for the pipelined processor:The execution time per instruction in the pipeline:The speedup is the ratio of non-pipelined execution time to pipelined execution time:The speedup achieved is 4.54
Q54MCQ2 marksMediumAn access sequence of cache block addresses is of length N and contains n unique block addresses. The number of unique block addresses between two consecutive accesses to the same…Think it through. Then check your answer.Question
An access sequence of cache block addresses is of length N and contains n unique block addresses. The number of unique block addresses between two consecutive accesses to the same block address is bounded above by k. What is the miss ratio if the access sequence is passed through a cache of associativity exercising least-recently-used replacement policy?Correct answer
(A) n/N
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem describes a scenario where the cache is large enough to capture the locality of the reference string.1.Compulsory Misses: There are unique block addresses. The first access to each unique block will always result in a miss (compulsory miss). Thus, there are at least misses.2.Capacity/Conflict Misses: The condition states that the number of unique blocks between consecutive accesses to the same block is bounded by , and the associativity . In an LRU cache, if the number of unique intervening blocks is less than the cache size (or associativity set size), the block will remain in the cache and the subsequent access will be a hit.Assuming the condition is sufficient to prevent capacity misses for the given reuse distance (strictly speaking, stack depth is if there are unique intervening blocks, but in the context of such problems, this implies hits on re-access), all accesses after the first one for each block are hits.Total Misses = Compulsory Misses =
Total Accesses =
Miss Ratio =55
Q55MCQ2 marksMediumConsider the 4-to-1 multiplexer with two select lines and given below. [figure] The minimal sum-of-products form of the Boolean expression for the output of the…Think it through. Then check your answer.Question
Consider the 4-to-1 multiplexer with two select lines and given below.The minimal sum-of-products form of the Boolean expression for the output of the multiplexer is
Correct answer
(A) PQ + QR + PQR
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The output of a 4-to-1 multiplexer with select lines and inputs is given by:From the diagram:- ,
We can rewrite as .
However, looking at the options, let's try to group with :Using the distributive law :So,This matches Option (A).56
Q56NAT2 marksEasyThe function satisfies the following equation: . The value of is ________.Think it through. Then check your answer.Question
The function satisfies the following equation: . The value of is ________.Correct answer
-2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given .
First derivative:Second derivative:Substitute and into the given equation:For this to be true for all , the coefficient of must be zero:57
Q57MCQ2 marksHardA function is continuous in the interval . It is known that and . Which one of the following statements must be true?Think it through. Then check your answer.Question
A function is continuous in the interval . It is known that and . Which one of the following statements must be true?Correct answer
(A) There exists a y in the interval (0,1) such that f(y) = f(y+1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let . We want to find if for some .
Evaluate at the endpoints of the interval :Since is continuous, is also continuous. Because and , by the Intermediate Value Theorem (IVT), there must exist a value such that .Thus, statement (A) must be true.58
Q58NAT2 marksMediumFour fair six-sided dice are rolled. The probability that the sum of the results being 22 is . The value of is ________.Think it through. Then check your answer.Question
Four fair six-sided dice are rolled. The probability that the sum of the results being 22 is . The value of is ________.Correct answer
10 to 10
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to find the number of ways to get a sum of 22 with 4 dice. The maximum possible sum is .
The possible combinations of 4 numbers (each ) that sum to 22 are:1.: The number of permutations is .2.: The number of permutations is .Checking for other combinations:- If the smallest number is 3, the max sum is . So no die can be 3 or less.
- The minimum value must be 4.
The probability is .59
Q59NAT2 marksMediumA pennant is a sequence of numbers, each number being 1 or 2. An n-pennant is a sequence of numbers with sum equal to n. For example, (1,1,2) is a 4-pennant. The set of all…Think it through. Then check your answer.Question
A pennant is a sequence of numbers, each number being 1 or 2. An n-pennant is a sequence of numbers with sum equal to n. For example, (1,1,2) is a 4-pennant. The set of all possible 1-pennants is {(1)}, the set of all possible 2-pennants is {(2), (1,1)} and the set of all possible 3-pennants is {(2,1), (1,1,1), (1,2)}. Note that the pennant (1,2) is not the same as the pennant (2,1). The number of 10-pennants is ______________.Correct answer
88.9 to 89.1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of n-pennants.
An n-pennant is a sequence of 1s and 2s that sums to .
The last term in the sequence can be either 1 or 2.Case 1: The last term is 1.
The sum of the preceding terms must be . The number of such sequences is .Case 2: The last term is 2.
The sum of the preceding terms must be . The number of such sequences is .Thus, the recurrence relation is:
Base cases:
(Sequence: (1))
(Sequences: (1,1), (2))Calculating for :
The number of 10-pennants is 89.60
Q60NAT2 marksMediumLet denote the set of all functions . Denote by the number of functions from to the set . The value of is ______.Think it through. Then check your answer.Question
Let denote the set of all functions . Denote by the number of functions from to the set . The value of is ______.Correct answer
16 to 16
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Determine the size of set :is the set of all functions from to .
The domain size is .
The codomain size is .
The number of such functions is .
So, .2.Determine :is the number of functions from to .
The domain is , so .
The codomain is , so .
.3.Calculate :.
.61
Q61NAT2 marksMediumConsider an undirected graph where self-loops are not allowed. The vertex set of is . There is an edge between and…Think it through. Then check your answer.Question
Consider an undirected graph where self-loops are not allowed. The vertex set of is . There is an edge between and if and . The number of edges in this graph is __________.Correct answer
506 to 506
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The vertices are points on a grid. The condition and implies that two distinct vertices are connected if they are adjacent horizontally, vertically, or diagonally (King's moves in chess).Let . The total number of vertices is .
We calculate the sum of degrees of all vertices:1.Corner vertices: 4 corners.Each has 3 neighbors.
Sum = .2.Edge vertices (excluding corners): on top/bottom + on left/right = .For , vertices.
Each has 5 neighbors.
Sum = .3.Inner vertices: .For , vertices.
Each has 8 neighbors.
Sum = .Total sum of degrees = .By the Handshaking Lemma, the number of edges is half the sum of degrees:
.62
Q62MCQ2 marksMediumAn ordered -tuple with is called graphic if there exists a simple undirected graph with vertices having degrees…Think it through. Then check your answer.Question
An ordered -tuple with is called graphic if there exists a simple undirected graph with vertices having degrees respectively. Which of the following 6-tuples is NOT graphic?Correct answer
(C) (3, 3, 3, 1, 0, 0)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine if a sequence is graphic, we can use the Havel-Hakimi algorithm. The algorithm states that a sequence is graphic if and only if the sequence is graphic (after re-sorting if necessary).Let's test option (C) :1.Remove the first element (). Subtract from the next elements.Sequence becomes: .2.Sort the sequence: .3.Remove the first element (). Subtract from the next elements.Sequence becomes: .Since we have a negative degree (), the sequence is not graphic.Let's briefly check the others:
(A) : Sum is 6 (even). 3 disjoint edges. Graphic.
(B) : Sum is 12 (even). A cycle of 6 vertices (). Graphic.
(D) : Sum is 8 (even).- Remove 3: . Sort: .
- Remove 1: . Graphic.
63
Q63MCQ2 marksEasyWhich one of the following propositional logic formulas is TRUE when exactly two of and are TRUE?Think it through. Then check your answer.Question
Which one of the following propositional logic formulas is TRUE when exactly two of and are TRUE?Correct answer
(B) ((p rightarrow q) ∧ r) ∨ (p ∧ q ∧ r)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need a formula that evaluates to TRUE if and only if exactly two of the variables are TRUE. The possible truth assignments where exactly two are TRUE are:1.2.3.Let's analyze the structure of the options, which generally have the form or .
Term corresponds exactly to case 1 ( true, false).
Term involves and . Since covers case 1, must cover cases 2 and 3.In cases 2 and 3, is TRUE. Also, in case 2 () and case 3 (), the values of and are different. The expression is TRUE when and are the same, and FALSE when they are different. Therefore, is TRUE when and are different.So, the term captures exactly cases 2 and 3 (where and is TRUE).Combining these with OR ():
This formula is TRUE for cases 2, 3 (first part) and case 1 (second part).This matches Option (B).64
Q64MCQ2 marksMediumGiven the following schema:employees(emp-id, first-name, last-name, hire-date, dept-id, salary)departments(dept-id, dept-name, manager-id, location-id)You want to display…Think it through. Then check your answer.Question
Given the following schema:employees(emp-id, first-name, last-name, hire-date, dept-id, salary)departments(dept-id, dept-name, manager-id, location-id)You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:What is the outcome?SQL>SELECT last-name, hire-date FROM employees WHERE (dept-id, hire-date) IN (SELECT dept-id, MAX(hire-date) FROM employees JOIN departments USING(dept-id) WHERE location-id = 1700 GROUP BY dept-id);Correct answer
(B) It executes and gives the correct result.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The query is designed to find employees who have the maximum hire date within their department, specifically for departments in location 1700.1.Subquery:SELECT dept-id, MAX(hire-date) FROM employees JOIN departments USING(dept-id) WHERE location-id = 1700 GROUP BY dept-id
This correctly joins the tables, filters for location 1700, groups by department, and returns the department ID and the latest (MAX) hire date for that department.2.Outer Query:SELECT last-name, hire-date FROM employees WHERE (dept-id, hire-date) IN (...)
This selects the name and hire date of employees whosedept-idandhire-datematch a pair returned by the subquery. This effectively selects the employee(s) who were hired on the latest date in each valid department.3.Syntax Validity:- Pairwise comparison
(a, b) IN (SELECT x, y ...)is valid standard SQL. -
GROUP BYcan be used with joins in subqueries.
- Pairwise comparison
65
Q65NAT2 marksMediumConsider two processors and executing the same instruction set. Assume that under identical conditions, for the same input, a program running on takes 25% less…Think it through. Then check your answer.Question
Consider two processors and executing the same instruction set. Assume that under identical conditions, for the same input, a program running on takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on . If the clock frequency of is 1GHz, then the clock frequency of (in GHz) is _________.Correct answer
1.6 to 1.6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of instructions (same for both processors since the instruction set and program are the same).
Let and be the Cycles Per Instruction for and respectively.
Let and be the clock frequencies of and respectively.
Let and be the execution times on and respectively.Given:1. takes 25% less time than :2. incurs 20% more CPI than :3.Frequency of ,The execution time equation is given by:For processor :For processor :Substitute the known relations into the equation for :Now substitute into the left side:Cancel common terms and from both sides:Rearrange to solve for :Substitute :