The PYQ practice room
GATE CS 2014 Set 2
All 65 solved GATE CS 2014 Set 2 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 markEasyChoose the most appropriate phrase from the options given below to complete the following sentence. India is a post-colonial country becauseThink it through. Then check your answer.Question
Choose the most appropriate phrase from the options given below to complete the following sentence.India is a post-colonial country becauseCorrect answer
(A) it was a former British colony
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The term "post-colonial" refers to the period following the end of colonial rule. India is described as a post-colonial country because it was formerly a colony of the British Empire and has since gained independence.2
Q2MCQ1 markEasyWho ___________ was coming to see us this evening?Think it through. Then check your answer.Question
Who ___________ was coming to see us this evening?Correct answer
(B) did you say
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The correct interrogative structure is "Who did you say was coming...".- (A) "Who you said" lacks the auxiliary verb required for a question.
- (C) "did you say that" includes "that", which is grammatically incorrect or awkward in this specific relative clause structure where "who" is the subject of "was coming".
- (D) "had you said" uses the past perfect tense, which is unnecessary and less natural than the simple past in this context.
- (B) "did you say" correctly forms the question.
3
Q3MCQ1 markEasyMatch the columns. | Column 1 | Column 2 | | :--- | :--- | | 1) eradicate | P) misrepresent | | 2) distort | Q) soak completely | | 3) saturate | R) use | | 4) utilize | S)…Think it through. Then check your answer.Question
Match the columns.Column 1 Column 2 1) eradicate P) misrepresent 2) distort Q) soak completely 3) saturate R) use 4) utilize S) destroy utterly Correct answer
(A) 1:S, 2:P, 3:Q, 4:R
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The meanings of the words are:1.Eradicate: to destroy completely or put an end to. Matches with (S) destroy utterly.2.Distort: to give a misleading or false account or impression of. Matches with (P) misrepresent.3.Saturate: to cause (something) to become thoroughly soaked with liquid so that no more can be absorbed. Matches with (Q) soak completely.4.Utilize: to make practical and effective use of something. Matches with (R) use.Therefore, the correct matching is 1:S, 2:P, 3:Q, 4:R.4
Q4MCQ1 markEasyWhat is the average of all multiples of 10 from 2 to 198?Think it through. Then check your answer.Question
What is the average of all multiples of 10 from 2 to 198?Correct answer
(B) 100
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The multiples of 10 from 2 to 198 are: .This sequence forms an Arithmetic Progression (A.P.) where:
First term,
Last term, The average of an arithmetic progression is given by the formula:Substituting the values:Alternatively, we can find the number of terms and the sum:
Number of terms
Sum
Average5
Q5MCQ1 markEasyThe value of isThink it through. Then check your answer.Question
The value of isCorrect answer
(C) 4.000
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the value of the expression be .Since the expression is infinite, the term inside the first square root is also .Squaring both sides:Factorizing the quadratic equation:So, or .
Since the value of a square root must be positive, .Therefore, the value is .6
Q6MCQ2 marksEasyThe old city of Koenigsberg, which had a German majority population before World War 2, is now called Kaliningrad. After the events of the war, Kaliningrad is now a Russian…Think it through. Then check your answer.Question
The old city of Koenigsberg, which had a German majority population before World War 2, is now called Kaliningrad. After the events of the war, Kaliningrad is now a Russian territory and has a predominantly Russian population. It is bordered by the Baltic Sea on the north and the countries of Poland to the south and west and Lithuania to the east respectively. Which of the statements below can be inferred from this passage?Correct answer
(B) Kaliningrad is a part of Russia despite it not being contiguous with the rest of Russia
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The passage states that Kaliningrad is a Russian territory. It describes the borders of Kaliningrad as the Baltic Sea (north), Poland (south and west), and Lithuania (east). Since none of the bordering regions are the rest of Russia, it can be inferred that Kaliningrad is separated from the main body of Russia (i.e., it is not contiguous).- Option (A) is incorrect because the passage states it had a German majority before World War 2.
- Option (C) is incorrect because the passage indicates it was called Koenigsberg before being renamed Kaliningrad.
- Option (D) is not supported by the text; while they border Kaliningrad, the passage does not discuss transit routes.
7
Q7MCQ2 marksMediumThe number of people diagnosed with dengue fever (contracted from the bite of a mosquito) in north India is twice the number diagnosed last year. Municipal authorities have…Think it through. Then check your answer.Question
The number of people diagnosed with dengue fever (contracted from the bite of a mosquito) in north India is twice the number diagnosed last year. Municipal authorities have concluded that measures to control the mosquito population have failed in this region.Which one of the following statements, if true, does not contradict this conclusion?Correct answer
(D) The number of people with malarial fever (also contracted from mosquito bites) has increased this year
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The conclusion is that measures to control the mosquito population have failed, based on the increase in dengue cases.(A) If cases are imported, the local mosquito control may not have failed. This contradicts the conclusion.
(B) If the increase is due to better reporting, the actual number of cases might not have increased. This contradicts the conclusion.
(C) If the increase is due to better detection, it doesn't imply a failure in control. This contradicts the conclusion.
(D) Malaria is also spread by mosquitoes. An increase in malaria cases supports the idea that the mosquito population has increased or control measures have failed. This statement does not contradict the conclusion.8
Q8MCQ2 marksMediumIf is real and , then possible values of includeThink it through. Then check your answer.Question
If is real and , then possible values of includeCorrect answer
(D) 14, 52
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given .
This implies two cases:Case 1:
or Case 2:
Discriminant . No real solutions.So, possible real values for are and .We need to find values of .If :
If :
The possible values are 14 and 52.9
Q9NAT2 marksMediumThe ratio of male to female students in a college for five years is plotted in the following line graph. If the number of female students doubled in 2009, by what percent did the…Think it through. Then check your answer.Question
The ratio of male to female students in a college for five years is plotted in the following line graph. If the number of female students doubled in 2009, by what percent did the number of male students increase in 2009?
Correct answer
140 to 140
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
From the graph, we can read the ratio of male to female students () for each year:
In 2008, Ratio
In 2009, Ratio Let the number of female students in 2008 be .
Then, .It is given that the number of female students doubled in 2009.
So, .Now, calculate the number of male students in 2009:
.The increase in the number of male students is:
.The percentage increase is:
.10
Q10MCQ2 marksMediumAt what time between a. m. and a. m. will the minute hand and hour hand of a clock make an angle closest to ?Think it through. Then check your answer.Question
At what time between a. m. and a. m. will the minute hand and hour hand of a clock make an angle closest to ?Correct answer
(A) 6: 22 a. m.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The angle between the hour hand and the minute hand at hours and minutes is given by the formula:For , we calculate the angle for each given option:(A) At a. m., :Difference from is .(B) At a. m., :Difference from is .(C) At a. m., :Difference from is .(D) At a. m., :Difference from is .The time a. m. results in an angle of , which is closest to .
Computer Science
5511
Q11NAT1 markMediumThe security system at an IT office is composed of 10 computers of which exactly four are working. To check whether the system is functional, the officials inspect four of the…Think it through. Then check your answer.Question
The security system at an IT office is composed of 10 computers of which exactly four are working. To check whether the system is functional, the officials inspect four of the computers picked at random (without replacement). The system is deemed functional if at least three of the four computers inspected are working. Let the probability that the system is deemed functional be denoted by . Then _____________.Correct answer
11.85 to 11.95
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total number of computers .
Number of working computers .
Number of non-working computers .
Number of computers inspected .The system is deemed functional if at least 3 of the 4 inspected computers are working. This means either 3 are working or 4 are working.Total ways to choose 4 computers from 10:Case 1: Exactly 3 working computers are chosen.
We choose 3 from the 4 working and 1 from the 6 non-working.Case 2: Exactly 4 working computers are chosen.
We choose 4 from the 4 working and 0 from the 6 non-working.Total favorable outcomes = .Probability :We need to find :The value lies within the range 11.85 to 11.95.12
Q12NAT1 markEasyEach of the nine words in the sentence ”The quick brown fox jumps over the lazy dog” is written on a separate piece of paper. These nine pieces of paper are kept in a box. One…Think it through. Then check your answer.Question
Each of the nine words in the sentence ”The quick brown fox jumps over the lazy dog” is written on a separate piece of paper. These nine pieces of paper are kept in a box. One of the pieces is drawn at random from the box. The expected length of the word drawn is _____________. (The answer should be rounded to one decimal place.)Correct answer
3.8 to 3.9
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the expected length of a word drawn at random, we use the formula for expected value , where is the length of each word and is the probability of drawing that word.Step 1: List the words and their lengths from the sentence "The quick brown fox jumps over the lazy dog":Step 2: Count the total number of words ().Word Length () The 3 quick 5 brown 5 fox 3 jumps 5 over 4 the 3 lazy 4 dog 3
Step 3: Calculate the sum of the lengths of all words.
Step 4: Since each word is drawn at random with equal probability, for each word.
Step 5: Round the result to one decimal place as specified in the question.
The official answer key accepts a range from 3.8 to 3.9.13
Q13NAT1 markEasyThe maximum number of edges in a bipartite graph on 12 vertices is __________________________.Think it through. Then check your answer.Question
The maximum number of edges in a bipartite graph on 12 vertices is __________________________.Correct answer
36 to 36
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the vertex set be partitioned into two sets and with and . The total number of vertices is . The maximum number of edges in a bipartite graph occurs when it is a complete bipartite graph , having edges.To maximize the product subject to the constraint , the values of and should be as close to each other as possible. Since 12 is even, we can have .Maximum number of edges = .14
Q14NAT1 markEasyIf the matrix is such that then the determinant of is equal to ______.Think it through. Then check your answer.Question
If the matrix is such thatthen the determinant of is equal to ______.Correct answer
0 to 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The matrix is given by the product of a column vector and a row vector .The rank of a matrix formed by the product of a non-zero column vector and a non-zero row vector is always 1. Since is a matrix and its rank is 1 (which is less than 3), the determinant of is 0.
Alternatively, we can observe that the rows are linearly dependent:
Row 2 = Row 1
Row 3 = Row 1
Thus, .15
Q15MCQ1 markEasyA non-zero polynomial of degree 3 has roots at and . Which one of the following must be TRUE?Think it through. Then check your answer.Question
A non-zero polynomial of degree 3 has roots at and . Which one of the following must be TRUE?Correct answer
(A) f(0)f(4) < 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Since is a polynomial of degree 3 with roots at , it can be written as:where is a non-zero constant.Calculate :Calculate :Now consider the product :Since is non-zero, is always positive. Therefore, is always negative.Thus, option (A) is correct.16
Q16MCQ1 markMediumThe dual of a Boolean function , written as , is the same expression as that of with and swapped. is said to be…Think it through. Then check your answer.Question
The dual of a Boolean function , written as , is the same expression as that of with and swapped. is said to be self-dual if . The number of self-dual functions with Boolean variables isCorrect answer
(D) 2^2ⁿ⁻¹
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A Boolean function is self-dual if .
This condition implies that for every input combination , the outputF(X)determines the output for the complementary input . Specifically, .There are possible input combinations. These can be grouped into pairs of mutually complementary inputs .
For each pair, we have 2 choices for the output values (either or ).Since there are such pairs, the total number of self-dual functions is:17
Q17MCQ1 markEasyLet . A circuit is built by giving the output of an -bit binary counter as input to an -to- bit decoder. This circuit is equivalent to aThink it through. Then check your answer.Question
Let . A circuit is built by giving the output of an -bit binary counter as input to an -to- bit decoder. This circuit is equivalent to aCorrect answer
(C) k -bit ring counter.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
An -bit binary counter counts from to . Let . The -to- decoder has output lines, say .When the counter value is , the decoder output is active (1) and all others are inactive (0).
When the counter value is , the decoder output is active (1) and all others are inactive (0).
...
When the counter value is , the decoder output is active (1).The sequence of active outputs rotates from to and back to . This behavior corresponds to a -bit ring counter, which circulates a single '1' through flip-flops.18
Q18NAT1 markMediumConsider the equation with and as unknown. The number of possible solutions is _____ .Think it through. Then check your answer.Question
Consider the equation with and as unknown. The number of possible solutions is _____ .Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Convert the given equation to decimal:
LHS: .
RHS: .Equating them:
Constraints on and :1.Since the digit appears in base , we must have .2.Since is a digit in base , we must have .Find pairs such that and :- If , then . (, valid). Solution: .
- If , then . (, valid). Solution: .
- If , then . (, valid). Solution: .
Thus, there are 3 possible solutions.19
Q19NAT1 markMediumA 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4…Think it through. Then check your answer.Question
A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is _____Correct answer
20 to 20
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Physical Address Space = 4 GB = bytes Physical Address = 32 bits.
- Cache Capacity = 16 KB = bytes.
- Block Size = 8 words 32 bits/word = 8 4 bytes = 32 bytes = bytes.
- Set Associativity = 4-way.
1.Block Offset: Since block size is bytes, Block Offset = 5 bits.2.Number of Cache Lines: lines.3.Number of Sets: sets.4.Set Index: Since there are sets, Set Index = 7 bits.5.Tag Bits: Total Address Bits - (Set Index + Block Offset)Tag Bits = bits.The number of bits for the TAG field is 20.20
Q20NAT1 markEasyConsider the functionfuncshown below: [code] The value returned byfunc(435)is __________.Think it through. Then check your answer.Question
Consider the functionfuncshown below:The value returned byint func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); }func(435)is __________.Correct answer
9 to 9
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionfunccounts the number of times the loop executes. Inside the loop,numis right-shifted by 1 (num >>= 1) in each iteration. The loop continues as long asnumis non-zero. This effectively calculates the number of bits required to represent the numbernumup to its most significant bit (MSB), or simply the position of the MSB plus one (1-based index).Let's analyzenum = 435:
in binary:
The binary representation has 9 bits. The loop will execute once for each bit position until the number becomes 0.Iteration 1: num becomes (count = 1)
Iteration 2: num becomes (count = 2)
...
Iteration 9: num becomes (count = 9)The loop terminates. The returned value is 9.21
Q21MCQ1 markMediumSupposenandpareunsigned intvariables in a C program. We wish to setpto . Ifnis large, which one of the following statements is most likely to setp…Think it through. Then check your answer.Question
Supposenandpareunsigned intvariables in a C program. We wish to setpto .
Ifnis large, which one of the following statements is most likely to setpcorrectly?Correct answer
(B) p = n (n-1) / 2 (n-2) / 3;
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We want to calculate .
Sincenis large, computingn * (n-1) * (n-2)directly (as in option A) can cause an integer overflow before the division by 6 occurs.Option B:p = n * (n-1) / 2 * (n-2) / 3;1.n * (n-1)is always even (product of two consecutive integers), son * (n-1) / 2is an integer and equals . This intermediate value is , which is much smaller than , reducing the risk of overflow.2.Then it multiplies byOption C:(n-2)and divides by 3. Since the final result is an integer, the product of 3 consecutive integers is always divisible by . Thus, the intermediate value after multiplying by(n-2)will be divisible by 3.p = n * (n-1) / 3 ...n * (n-1)is not guaranteed to be divisible by 3 (e.g., if , is, but if , is not). Integer division would truncate the result, leading to an incorrect value.Option D uses floating point arithmetic (6.0), which might lose precision for large integers or result in a type mismatch warning/error depending on strictness, but the primary issue with largenin C is integer overflow, which B handles best.22
Q22MCQ1 markEasyA priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into…Think it through. Then check your answer.Question
A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:Correct answer
(A) 10, 8, 7, 3, 2, 1, 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Initial Max-Heap (Level Order: 10, 8, 5, 3, 2):Step 1: Insert 110 / \ 8 5 / \ 3 2
Insert 1 at the next available position (left child of 5).10 / \ 8 5 / \ / 3 2 1
Check Max-Heap property: Parent 5 > Child 1. OK.
Current Level Order: 10, 8, 5, 3, 2, 1.Step 2: Insert 7
Insert 7 at the next available position (right child of 5).10 / \ 8 5 / \ / \ 3 2 1 7
Check Max-Heap property: Parent 5 < Child 7. Violation. Swap 5 and 7.10 / \ 8 7 / \ / \ 3 2 1 5
Check Max-Heap property: Parent 10 > Child 7. OK.Final Level Order: 10, 8, 7, 3, 2, 1, 5.23
Q23MCQ1 markEasyWhich one of the following correctly determines the solution of the recurrence relation with ?Think it through. Then check your answer.Question
Which one of the following correctly determines the solution of the recurrence relation with ?Correct answer
(A) Θ(n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Using the Master Theorem for :
Here , , and .
Calculate .
Compare with :
Since for any , this falls into Case 1 of the Master Theorem.
Therefore, .24
Q24MCQ1 markEasyConsider the tree arcs of a BFS traversal from a source node W in an unweighted, connected, undirected graph. The tree T formed by the tree arcs is a data structure for…Think it through. Then check your answer.Question
Consider the tree arcs of a BFS traversal from a source node W in an unweighted, connected, undirected graph. The tree T formed by the tree arcs is a data structure for computingCorrect answer
(B) the shortest path from W to every vertex in the graph.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Breadth-First Search (BFS) explores the graph layer by layer. In an unweighted graph, the level of a node in the BFS tree corresponds to the minimum number of edges required to reach that node from the source. Therefore, the BFS tree rooted at W contains the shortest paths from W to all other reachable vertices in the graph.25
Q25MCQ1 markMediumIf and , consider (I) is a regular language (II)
Which…Think it through. Then check your answer.Question
If and , consider
(I) is a regular language
(II)
Which one of the following is CORRECT?Correct answer
(A) Only (I)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given and .
The concatenation .
This corresponds to the regular expression , so is a regular language. Thus, (I) is TRUE.Statement (II) claims . This set represents strings with an equal number of 's and 's. However, the concatenation of and allows the number of 's and 's to be independent (e.g., but ). Thus, (II) is FALSE.26
Q26MCQ1 markMediumLet denotes that language A is mapping reducible (also known as many-to-one reducible) to language B. Which one of the following is FALSE?Think it through. Then check your answer.Question
Let denotes that language A is mapping reducible (also known as many-to-one reducible) to language B. Which one of the following is FALSE?Correct answer
(D) If A ₘ B and B is not recursively enumerable then A is not recursively enumerable.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The property of mapping reducibility implies:1.If is recursive, then is recursive. (Option A is True)2.If is recursively enumerable (RE), then is RE. (Option C is True)3.The contrapositive of (1) is: If is not recursive (undecidable), then is not recursive. However, Option B states "If is undecidable then is undecidable". Note that if is undecidable, it does not strictly imply is undecidable in all contexts unless we are talking about specific hardness, but generally, if a hard problem reduces to , must be at least as hard. More formally, if is undecidable, and , then cannot be decidable (recursive), because if were recursive, would be recursive. Thus, is undecidable. (Option B is True)4.Option D states: "If is not recursively enumerable then is not recursively enumerable." This is the converse of the contrapositive of (2). The correct contrapositive of (2) is: If is not RE, then is not RE. The statement in D is false. For example, let be a regular language (which is RE) and be a non-RE language. We can define a reduction from to (mapping all strings in to an element and strings not in to , assuming such elements exist and we can construct the map). Wait, the reduction function must be computable. A constant function is computable. So we can reduce a decidable language to a non-RE language. Thus can hold with being RE and being not RE. Therefore, not RE does not imply not RE.Thus, (D) is FALSE.27
Q27MCQ1 markMediumConsider the grammar defined by the following production rules, with two operators and …Think it through. Then check your answer.Question
Consider the grammar defined by the following production rules, with two operators and
Which one of the following is TRUE?Correct answer
(B) + is right associative, while is left associative
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine associativity, we look at the recursion in the grammar productions:1.For the operator : The production is . The non-terminal appears on the left side of the operator in the body of the production. This indicates left recursion, which corresponds to left associativity.2.For the operator : The production is . The non-terminal appears on the right side of the operator in the body of the production. This indicates right recursion, which corresponds to right associativity.Therefore, is right associative and is left associative.28
Q28MCQ1 markEasyWhich one of the following is NOT performed during compilation?Think it through. Then check your answer.Question
Which one of the following is NOT performed during compilation?Correct answer
(A) Dynamic memory allocation
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Dynamic memory allocation: This occurs at runtime (e.g., usingmallocin C ornewin C++). The compiler generates code to perform this, but the actual allocation happens when the program is running.2.Type checking: This is a phase of the compiler (Semantic Analysis) where it checks for type errors.3.Symbol table management: The compiler maintains a symbol table to keep track of variables, functions, and their attributes throughout the compilation process.4.Inline expansion: This is an optimization technique performed by the compiler where function calls are replaced by the function body.Therefore, Dynamic memory allocation is not performed during compilation.29
Q29MCQ1 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) Prototyping is a method of requirements validation.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Option (A) is incorrect because the requirements document describes what the system should do, not how it is implemented.
Option (B) is incorrect because consistency and completeness are ideal goals but are rarely fully achieved in practice due to complexity.
Option (C) is correct because prototyping allows users to interact with a preliminary version of the system, helping to validate that the requirements capture what is actually needed.
Option (D) is incorrect because a requirements review is conducted to find errors in the requirements, not the system design.30
Q30NAT1 markMediumA FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a bytes disk on which the…Think it through. Then check your answer.Question
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a bytes disk on which the file system is stored and data block size is bytes, the maximum size of a file that can be stored on this disk in units of bytes is ____________.Correct answer
99.55 to 99.65
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the disk size, be the block size, and be the FAT entry size.
Given:
bytes
bytes
bytesThe disk stores both the FAT and the data blocks. Let be the number of blocks.
The total space used is the space for the FAT entries plus the space for the data blocks.The number of blocks available for data is .
The maximum file size is the total size of these data blocks:Converting to units of bytes:Answer: 99.631
Q31NAT1 markEasyThe maximum number of superkeys for the relation schemaR(E, F, G, H)with as the key is _____.Think it through. Then check your answer.Question
The maximum number of superkeys for the relation schemaR(E, F, G, H)with as the key is _____.Correct answer
8 to 8
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A superkey is any set of attributes that contains a candidate key. Here, the candidate key is .
Any subset of the relation attributes that includes is a superkey.
The set of attributes is .
Since must be present, we can choose any combination of the remaining attributes to append to .
The number of subsets of is .The superkeys are:1.2.3.4.5.6.7.8.Total = 8.32
Q32NAT1 markMediumGiven an instance of the STUDENTS relation as shown below: | StudentID | StudentName | StudentEmail | StudentAge | CPI | | ------ | ------ | ------ | ------ |…Think it through. Then check your answer.Question
Given an instance of the STUDENTS relation as shown below:For (StudentName, StudentAge) to be a key for this instance, the value X should NOT be equal to ___________.StudentID StudentName StudentEmail StudentAge CPI 2345 Shankar shankar@math X 9.4 1287 Swati swati@ee 19 9.5 7853 Shankar shankar@cse 19 9.4 9876 Swati swati@mech 18 9.3 8765 Ganesh ganesh@civil 19 8.7 Correct answer
19 to 19
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A candidate key (or simply a key) in a database relation must uniquely identify each tuple (row). This means that no two tuples can have the same values for the key attributes.We are given that the pair is a key. Let's examine the values of this pair for each row in the provided instance:1.(Shankar, X)2.(Swati, 19)3.(Shankar, 19)4.(Swati, 18)5.(Ganesh, 19)For the key constraint to hold, all these pairs must be distinct. Comparing the first pair (Shankar, X) with the third pair (Shankar, 19):- The StudentName is 'Shankar' in both.
- If were equal to 19, the first pair would be (Shankar, 19), which is identical to the third pair. This would violate the uniqueness property of the key.
33
Q33MCQ1 markEasyWhich one of the following is TRUE about the interior gateway routing protocols — Routing Information Protocol (RIP) and Open Shortest Path First (OSPF)?Think it through. Then check your answer.Question
Which one of the following is TRUE about the interior gateway routing protocols — Routing Information Protocol (RIP) and Open Shortest Path First (OSPF)?Correct answer
(A) RIP uses distance vector routing and OSPF uses link state routing
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Routing Information Protocol (RIP) is a distance-vector routing protocol that uses the Bellman-Ford algorithm to determine the best path based on hop count. Open Shortest Path First (OSPF) is a link-state routing protocol that uses Dijkstra's algorithm to calculate the shortest path tree based on link costs. Therefore, option (A) is the correct statement.34
Q34MCQ1 markEasyWhich one of the following socket API functions converts an unconnected active TCP socket into a passive socket?Think it through. Then check your answer.Question
Which one of the following socket API functions converts an unconnected active TCP socket into a passive socket?Correct answer
(C) listen
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In socket programming, a socket is created using thesocket()system call. By default, this socket is an active socket, meaning it is intended to be used to initiate a connection (e.g., by a client callingconnect()).To use a socket on the server side to wait for incoming connections, it must be converted into a passive socket. Thelisten()system call performs this conversion. It marks the socket referred to by the file descriptor as a passive socket, that is, as a socket that will be used to accept incoming connection requests usingaccept().- connect: Initiates a connection on a socket (client side).
- bind: Assigns a local protocol address to a socket.
- listen: Converts an unconnected active TCP socket into a passive socket, indicating that the kernel should accept incoming connection requests directed to this socket.
- accept: Retrieves the first connection request on the queue of pending connections for the listening socket.
35
Q35NAT1 markMediumIn the diagram shown below, L1 is an Ethernet LAN and L2 is a Token-Ring LAN. An IP packet originates from sender S and traverses to R, as shown. The links within each ISP and…Think it through. Then check your answer.Question
In the diagram shown below, L1 is an Ethernet LAN and L2 is a Token-Ring LAN. An IP packet originates from sender S and traverses to R, as shown. The links within each ISP and across the two ISPs, are all point-to-point optical links. The initial value of the TTL field is 32. The maximum possible value of the TTL field when R receives the datagram is __________.
Correct answer
26 to 26
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Time-To-Live (TTL) field in an IP packet is an 8-bit field that is decremented by one at each router the packet passes through. When the TTL value reaches zero, the packet is discarded. This mechanism prevents packets from looping indefinitely in the network.The initial TTL value is given as 32.To find the maximum possible value of the TTL field when the packet reaches the receiver R, we need to find the path with the minimum number of router hops from S to R. The TTL value at the receiver will be (Initial TTL) - (Number of hops).Let's trace the path and count the number of routers (hops) from S to R based on the provided diagram:1.The packet originates at S in LAN L1 and is sent to the gateway router of LAN L1. Let's call this R1. (1st hop)2.Router R1 forwards the packet to the first router in ISP1. Let's call this R2. (2nd hop)3.Router R2 forwards the packet to the second router in ISP1. Let's call this R3. (3rd hop)4.Router R3 forwards the packet to the first router in ISP2. Let's call this R4. (4th hop)5.Router R4 forwards the packet to the second router in ISP2. Let's call this R5. (5th hop)6.Router R5 forwards the packet to the gateway router of LAN L2. Let's call this R6. (6th hop)7.Router R6 forwards the packet to the destination R within LAN L2.The packet is forwarded by a total of 6 routers. Each router decrements the TTL value by 1.Total decrement in TTL = Number of hops = 6.Final TTL value at R = Initial TTL - Total decrement
Final TTL value at R = 32 - 6 = 26.The maximum possible value of the TTL field when R receives the datagram is 26.36
Q36MCQ2 marksHardConsider the store and forward packet switched network given below. Assume that the bandwidth of each link is bytes / sec. A user on host A sends a file of size …Think it through. Then check your answer.Question
Consider the store and forward packet switched network given below. Assume that the bandwidth of each link is bytes / sec. A user on host A sends a file of size bytes to host B through routers R1 and R2 in three different ways. In the first case a single packet containing the complete file is transmitted from A to B. In the second case, the file is split into 10 equal parts, and these packets are transmitted from A to B. In the third case, the file is split into 20 equal parts and these packets are sent from A to B. Each packet contains 100 bytes of header information along with the user data. Consider only transmission time and ignore processing, queuing and propagation delays. Also assume that there are no errors during transmission. Let T1, T2 and T3 be the times taken to transmit the file in the first, second and third case respectively. Which one of the following is CORRECT?
Correct answer
(D) T1 = T3, T3 T2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The network has host A, two routers (R1, R2), and host B. This constitutes a path with 3 links (A-R1, R1-R2, R2-B). So, the number of hops, , is 3.
Bandwidth, bytes/sec.
File size, bytes.
Header size, bytes.The total time to transmit packets of size over hops in a store-and-forward network with pipelining is given by:
Let's calculate the time for each case.Case 1 (T1):- The entire file is sent as a single packet.
- Number of packets, .
- Data in packet = 1000 bytes.
- Packet size, bytes.
- Total time, sec.
- The file is split into 10 equal parts.
- Number of packets, .
- Data per packet = bytes.
- Packet size, bytes.
- Total time, sec.
- The file is split into 20 equal parts.
- Number of packets, .
- Data per packet = bytes.
- Packet size, bytes.
- Total time, sec.
- sec
- sec
- sec
This can be written as .
This matches option (D).37
Q37MCQ2 marksMediumAn IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3. Q—R1—R2—R3—H H acts as an HTTP server, and Q connects to H via HTTP and downloads a file.…Think it through. Then check your answer.Question
An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3.
Q—R1—R2—R3—H
H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer encryption is used, with DES as the shared key encryption protocol. Consider the following four pieces of information:
[I1] The URL of the file downloaded by Q
[I2] The TCP port numbers at Q and H
[I3] The IP addresses of Q and H
[I4] The link layer addresses of Q and H
Which of I1, I2, I3, and I4 can an intruder learn through sniffing at R2 alone?Correct answer
(C) Only I2 and I3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
An intruder sniffing at router R2 can capture all packets that pass through it. The path is Q—R1—R2—R3—H. Let's analyze what information is visible in the packets at R2.1.[I3] The IP addresses of Q and H: The IP header of every packet contains the source IP address (Q's IP) and the destination IP address (H's IP). This information is essential for routing and is not encrypted. R2 itself must read the destination IP address to forward the packet. Therefore, an intruder at R2 can learn I3.2.[I2] The TCP port numbers at Q and H: The IP packet's payload is a TCP segment (since HTTP runs over TCP). The TCP header contains the source and destination port numbers. Like the IP header, the TCP header is not encrypted by session-layer encryption (like TLS/SSL). The encryption applies to the TCP payload (the application data). Therefore, an intruder at R2 can learn I2.3.[I1] The URL of the file downloaded by Q: The URL is part of the HTTP GET request, which is application-layer data. The problem states that "Session layer encryption is used". This implies that the application data, including the HTTP request containing the URL, is encrypted. This is standard practice in protocols like HTTPS (HTTP over TLS/SSL). Since the URL is in the encrypted payload of the TCP segment, an intruder at R2 cannot read it. Therefore, the intruder cannot learn I1.4.[I4] The link layer addresses of Q and H: Link layer addresses (like MAC addresses) are used for addressing on a single physical link or network segment. The link layer frame is re-created at each hop (router).- The packet from Q to R1 has Q's MAC as source and R1's MAC as destination.
- The packet from R1 to R2 has R1's MAC as source and R2's MAC as destination.
- The packet from R2 to R3 has R2's MAC as source and R3's MAC as destination.
38
Q38MCQ2 marksMediumA graphical HTML browser resident at a network client machine accesses a static HTML webpage from a HTTP server . The static HTML page has exactly one static embedded image…Think it through. Then check your answer.Question
A graphical HTML browser resident at a network client machine accesses a static HTML webpage from a HTTP server . The static HTML page has exactly one static embedded image which is also at . Assuming no caching, which one of the following is correct about the HTML webpage loading (including the embedded image)?Correct answer
(B) Q needs to send at least 2 HTTP requests to S, but a single TCP connection to server S is sufficient
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To load the webpage, the browser first requests the HTML file. Upon parsing the HTML, it finds a reference to an embedded image and must send a second request to retrieve that image. Thus, at least 2 HTTP requests are needed.With HTTP/1.0, each request required a separate TCP connection (non-persistent). However, HTTP/1.1 introduced persistent connections, allowing multiple requests to be sent over a single TCP connection. Therefore, a single TCP connection is sufficient to handle both requests.Option (B) correctly states that at least 2 HTTP requests are needed but a single TCP connection is sufficient.39
Q39MCQ2 marksMediumConsider the following schedule of transactions T1, T2, T3, T4: | T1 | T2 | T3 | T4 | | :---: | :---: | :---: | :---: | | | Reads(X) | | | | | | Writes(X) | | | | |…Think it through. Then check your answer.Question
Consider the following schedule of transactions T1, T2, T3, T4:Which one of the following statements is CORRECT?T1 T2 T3 T4 Reads(X) Writes(X) Commit Writes(X) Commit Writes(Y) Reads(Z) Commit Reads(X) Reads(Y) Commit Correct answer
(C) S is both conflict-serializable and recoverable
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Conflict Serializability:
We analyze the conflicts:1. reads before writes :2. writes before writes :3. writes before reads :4. writes before reads :The precedence graph is . There are no cycles, so the schedule is conflict-serializable.Recoverability:
For a schedule to be recoverable, if transaction reads a value written by , then must commit before commits.1. reads written by . commits before reads . This is recoverable (and cascadeless).2. reads written by . commits before reads . This is recoverable (and cascadeless).Since all read dependencies satisfy the recoverability condition, the schedule is recoverable.Thus, is both conflict-serializable and recoverable.40
Q40MCQ2 marksMediumConsider a join (relation algebra) between relations and using the nested loop method. There are 3 buffers each of size equal to disk block size, out of which one…Think it through. Then check your answer.Question
Consider a join (relation algebra) between relations and using the nested loop method. There are 3 buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming , the join will have fewer number of disk block accesses ifCorrect answer
(A) relation r(R) is in the outer loop.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a Block Nested Loop Join with limited buffers (specifically 2 buffers for input relations: 1 for outer, 1 for inner), the cost in terms of disk block accesses is given by:where is the number of blocks in the outer relation and is the number of blocks in the inner relation.Let be the size of and be the size of .
If is outer:
If is outer: The term is common to both. The difference lies in the first term ( vs ).
Since , we have .
Therefore, .To minimize disk block accesses, the smaller relation should be in the outer loop.41
Q41MCQ2 marksMediumConsider the procedure below for the Producer-Consumer problem which uses semaphores: [code] Which one of the following is TRUE?Think it through. Then check your answer.Question
Consider the procedure below for the Producer-Consumer problem which uses semaphores:Which one of the following is TRUE?semaphore n = 0; semaphore s = 1; void producer() { while(true) { produce(); semWait(s); addToBuffer(); semSignal(s); semSignal(n); } } void consumer() { while(true) { semWait(s); semWait(n); removeFromBuffer(); semSignal(s); consume(); } }Correct answer
(C) Deadlock occurs if the consumer succeeds in acquiring semaphore s when the buffer is empty.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The code shows a classic deadlock scenario in the Producer-Consumer problem due to incorrect ordering of semaphore operations in the consumer.1.Initialization:n = 0(items in buffer),s = 1(mutex for buffer access).2.Scenario: Suppose the buffer is empty (n = 0) and the consumer is scheduled first.3.Consumer Execution:- Executes
semWait(s):sbecomes 0. Consumer acquires the lock on the buffer. - Executes
semWait(n): Sincenis 0, the consumer blocks (waits) for an item to be produced.
- The consumer is blocked inside the critical section (holding
s) waiting forn. - The producer needs to run to increment
n(viasemSignal(n)). - However, the producer first executes
semWait(s)to acquire the buffer lock. - Since
sis 0 (held by the consumer), the producer blocks. - Both processes are waiting for each other: Consumer waits for Producer to signal
n, Producer waits for Consumer to signals.
swhen the buffer is empty.- Executes
42
Q42NAT2 marksHardThree processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires CPU milliseconds and…Think it through. Then check your answer.Question
Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires CPU milliseconds and then initiates a single I/O operation that lasts for milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics:The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation is ___________.Process id A 100 ms 500 ms B 350 ms 500 ms C 200 ms 500 ms Correct answer
1000 to 1000
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We trace the execution using Round Robin scheduling with Time Slice () = 50 ms.Arrivals: A at 0, B at 5, C at 10.
CPU Bursts: A=100, B=350, C=200.
I/O Duration: 500 for all.Gantt Chart Trace:1.0 - 50: Process A runs (A arrives at 0). A remaining: . Queue at 50: B (arrived 5), C (arrived 10), A (preempted).2.50 - 100: Process B runs. B remaining: . Queue at 100: C, A, B.3.100 - 150: Process C runs. C remaining: . Queue at 150: A, B, C.4.150 - 200: Process A runs. A remaining: . A finishes CPU and starts I/O at 200. Queue at 200: B, C.5.200 - 250: Process B runs. B remaining: . Queue at 250: C, B.6.250 - 300: Process C runs. C remaining: . Queue at 300: B, C.7.300 - 350: Process B runs. B remaining: . Queue at 350: C, B.8.350 - 400: Process C runs. C remaining: . Queue at 400: B, C.9.400 - 450: Process B runs. B remaining: . Queue at 450: C, B.10.450 - 500: Process C runs. C remaining: . C finishes CPU and starts I/O at 500.Process C I/O:- Starts at ms.
- Duration ms.
- Completion time = ms.
43
Q43MCQ2 marksHardA computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the…Think it through. Then check your answer.Question
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?Correct answer
(D) Most-recently-used
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The access sequence is cyclic: .
Number of frames . Number of pages .Optimal Policy (OPT):- Pass 1: 100 faults (all cold misses). At the end of Pass 1, OPT will ensure the memory contains pages that are needed earliest in Pass 2. Since the sequence repeats 1..100, the pages needed earliest are 1, 2, ..., 19. OPT will keep 1..19 in memory and use the 20th frame to swap in 20, 21, ..., 100 one by one.
- Pass 2: Pages 1..19 are hits. Pages 20..100 are misses. Hits = 19.
- Pass 3: Same as Pass 2. Hits = 19.
- Total Hits = 38. Total Faults = .
- Pass 1: Loads 1..20. Frame 20 is the "Last In". When 21 comes, it replaces 20. When 22 comes, it replaces 21. This continues until 100 replaces 99. At the end of Pass 1, memory contains .
- Pass 2: Access 1..19 (Hits). Access 20 (Miss) -> replaces 100 (Last In). Access 21 (Miss) -> replaces 20. This continues. Memory effectively keeps 1..19 static and uses the last frame for the stream.
- Pass 3: Same as Pass 2. Hits = 19.
- Total Hits = 38. Total Faults = 262.
44
Q44MCQ2 marksMediumFor a C program accessingX[i][j][k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and the size of a character is 8…Think it through. Then check your answer.Question
For a C program accessingX[i][j][k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and the size of a character is 8 bits.Which one of the following statements about the source code for the C program is CORRECT?t0 = i * 1024 t1 = j * 32 t2 = k * 4 t3 = t1 + t0 t4 = t3 + t2 t5 = X[t4]Correct answer
(A) X is declared as “int X[32][32][8]”.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The address calculation for an element in a 3D array using row-major order is given by:From the provided intermediate code:1.2.3.4.5.6.If is an array ofint(wheresizeof(int)= 4 bytes), the byte offset is:Comparing this with :int X[N1][32][8]. Option (A) matches this structure.45
Q45MCQ2 marksMediumLet be the encoding of a Turing machine as a string over . Let…Think it through. Then check your answer.Question
Let be the encoding of a Turing machine as a string over . Let . Then, isCorrect answer
(B) undecidable but recursively enumerable
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Undecidability: According to Rice's Theorem, any non-trivial property of the language recognized by a Turing machine is undecidable. The property "accepts a string of length 2014" is non-trivial because there exist Turing machines that accept such strings and others that do not. Therefore, is undecidable.2.Recursively Enumerable (RE): A language is RE if there exists a Turing machine that accepts every string in the language and either rejects or loops for strings not in the language. We can construct a TM for that, given , simulates on all strings of length 2014 (there are finitely many: ) in a dovetailing manner. If accepts any of these strings, the simulator accepts . Thus, is recursively enumerable.46
Q46MCQ2 marksHardLet . Let…Think it through. Then check your answer.Question
Let . Let . Which one of the following is TRUE?Correct answer
(A) L₁ is regular but not L₂
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.For : In any binary string, the number of occurrences of the pattern '110' and '011' can differ by at most 1. This is because '110' represents a transition from a block of 1s (length ) to a 0, and '011' represents a transition from a 0 to a block of 1s (length ). Since we can only alternate between these transitions, the counts are always balanced within a difference of 1. This property can be tracked with a finite state machine, making regular.2.For : requires comparing the total count of '000' substrings with '111' substrings. Since these counts can be arbitrarily large and are not structurally constrained to be nearly equal (unlike ), a machine would need infinite memory (a stack or more) to keep track of the counts. Thus, is not regular.47
Q47NAT2 marksHardConsider two strings and . Let be the length of the longest common subsequence (not necessarily contiguous) between and and let be the…Think it through. Then check your answer.Question
Consider two strings and . Let be the length of the longest common subsequence (not necessarily contiguous) between and and let be the number of such longest common subsequences between and . Then ______.Correct answer
34 to 34
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the Longest Common Subsequence (LCS) of and , we can compute the length and then identify the distinct sequences.Step 1: Find the length
Let's determine the LCS length using dynamic programming or inspection.
: length 5
: length 7Common subsequences of length 4:1.qpqr: Present in at indices 1,2,3,4. Present in at indices 2,3,5,6.2.qprr: Present in at indices 1,2,4,5. Present in at indices 2,3,4,6.3.pqrr: Present in at indices 2,3,4,5. Present in at indices 1,2,4,6.Can we find length 5? is "qpqrr". Is "qpqrr" a subsequence of ? has only one 'p' after the first 'q' (at index 3) and then 'r', 'q', 'r', 'p'. It does not contain "qpqrr". Thus, max length is 4.
So, .Step 2: Find the number of distinct LCSs
We identified 3 distinct strings of length 4: "qpqr", "qprr", "pqrr".
Let's check if there are any others. The subsequences of of length 4 are:- Drop 1st char (q): "pqrr" (Valid in B)
- Drop 2nd char (p): "qqrr" (In B? has q at 2, 5. r at 4, 6. After q(5), only r(6) exists. Cannot form "qqrr". Invalid)
- Drop 3rd char (q): "qprr" (Valid in B)
- Drop 4th char (r): "qpqr" (Valid in B)
- Drop 5th char (r): "qpqr" (Duplicate)
So, .Step 3: Calculate result
.48
Q48NAT2 marksMediumSuppose P, Q, R, S, T are sorted sequences having lengths 20, 24, 30, 35, 50 respectively. They are to be merged into a single sequence by merging together two sequences at a…Think it through. Then check your answer.Question
Suppose P, Q, R, S, T are sorted sequences having lengths 20, 24, 30, 35, 50 respectively. They are to be merged into a single sequence by merging together two sequences at a time. The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is ____.Correct answer
358 to 358
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
This problem asks for the number of comparisons in the worst case using the optimal merge pattern (Huffman coding strategy). Merging two sorted lists of size and requires at most comparisons in the worst case.Sorted lengths: 20, 24, 30, 35, 50Step 1: Merge the two smallest sequences (20 and 24).- Size of new sequence:
- Comparisons:
- Current list of lengths: 30, 35, 44, 50
- Size of new sequence:
- Comparisons:
- Current list of lengths: 44, 50, 65
- Size of new sequence:
- Comparisons:
- Current list of lengths: 65, 94
- Size of new sequence:
- Comparisons:
.49
Q49NAT2 marksMediumConsider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possible choices of the values at the leaves, the maximum possible…Think it through. Then check your answer.Question
Consider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possible choices of the values at the leaves, the maximum possible value of the expression represented by the tree is ___.
Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the values at the leaves be denoted by variables. Let's trace the operations from the bottom up or expand the expression from the root down.Let the leaves from left to right be .The structure of the tree is:- Root is .
- Left child of Root is . Right child of Root is .
- Left child () has children: Left () and Right ().
- The Left () has children . Value: .
- The Right () has children . Value: .
- So, Left Subtree Value = .
- Right child () has children: Left () and Right ().
- The Left () has children . Value: .
- The Right () has children . Value: .
- So, Right Subtree Value = .
- Root Value = Left Subtree Value + Right Subtree Value
To maximize this expression, we should assign to variables with a positive coefficient and to variables with a negative coefficient.Positive coefficients: (Total 6 variables).
Negative coefficients: (Total 2 variables).Set and .Maximum Value .50
Q50NAT2 marksMediumConsider the following function [code] Give a value q (to 2 decimals) such that f(q) will return q:_____.Think it through. Then check your answer.Question
Consider the following functionGive a value q (to 2 decimals) such that f(q) will return q:_____.double f(double x){ if( abs(x*x - 3) < 0.01) return x; else return f(x/2 + 1.5/x); }Correct answer
1.72 to 1.74
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionfimplements the Newton-Raphson method for finding the square root of 3. The recurrence relation is derived from , where .The function returnsx(the input valueq) if the conditionabs(x*x - 3) < 0.01is satisfied immediately. This means must be a value close enough to such that .Any value in this range will cause the function to returnqimmediately. The value of .51
Q51MCQ2 marksMediumSuppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the…Think it through. Then check your answer.Question
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?Correct answer
(C) A queue can be implemented where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A queue (FIFO) can be implemented using a stack (LIFO) with the REVERSE operation as follows:To maintain the queue order such that the front of the queue is always at the top of the stack (allowing Dequeue):ENQUEUE(x):1.REVERSE (Reverses stack so the rear is at the top)2.PUSH(x) (Adds new element to the rear)3.REVERSE (Reverses stack back so the front is at the top)Total: 3 instructions.DEQUEUE():1.POP (Removes the front element from the top)Total: 1 instruction.Thus, option (C) is correct.52
Q52MCQ2 marksMediumConsider the C function given below. [code] Which one of the following is TRUE?Think it through. Then check your answer.Question
Consider the C function given below.Which one of the following is TRUE?int f(int j) { static int i = 50; int k; if (i == j) { printf("something"); k = f(i); return 0; } else return 0; }Correct answer
(D) The function will exhaust the runtime stack or run into an infinite loop when j = 50.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The variableiis declared asstatic int i = 50;, so it is initialized only once and retains its value across function calls.Whenf(50)is called (j = 50):1.The conditionif (i == j)(i.e.,50 == 50) is true.2.It prints "something".3.It callsInside the recursive callk = f(i), which isf(50).f(50):1.iis still 50 (static).2.jis 50 (passed argument).3.The conditionif (i == j)is true again.4.It callsThis leads to infinite recursion, which will eventually exhaust the runtime stack (Stack Overflow).f(50)again.53
Q53MCQ2 marksMediumIn designing a computer’s cache system, the cache block (or cache line) size is an important parameter. Which one of the following statements is correct in this context?Think it through. Then check your answer.Question
In designing a computer’s cache system, the cache block (or cache line) size is an important parameter. Which one of the following statements is correct in this context?Correct answer
(D) A smaller block size incurs a lower cache miss penalty
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The cache miss penalty is the time required to fetch a block from the lower level of memory. It consists of latency (access time) and transfer time. A smaller block size reduces the amount of data to be transferred, thereby reducing the transfer time and the overall miss penalty. (A) is incorrect because larger blocks capture more spatial locality.
(B) is incorrect because smaller blocks mean more lines for the same cache size, increasing the total tag overhead.
(C) is incorrect because larger tag structures typically do not decrease hit time.54
Q54MCQ2 marksMediumIf the associativity of a processor cache is doubled while keeping the capacity and block size unchanged, which one of the following is guaranteed to be NOT affected?Think it through. Then check your answer.Question
If the associativity of a processor cache is doubled while keeping the capacity and block size unchanged, which one of the following is guaranteed to be NOT affected?Correct answer
(D) Width of processor to main memory data bus
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let Cache Capacity , Block Size , Associativity .
Number of sets .If is doubled to :1.Number of sets becomes . The set index bits decrease by 1. This affects the set index decoder (B).2.Tag bits = Address bits - Index bits - Offset bits. Since index bits decrease, tag bits increase. This affects the tag comparator width (A).3.The way selection multiplexor selects one of blocks. If doubles, the multiplexor size/width changes (C).4.The width of the processor to main memory data bus is an architectural property of the memory system and bus interface, independent of the internal cache organization (associativity). Thus, it is not affected.55
Q55MCQ2 marksMediumThe value of a float type variable is represented using the single-precision 32-bit floating point format of IEEE-754 standard that uses 1 bit for sign, 8 bits for biased…Think it through. Then check your answer.Question
The value of a float type variable is represented using the single-precision 32-bit floating point format of IEEE-754 standard that uses 1 bit for sign, 8 bits for biased exponent and 23 bits for mantissa. A float type variable is assigned the decimal value of . The representation of in hexadecimal notation isCorrect answer
(A) C1640000H
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Value:1.Sign bit: Negative, so .2.Binary representation:
3.Normalization:4.Exponent: Actual exponent is . Bias is .Stored Exponent5.Mantissa: (23 bits, dropping the implicit leading 1)32-bit Representation:
Sign | Exponent | Mantissa
1 | 10000010 | 11001000000000000000000Grouping into Hex:
1100 | 0001 | 0110 | 0100 | 0000 | 0000 | 0000 | 0000
C | 1 | 6 | 4 | 0 | 0 | 0 | 0Result: C1640000H56
Q56MCQ2 marksMediumIn the Newton-Raphson method, an initial guess of is made and the sequence is obtained for the function Consider…Think it through. Then check your answer.Question
In the Newton-Raphson method, an initial guess of is made and the sequence is obtained for the functionConsider the statements
(I) .
(II) The method converges to a solution in a finite number of iterations.Which of the following is TRUE?Correct answer
(A) Only I
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given function:
Derivative: Newton-Raphson formula: Iteration 1:
Iteration 2:
Iteration 3:
Since , the sequence will oscillate:
Thus, .Statement (I) is TRUE because .
Statement (II) is FALSE because the sequence oscillates between 0 and 2 and does not converge.Therefore, Only I is true.57
Q57NAT2 marksMediumThe product of the non-zero eigenvalues of the matrix…Think it through. Then check your answer.Question
The product of the non-zero eigenvalues of the matrixis ______.Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the matrix be . We need to find the non-zero eigenvalues.Observe the structure of :
Rows 2, 3, and 4 are identical. This implies the rank of the inner block is 1. The vector is an eigenvector:
.Rows 1 and 5 are identical. The vector is an eigenvector:
.The rank of the matrix is 2 (since rows 2,3,4 are dependent and rows 1,5 are dependent, and row 1 is independent of row 2). Thus, there are only 2 non-zero eigenvalues.The non-zero eigenvalues are 3 and 2.
Product = .58
Q58NAT2 marksMediumThe probability that a given positive integer lying between 1 and 100 (both inclusive) is NOT divisible by 2, 3 or 5 is ______ .Think it through. Then check your answer.Question
The probability that a given positive integer lying between 1 and 100 (both inclusive) is NOT divisible by 2, 3 or 5 is ______ .Correct answer
0.259 to 0.261
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let . Total numbers .
Let be the sets of numbers divisible by 2, 3, and 5 respectively.
Using the Principle of Inclusion-Exclusion, the number of integers divisible by 2, 3, or 5 is:
The number of integers NOT divisible by 2, 3, or 5 is .Probability = .59
Q59NAT2 marksEasyThe number of distinct positive integral factors of 2014 is _________________________Think it through. Then check your answer.Question
The number of distinct positive integral factors of 2014 is _________________________Correct answer
8 to 8
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of distinct positive integral factors, we first find the prime factorization of 2014. is even, so divide by 2:
Now we check 1007. It is not divisible by 3 (sum of digits is 8), not ending in 5.
Try dividing by 7: (No)
Try dividing by 11: (No)
Try dividing by 13: (No)
Try dividing by 17: (No)
Try dividing by 19: . (Yes)Both 19 and 53 are prime numbers.
So, the prime factorization is:
The number of factors is given by the product of one more than the exponents of the prime factors:
Number of factors .60
Q60MCQ2 marksHardConsider the following relation on subsets of the set of integers between 1 and 2014. For two distinct subsets and of we say if the minimum element in the…Think it through. Then check your answer.Question
Consider the following relation on subsets of the set of integers between 1 and 2014. For two distinct subsets and of we say if the minimum element in the symmetric difference of the two sets is in .Consider the following two statements:
: There is a subset of that is larger than every other subset.
: There is a subset of that is smaller than every other subset.Which one of the following is CORRECT?Correct answer
(A) Both S1 and S2 are true
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The relation defined is a strict total order on the power set of . Let denote the symmetric difference . The condition is if .Analyzing Statement S1 (Largest Element):
Consider the empty set . For any non-empty set , the symmetric difference . The minimum element is , which is clearly in . Therefore, by the definition, for all . Thus, is the largest element. is true.Analyzing Statement S2 (Smallest Element):
Consider the set itself. For any proper subset , the symmetric difference . The minimum element of is an element of . Therefore, , which implies for all . Thus, is the smallest element. is true.Since both statements are true, option (A) is correct.61
Q61NAT2 marksMediumA cycle on vertices is isomorphic to its complement. The value of is _____.Think it through. Then check your answer.Question
A cycle on vertices is isomorphic to its complement. The value of 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
A cycle graph has vertices and edges. For a graph to be isomorphic to its complement (self-complementary), it must have exactly half the number of edges of a complete graph on the same number of vertices.1.The number of edges in a complete graph is given by .2.For a graph to be self-complementary, its number of edges must satisfy .3.For a cycle graph , the number of edges is .4.Equating the two:Since a cycle must have at least 3 vertices (), the only valid solution is .62
Q62NAT2 marksMediumThe number of distinct minimum spanning trees for the weighted graph below is ______ [figure]Think it through. Then check your answer.Question
The number of distinct minimum spanning trees for the weighted graph below is ______
Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of distinct Minimum Spanning Trees (MSTs), we analyze the edges by weight:1.Edges with weight 1: There are 3 edges with weight 1. These edges do not form a cycle among themselves. According to the properties of MSTs, if the edges of a certain weight do not form a cycle, they must all be included in every MST (assuming the graph is connected and we are building the tree from minimum weights up). So, all 3 edges of weight 1 are included.2.Edges with weight 2: The graph has 5 vertices (Top, Middle-Left, Middle-Right, Bottom-Left, Bottom-Right). An MST must have edges. Since we have already selected 3 edges of weight 1, we need exactly more edge. This edge must be of weight 2.3.Selection: We must choose 1 edge from the available edges of weight 2 such that it does not form a cycle with the already selected weight 1 edges. By inspecting the graph (or using the Matrix Tree Theorem on the contracted graph), it turns out there are exactly 6 valid choices for this final edge that connect the components without creating a cycle.Thus, there are 6 distinct Minimum Spanning Trees.63
Q63MCQ2 marksMediumWhich one of the following Boolean expressions is NOT a tautology?Think it through. Then check your answer.Question
Which one of the following Boolean expressions is NOT a tautology?Correct answer
(B) (a rightarrow c) → (b → (a ∧ c))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We check each option:(A) is the Law of Syllogism (Transitivity of Implication). It is a tautology.(B)
Let .
Then is True.
is True.
is False.
So, isT → F, which is False.
The entire expression becomesT → F, which is False.
Since there is a case where it is False, it is NOT a tautology.(C)
If LHS is True, then are all True. Then RHS is True.T → Tis True. If LHS is False, the implication is True. Thus, it is a tautology.(D) . It is a tautology.64
Q64MCQ2 marksMediumSQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same…Think it through. Then check your answer.Question
SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below:select * from R where a in (select S.a from S)Correct answer
(C) [code]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The original query selects all tuples from where the attribute exists in the relation . TheINclause does not cause duplication of rows from even if contains duplicates of . It simply checks for existence.(A)select R.* from R, S where R.a=S.a
This is a standard join. If has multiple rows with the same value, the result will contain multiple copies of the corresponding row from . This changes the multiplicity of the result compared to the original query.(B)select distinct R.* from R,S where R.a=S.a
This removes duplicates from the result. However, the original relation might contain duplicate rows that satisfy the condition. The original query preserves duplicates present in , whereasDISTINCTwould remove them. Thus, this is not equivalent.(C)select R.* from R, (select distinct a from S) as S1 where R.a=S1.a
Here, the subqueryS1contains only unique values of from . Joining withS1ensures that each row in matches at most one row inS1. Therefore, rows in are not duplicated by the join, but existing duplicates in are preserved (since they each match the single corresponding entry inS1). This is equivalent to theINclause behavior.(D) Syntax is invalid/non-standard.65
Q65NAT2 marksHardConsider a main memory system that consists of 8 memory modules attached to the system bus, which is one word wide. When a write request is made, the bus is occupied for 100…Think it through. Then check your answer.Question
Consider a main memory system that consists of 8 memory modules attached to the system bus, which is one word wide. When a write request is made, the bus is occupied for 100 nanoseconds (ns) by the data, address, and control signals. During the same 100 ns, and for 500 ns thereafter, the addressed memory module executes one cycle accepting and storing the data. The (internal) operation of different memory modules may overlap in time, but only one request can be on the bus at any time. The maximum number of stores (of one word each) that can be initiated in 1 millisecond is ____________Correct answer
10000 to 10000
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the maximum number of stores that can be initiated, we need to determine the bottleneck of the system: either the bus speed or the memory module availability.Given:- Bus occupation time per request () = 100 ns.
- Memory module cycle time () = 100 ns (bus) + 500 ns (internal) = 600 ns.
- Number of memory modules () = 8.
- Total time available () = 1 ms = ns.
The bus is occupied for 100 ns for every store. Since only one request can be on the bus at a time, the minimum time between initiating two consecutive stores is 100 ns.
Max stores limited by bus = .2. Memory Limit:
Each memory module is busy for 600 ns. With 8 modules, we can ideally start a new operation on a different module every ns without conflict (assuming sequential access to different modules).
Since the bus limit (100 ns) is slower than the memory limit (75 ns), the bus is the bottleneck.Verification of Interleaving:- Store 1 initiates at on Module 1. Bus free at 100. Module 1 free at 600.
- Store 2 initiates at on Module 2. Bus free at 200. Module 2 free at 700.
- ...
- Store 8 initiates at on Module 8. Bus free at 800. Module 8 free at 1300.
- Store 9 initiates at . We need a free module. Module 1 became free at 600, so it is available.