The PYQ practice room
GATE CS 2015 Set 3
All 65 solved GATE CS 2015 Set 3 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 markEasyExtreme focus on syllabus and studying for tests has become such a dominant concern of Indian students that they close their minds to anything ___________ to the requirements of…Think it through. Then check your answer.Question
Extreme focus on syllabus and studying for tests has become such a dominant concern of Indian students that they close their minds to anything ___________ to the requirements of the exam.Correct answer
(B) extraneous
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence suggests that students are so narrowly focused on the syllabus that they ignore anything not directly part of it. "Extraneous" means irrelevant or unrelated to the subject being dealt with, which fits the context of closing one's mind to things outside the core requirements.(A) related - This would mean they close their minds to things that are part of the exam, which is the opposite of the intended meaning.
(C) outside - While similar in meaning, "extraneous" is the more precise academic term for irrelevant information in this context.
(D) useful - This would imply they ignore helpful things, but the focus is specifically on the relationship to the exam requirements.2
Q2MCQ1 markEasySelect the pair that best expresses a relationship similar to that expressed in the pair: Children : PediatricianThink it through. Then check your answer.Question
Select the pair that best expresses a relationship similar to that expressed in the pair:Children : PediatricianCorrect answer
(B) Females: Gynaecologist
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The relationship in the given pair is Demographic Group : Specialist Doctor. A Pediatrician is a doctor who specializes in the medical care of children.(A) Adult : Orthopaedist - Incorrect. Orthopaedists treat bones and muscles in patients of all ages, not specifically adults.
(B) Females : Gynaecologist - Correct. A Gynaecologist is a doctor who specializes in the health of the female reproductive system.
(C) Kidney : Nephrologist - Incorrect. This is an Organ : Specialist relationship, not a demographic group.
(D) Skin : Dermatologist - Incorrect. This is also an Organ : Specialist relationship.3
Q3MCQ1 markEasyThe Tamil version of _________ John Abraham-starrer Madras Cafe _______ cleared by the Censor Board with no cuts last week, but the film's distributors _________ no…Think it through. Then check your answer.Question
The Tamil version of _________ John Abraham-starrer Madras Cafe _______ cleared by the Censor Board with no cuts last week, but the film's distributors _______ no takers among the exhibitors for a release in Tamil Nadu _________ this Friday.Correct answer
(C) the, was, found, on
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The correct words to fill the blanks are determined by grammar and context:1."The Tamil version of the John Abraham-starrer..." - The definite article 'the' is used because it refers to a specific movie.2."...**was** cleared by the Censor Board..." - This is the passive voice in the past tense, indicating the action was completed.3."...distributors found no takers..." - The past tense 'found' is required to match the timeline of the sentence (last week).4."...**on** this Friday." - 'On' is the standard preposition used for specific days of the week.Therefore, option (C) is the only grammatically correct choice.4
Q4MCQ1 markEasyIf ROAD is written as URDG, then SWAN should be written as:Think it through. Then check your answer.Question
If ROAD is written as URDG, then SWAN should be written as:Correct answer
(B) VZDQ
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The pattern in the given coding is to add 3 to the alphabetical position of each letter:For ROAD to URDG:- R (18) + 3 = U (21)
- O (15) + 3 = R (18)
- A (1) + 3 = D (4)
- D (4) + 3 = G (7)
- S (19) + 3 = V (22)
- W (23) + 3 = Z (26)
- A (1) + 3 = D (4)
- N (14) + 3 = Q (17)
5
Q5MCQ1 markEasyA function is linear and has a value of 29 at and 39 at . Find its value at .Think it through. Then check your answer.Question
A function is linear and has a value of 29 at and 39 at . Find its value at .Correct answer
(C) 43
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A linear function can be represented in the form , where is the slope and is the y-intercept.Given two points:1.When , . So, (Equation 1)2.When , . So, (Equation 2)Subtract Equation 1 from Equation 2:
Substitute the value of into Equation 1:
So, the linear function is .Now, find the value of the function at :
The correct option is (C).6
Q6MCQ2 marksMediumAlexander turned his attention towards India, since he had conquered Persia. Which one of the statements below is logically valid and can be inferred from the above sentence?Think it through. Then check your answer.Question
Alexander turned his attention towards India, since he had conquered Persia.Which one of the statements below is logically valid and can be inferred from the above sentence?Correct answer
(A) Alexander would not have turned his attention towards India had he not conquered Persia.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let P be the statement "Alexander had conquered Persia."
Let I be the statement "Alexander turned his attention towards India."The given sentence is "Alexander turned his attention towards India, since he had conquered Persia." This implies that conquering Persia was the reason or a necessary condition for Alexander to turn his attention towards India. In logical terms, this can be interpreted as: If Alexander turned his attention towards India, then he must have conquered Persia. So,I → P.Now let's analyze the options:(A) "Alexander would not have turned his attention towards India had he not conquered Persia." This statement can be written as . This is the contrapositive ofI → P. Since the contrapositive of a conditional statement is logically equivalent to the original statement, ifI → Pis true, then is also true. This is a valid inference based on the interpretation of "since" implying a necessary condition.(B) "Alexander was not ready to rest on his laurels, and wanted to march to India." This statement describes Alexander's motivation or state of mind, which cannot be directly inferred from the given sentence. The sentence only states a causal link between two events.(C) "Alexander was completely in control of his army and could command it to move towards India." This statement makes an assumption about Alexander's control over his army, which is not mentioned or implied in the original sentence.(D) "Since Alexander's kingdom extended to Indian borders after the conquest of Persia, he was keen to move further." This statement introduces new information (kingdom extended to Indian borders) and an interpretation of his keenness, neither of which is directly inferable from the original sentence.Therefore, option (A) is the only logically valid inference.The final answer is7
Q7MCQ2 marksEasyMost experts feel that in spite of possessing all the technical skills required to be a batsman of the highest order, he is unlikely to be so due to lack of requisite temperament.…Think it through. Then check your answer.Question
Most experts feel that in spite of possessing all the technical skills required to be a batsman of the highest order, he is unlikely to be so due to lack of requisite temperament. He was guilty of throwing away his wicket several times after working hard to lay a strong foundation. His critics pointed out that until he addressed this problem, success at the highest level will continue to elude him.Which of the statement(s) below is/are logically valid and can be inferred from the above passage?(i) He was already a successful batsman at the highest level.
(ii) He has to improve his temperament in order to become a great batsman.
(iii) He failed to make many of his good starts count.
(iv) Improving his technical skills will guarantee success.Correct answer
(B) (ii) and (iii)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The passage states that the batsman lacks the requisite temperament despite having technical skills, which implies he needs to improve his temperament (supporting statement ii). It also mentions he threw away his wicket after laying a strong foundation, meaning he failed to convert good starts (supporting statement iii). Statement (i) is incorrect because success eludes him. Statement (iv) is incorrect because he already possesses technical skills; temperament is the issue. Thus, (ii) and (iii) are valid.8
Q8NAT2 marksMediumThe exports and imports (in crores of Rs.) of a country from the year 2000 to 2007 are given in the following bar chart. In which year is the combined percentage increase in…Think it through. Then check your answer.Question
The exports and imports (in crores of Rs.) of a country from the year 2000 to 2007 are given in the following bar chart. In which year is the combined percentage increase in imports and exports the highest?
Correct answer
2006 to 2006
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the total (Exports + Imports) for each year and find the percentage increase from the previous year.2000:
2001: . Increase =
2002: . Increase =
2003: . Increase =
2004: . Increase =
2005: . Increase =
2006: . Increase =
2007: . Increase = The highest percentage increase is in 2006.9
Q9MCQ2 marksMediumChoose the most appropriate equation for the function drawn as a thick line, in the plot below. [figure]Think it through. Then check your answer.Question
Choose the most appropriate equation for the function drawn as a thick line, in the plot below.
Correct answer
(B) x = -(y - y)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The plot shows a graph that lies in the 4th quadrant (positive x, negative y) and possibly the positive y-axis. The curve passes through the point as indicated by the dashed lines.Let's test the point in the options:
(A)
(B) . This matches.
(C)
(D) Only option (B) is consistent with the point . The function simplifies to for (positive y-axis) and for (line in 4th quadrant), which matches the visual representation.10
Q10MCQ2 marksMediumThe head of a newly formed government desires to appoint five of the six selected members P, Q, R, S, T, and U to portfolios of Home, Power, Defense, Telecom, and Finance. U does…Think it through. Then check your answer.Question
The head of a newly formed government desires to appoint five of the six selected members P, Q, R, S, T, and U to portfolios of Home, Power, Defense, Telecom, and Finance. U does not want any portfolio if S gets one of the five. R wants either Home or Finance or no portfolio. Q says that if S gets either Power or Telecom, then she must get the other one. T insists on a portfolio if P gets one.
Which is the valid distribution of portfolios?Correct answer
(B) (B) R-Home, S-Power, P-Defense, Q-Telecom, T-Finance
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
There are 6 members (P, Q, R, S, T, U) and 5 portfolios (Home, Power, Defense, Telecom, Finance). This means one member will not be assigned a portfolio.Let's analyze the constraints:1.U does not want any portfolio if S gets one: This implies if S is assigned a portfolio, U is the one left out. If S is not assigned, S is the one left out.2.R wants either Home or Finance or no portfolio: R can get Home, Finance, or be unassigned.3.Q says that if S gets either Power or Telecom, then she must get the other one: This means S and Q must be assigned the Power and Telecom portfolios, one each.4.T insists on a portfolio if P gets one: If P is assigned, T must also be assigned.From constraint 3, S must be assigned a portfolio (either Power or Telecom). Therefore, from constraint 1, U must be the member who does not get a portfolio.So, the five members assigned portfolios are P, Q, R, S, T.Now let's re-evaluate the constraints with U being unassigned:- Members assigned: P, Q, R, S, T.
- Constraint 2: R must get Home or Finance (since R is assigned).
- Constraint 3: S and Q get Power and Telecom (one each).
- Constraint 4: Since P is assigned, T must also be assigned (which is consistent).
- R gets Defense. This violates constraint 2 (R must get Home or Finance). So (A) is incorrect.
- U is unassigned (consistent).
- R gets Home (consistent with constraint 2).
- S gets Power, Q gets Telecom (consistent with constraint 3).
- P gets Defense, T gets Finance. Both P and T are assigned (consistent with constraint 4).
- All constraints are satisfied. So (B) is correct.
- U gets Finance. This violates our deduction that U is unassigned. So (C) is incorrect.
- U gets Power. This violates our deduction that U is unassigned. So (D) is incorrect.
Computer Science and Information Technology
5511
Q11MCQ1 markEasyConsider the following C program segment. [code] What will be printed by the program?Think it through. Then check your answer.Question
Consider the following C program segment.#include <stdio.h> int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); return 0; }
What will be printed by the program?Correct answer
(C) (C) 1204
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the execution of the C program:1.char s1[7] = "1234";- An array
s1of 7 characters is declared and initialized with the string "1234". - In memory,
s1will be{'1', '2', '3', '4', '\0', ?, ?}. The\0is the null terminator automatically added after "1234". The last two elements are uninitialized. - The indices are
s1[0] = '1',s1[1] = '2',s1[2] = '3',s1[3] = '4',s1[4] = '\0'.
char *p;- A character pointer
pis declared.
p = s1 + 2;- The pointer
pis made to point to the memory location ofs1[2]. So,pnow points to the character'3'.
*p = '0';- The character at the memory location pointed to by
pis changed to'0'. Sinceppoints tos1[2],s1[2]is updated from'3'to'0'. - The
s1array now looks like:{'1', '2', '0', '4', '\0', ?, ?}.
printf("%s", s1);- This statement prints the string starting from the address of
s1until a null terminator (\0) is encountered. - It will print
s1[0],s1[1],s1[2],s1[3], and then stop becauses1[4]is\0. - The characters printed will be
'1','2','0','4'.
- An array
12
Q12MCQ1 markMediumSuppose is the power set of the set . For any , let denote the number of elements in and denote the complement of . For any…Think it through. Then check your answer.Question
Suppose is the power set of the set . For any , let denote the number of elements in and denote the complement of . For any , let be the set of all elements in which are not in . Which one of the following is true?Correct answer
(D) (D) ∀ X ∈ U ∀ Y ∈ U (X Y = Y' X')
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given: , so . is the power set of . is the complement of with respect to , so . means elements in but not in .Let's evaluate each option:(A)- This statement claims that for every set in the power set , its cardinality is equal to the cardinality of its complement.
- If , then , which implies , so .
- This statement would only be true if every set had exactly 3 elements. This is false. For example, if , then and . Clearly, .
- Therefore, statement (A) is false.
- This statement claims there exist two sets in such that both have 5 elements and they are disjoint.
- If and , and , then the union of and would have elements.
- However, and are subsets of , so must also be a subset of . This means .
- Since is false, it is impossible for two disjoint sets to each have 5 elements from a universal set of 6 elements.
- Therefore, statement (B) is false.
- This statement claims that for any sets in such that and , it must be that .
- means that all elements of are also in , i.e., .
- So the statement claims: for all with and , it must be that .
- This is false. Consider . Let and . Here, and . However, is not a subset of , so .
- Therefore, statement (C) is false.
- Let's analyze the left side: is the set of elements in that are not in . This can be written as .
- Let's analyze the right side: is the set of elements in that are not in . This can be written as .
- By the double complement rule, .
- So, .
- Since set intersection is commutative, .
- Thus, and . Both sides are equal.
- This is a fundamental set identity (also known as the definition of set difference in terms of intersection and complement, applied to both sides).
- Therefore, statement (D) is true.
13
Q13MCQ1 markEasyConsider the relationX(P, Q, R, S, T, U)with the following set of functional dependencies F = {,}
Which of the following is…Think it through. Then check your answer.Question
Consider the relationX(P, Q, R, S, T, U)with the following set of functional dependencies
F = {,}
Which of the following is the trivial functional dependency in , where is closure of ?Correct answer
(C) \P, S\ → \S\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A functional dependencyX → Yis called trivial if .Checking the options:
(A) (Non-trivial)
(B) (Non-trivial)
(C) (Trivial)
(D) (Non-trivial)Since trivial dependencies are always valid and included in the closure , option (C) is the correct answer.14
Q14MCQ1 markEasyThe maximum number of processes that can be in Ready state for a computer system with CPUs isThink it through. Then check your answer.Question
The maximum number of processes that can be in Ready state for a computer system with CPUs isCorrect answer
(D) Independent of n
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Ready state contains processes that are prepared to execute when given the opportunity. The number of processes in the Ready state is determined by the number of jobs submitted to the system and the available memory, not by the number of CPUs.The number of processes in the Running state is limited by the number of CPUs (), but the Ready queue can hold any number of processes (independent of ).15
Q15MCQ1 markEasyAmong simple LR (SLR) , canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most…Think it through. Then check your answer.Question
Among simple LR (SLR) , canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful , in that order?Correct answer
(C) SLR, canonical LR
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.SLR (Simple LR): Is the simplest to implement as it uses the LR(0) items and simple follow sets for reduction lookaheads. It has the smallest parsing table size (same as LR(0)) but is the least powerful of the three.2.Canonical LR (CLR): Is the most powerful method as it uses LR(1) items with specific lookaheads. However, it generates a very large number of states, making it difficult to implement due to table size.3.LALR (Look-Ahead LR): Is an intermediate method that merges states from CLR to reduce table size (same size as SLR) but is more powerful than SLR.Therefore, the easiest to implement is SLR and the most powerful is canonical LR.16
Q16MCQ1 markEasyLet # be a binary operator defined as where X and Y are Boolean variables. Consider the following two statements. (S1) (S2)…Think it through. Then check your answer.Question
Let # be a binary operator defined aswhere X and Y are Boolean variables.Consider the following two statements.(S1)
(S2)
Which of the following is/are true for the Boolean variables P, Q and R?Correct answer
(B) Only S2 is true
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The binary operator # is defined as .
Using De Morgan's laws, we can write this as . This is the NAND operation.Statement (S2): Commutativity
We need to check if the operator # is commutative, i.e., if .LHS = .
RHS = .Since Boolean OR (+) is a commutative operation, .
Therefore, the operator # is commutative.
Statement (S2) is true.Statement (S1): Associativity
We need to check if the operator # is associative, i.e., if .LHS =
Using De Morgan's law on , we get .
So, LHS = .RHS =
Using De Morgan's law on , we get .
So, RHS = .Now we check if for all P, Q, R.
Let's test with a counter-example. Let P=1, Q=1, R=0.
LHS = .
RHS = .
Since LHS RHS, the equality does not hold in general. The operator # is not associative.
Statement (S1) is false.Since only statement (S2) is true, the correct option is (B).17
Q17NAT1 markMediumConsider a software project with the following information domain characteristics for calculation of function point metric. Number of external inputs (I) = 30 Number of external…Think it through. Then check your answer.Question
Consider a software project with the following information domain characteristics for calculation of function point metric.Number of external inputs (I) = 30
Number of external outputs (O) = 60
Number of external inquiries (E) = 23
Number of files (F) = 08
Number of external interfaces (N) = 02It is given that the complexity weighting factors for I, O, E, F and N are 4, 5, 4, 10 and 7, respectively. It is also given that, out of fourteen value adjustment factors that influence the development effort, four factors are not applicable, each of the other four factors have value 3, and each of the remaining factors have value 4. The computed value of function point metric is _______.Correct answer
612 to 613
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Calculate Unadjusted Function Points (UFP):UFP =
UFP = .2.Calculate Total Degree of Influence (TDI):There are 14 factors in total.- 4 factors are not applicable (value = 0).
- 4 factors have value 3.
- Remaining factors () have value 4.
3.Calculate Function Point (FP):FP =
FP = .The computed value is approximately 612.18
Q18MCQ1 markMediumIn a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/var.html; where, is a different number from 1 to 10 for each Webpage. Suppose, the…Think it through. Then check your answer.Question
In a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/var.html; where, is a different number from 1 to 10 for each Webpage. Suppose, the client stores the Webpage with (say W1) in local machine, edits and then tests. Rest of the WebPages remains on the web server. W1 contains several relative URLs of the form “var.html” referring to the other WebPages. Which one of the following statements needs to be added in W1, so that all the relative URLs in W1 refer to the appropriate WebPages on the web server?Correct answer
(B) <base href: “http://www.yourname.com/”
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When a webpage is saved locally, relative URLs (like "2.html") resolve relative to the local file path (e.g.,file:///C:/Users/.../2.html). To make them resolve to the original web server location, the<base>tag must be used in the HTML head.The<base>tag specifies the base URL for all relative URLs in a document. By adding<base href="http://www.yourname.com/">, a relative link like "2.html" will be interpreted as "http://www.yourname.com/2.html", which correctly points to the server.Option (B) represents this tag (despite the non-standard colon syntax used in the question options, it is the only semantically correct choice for setting a base URL).19
Q19MCQ1 markMediumConsider the following statements. I. TCP connections are full duplex II. TCP has no option for selective acknowledgement III. TCP connections are message streamsThink it through. Then check your answer.Question
Consider the following statements.I. TCP connections are full duplex
II. TCP has no option for selective acknowledgement
III. TCP connections are message streamsCorrect answer
(A) Only I is correct
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement I: TCP is a full-duplex protocol, meaning data can be sent and received simultaneously on a single connection. This is correct.
Statement II: TCP does have an option for Selective Acknowledgement (SACK), which allows the receiver to inform the sender about all segments that have been received successfully, so the sender only needs to retransmit the lost segments. The statement says it has 'no option', so it is incorrect.
Statement III: TCP is a byte-stream oriented protocol, not a message-stream oriented protocol. UDP is message-oriented. So this statement is incorrect.
Therefore, only statement I is correct.20
Q20MCQ1 markEasyConsider the equality and the following choices for
I. II. III. IV.
The equality above…Think it through. Then check your answer.Question
Consider the equality and the following choices for
I.
II.
III.
IV.
The equality above remains correct if is replaced byCorrect answer
(C) I or III or IV but not II
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sum of cubes of the first natural numbers is given by:This expression is of the order , so:- It is (Statement I is correct).
- It is NOT (Statement II is incorrect).
- It is because for large (Statement III is correct).
- It is because for large (Statement IV is correct).
21
Q21NAT1 markEasyConsider a binary tree that has 200 leaf nodes. Then, the number of nodes in that have exactly two children are _______.Think it through. Then check your answer.Question
Consider a binary tree that has 200 leaf nodes. Then, the number of nodes in that have exactly two children are _______.Correct answer
199 to 199
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In any binary tree, let:- be the number of leaf nodes (nodes with 0 children).
- be the number of nodes with exactly 1 child.
- be the number of nodes with exactly 2 children.
- be the total number of nodes.
- be the total number of edges.
Also, the number of edges .
From the sum of degrees (or counting edges from parents), .
Equating the two expressions for :
Given leaf nodes:
.
So, the number of nodes with exactly two children is 199.22
Q22NAT1 markEasyGiven a hash table with 25 slots that stores 2000 elements, the load factor for isThink it through. Then check your answer.Question
Given a hash table with 25 slots that stores 2000 elements, the load factor for isCorrect answer
80 to 80
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The load factor of a hash table is defined as the ratio of the number of elements stored in the table to the total number of slots (or buckets) in the table.Given:
Number of elements = 2000
Number of slots = 25Formula for load factor:
Substitute the given values:
Calculate the value:
Thus, the load factor for the hash table is 80.23
Q23MCQ1 markMediumIn the given matrix one of the eigenvalues is 1. The eigenvectors corresponding to the eigenvalue 1 areThink it through. Then check your answer.Question
In the given matrixone of the eigenvalues is 1. The eigenvectors corresponding to the eigenvalue 1 areCorrect answer
(B) \α(-4,2,1) α ≠ 0, α ∈ R\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the given matrix be .
We are given that is an eigenvalue.
To find the eigenvectors corresponding to , we need to solve the equation , where is the identity matrix and is the eigenvector.Substitute :
Let the eigenvector be .
The system of equations becomes:
1)
2) (This equation is trivial and provides no new information)
3) Now, substitute from equation (1) into equation (3):
So, the eigenvector can be written as:
We can factor out :
Since an eigenvector must be non-zero, . Let , where is any non-zero real number.
Thus, the set of eigenvectors corresponding to the eigenvalue 1 is .This matches option (B).24
Q24MCQ1 markMediumThe value of isThink it through. Then check your answer.Question
The value of isCorrect answer
(C) 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to evaluate the limit: First, rewrite the expression to identify its form as :
As , the numerator and the denominator .
This is an indeterminate form of type , so we can apply L'Hôpital's Rule.First application of L'Hôpital's Rule:
Take the derivative of the numerator and the denominator:
So, the limit becomes:
This is still an indeterminate form of type . We apply L'Hôpital's Rule again.Second application of L'Hôpital's Rule:
Take the derivative of the new numerator and denominator:
So, the limit becomes:
Now, as , . Therefore, .Thus, .The correct option is (A).25
Q25NAT1 markMediumThe number of 4 digit numbers having their digits in non-decreasing order (from left to right) constructed by using the digits belonging to the set is __________.Think it through. Then check your answer.Question
The number of 4 digit numbers having their digits in non-decreasing order (from left to right) constructed by using the digits belonging to the set is __________.Correct answer
15 to 15
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to form a 4-digit number such that using digits from the set .
This is a problem of combinations with repetition (stars and bars), as the order is fixed (non-decreasing) and determined solely by the count of each digit chosen.The number of ways to choose digits from types with repetition is given by:Alternatively, we can list the combinations:- All same (e.g., 1111): 3 ways
- 3 same, 1 different (e.g., 1112): ways
- 2 same, 2 same (e.g., 1122): 3 ways
- 2 same, 2 different (e.g., 1123): 3 ways
26
Q26MCQ1 markMediumIn a room there are only two types of people, namely Type 1 and Type 2. Type 1 people always tell the truth and Type 2 people always lie. You give a fair coin to a person in that…Think it through. Then check your answer.Question
In a room there are only two types of people, namely Type 1 and Type 2. Type 1 people always tell the truth and Type 2 people always lie. You give a fair coin to a person in that room, without knowing which type he is from and tell him to toss it and hide the result from you till you ask for it. Upon asking, the person replies the following"The result of the toss is head if and only if I am telling the truth."Which of the following options is correct?Correct answer
(A) The result is head
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the proposition "The result is head" and be the proposition "The person is telling the truth".
The statement given by the person is .Case 1: The person is Type 1 (Truth-teller).
Then is true. Since they tell the truth, the statement must be true.
So, is true, which implies is true.Case 2: The person is Type 2 (Liar).
Then is false. Since they lie, the statement must be false.
So, is false. The biconditional is false if and only if and have different truth values.
Since is false, must be true for the statement to be false.In both cases, is true. Therefore, the result is head.27
Q27MCQ1 markEasyWhile inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level isThink it through. Then check your answer.Question
While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level isCorrect answer
(B) 67
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's insert the elements sequentially into an empty BST:1.Insert 71: Root (Level 1).2.Insert 65: , so left child of 71 (Level 2).3.Insert 84: , so right child of 71 (Level 2).4.Insert 69: (left), (right). Right child of 65 (Level 3).5.Insert 67: (left), (right), (left). Left child of 69 (Level 4).6.Insert 83: (right), (left). Left child of 84 (Level 3).The levels are:
Level 1: 71
Level 2: 65, 84
Level 3: 69, 83
Level 4: 67The lowest level (deepest) is Level 4, which contains the element 67.28
Q28MCQ1 markEasyThe result evaluating the postfix expression 10 5 + 60 6 / * 8 - isThink it through. Then check your answer.Question
The result evaluating the postfix expression 10 5 + 60 6 / * 8 - isCorrect answer
(C) 142
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To evaluate the postfix expression "10 5 + 60 6 / * 8 -", we use a stack:1.Read 10, push 10. Stack: [10]2.Read 5, push 5. Stack: [10, 5]3.Read +, pop 5 and 10, compute . Push 15. Stack: [15]4.Read 60, push 60. Stack: [15, 60]5.Read 6, push 6. Stack: [15, 60, 6]6.Read /, pop 6 and 60, compute . Push 10. Stack: [15, 10]7.Read *, pop 10 and 15, compute . Push 150. Stack: [150]8.Read 8, push 8. Stack: [150, 8]9.Read -, pop 8 and 150, compute . Push 142. Stack: [142]The final result is 142.Therefore, the correct option is (C).29
Q29MCQ1 markMediumConsider the following relation Cinema(theater, address, capacity) Which of the following options will be needed at the end of the SQL query SELECT P1.address FROM Cinema P1 such…Think it through. Then check your answer.Question
Consider the following relationCinema(theater, address, capacity)Which of the following options will be needed at the end of the SQL querySELECT P1.address
FROM Cinema P1such that it always finds the addresses of theaters with maximum capacity?Correct answer
(A) WHERE P1.capacity = All (select P2.capacity from Cinema P2)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's construct the Binary Search Tree (BST) by inserting the elements in the given sequence:
Elements: 71, 65, 84, 69, 67, 831.Insert 71: The root is 71. (Level 0)2.Insert 65: , so 65 becomes the left child of 71. (Level 1)3.Insert 84: , so 84 becomes the right child of 71. (Level 1)Current BST:
71 (Level 0)
/ \
65 84 (Level 1)4.Insert 69: . Compare with 65: , so 69 becomes the right child of 65. (Level 2)Current BST:
71
/ \
65 84
\
69 (Level 2)5.Insert 67: . Compare with 65: . Compare with 69: , so 67 becomes the left child of 69. (Level 3)Current BST:
71
/ \
65 84
\
69
/
67 (Level 3)6.Insert 83: . Compare with 84: , so 83 becomes the left child of 84. (Level 2)Final BST:
71 (Level 0)
/ \
65 84 (Level 1)
\ /
69 83 (Level 2)
/
67 (Level 3)The levels are:
Level 0: {71}
Level 1: {65, 84}
Level 2: {69, 83}
Level 3: {67}The element in the lowest level (Level 3) is 67.Therefore, the correct option is (B).30
Q30MCQ1 markMediumConsider the following array of elements. (89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100) The minimum number of interchanges needed to convert it into a max-heap isThink it through. Then check your answer.Question
Consider the following array of elements.
(89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100)
The minimum number of interchanges needed to convert it into a max-heap isCorrect answer
(D) 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To convert an array into a max-heap, we use thebuild_max_heapalgorithm, which involves callingmax_heapifyon all non-leaf nodes, starting from the last non-leaf node up to the root.Given array:
Number of elements .In a 0-indexed array, the parent of node is , and children are and .
The last non-leaf node is at index .
We will callmax_heapifyfor indices .
An interchange (swap) counts as one operation.Initial array (tree representation):1.89 (0) / \ 19 (1) 50 (2) / \ / \ 17(3) 12(4) 15(5) 2(6) / \ / \ / \ 5(7) 7(8) 11(9) 6(10) 9(11) 100(12)max_heapify(A, 5)(element 15):- Node 5 (15) has children 11 (9) and 12 (100).
- Max child is 100. . Swap and .
- Array:
- Interchanges: 1
max_heapify(A, 4)(element 12):- Node 4 (12) has children 9 (11) and 10 (6).
- Max child is 11. . No swap needed.
- Interchanges: 1 (total)
max_heapify(A, 3)(element 17):- Node 3 (17) has children 7 (5) and 8 (7).
- Max child is 7. . No swap needed.
- Interchanges: 1 (total)
max_heapify(A, 2)(element 50):- Node 2 (50) has children 5 (100) and 6 (2).
- Max child is 100. . Swap and .
- Array:
- Interchanges: 2
- Node 5 (50) now has children 11 (9) and 12 (15). and . No further swap for 50.
max_heapify(A, 1)(element 19):- Node 1 (19) has children 3 (17) and 4 (12).
- Max child is 17. . No swap needed.
- Interchanges: 2 (total)
max_heapify(A, 0)(element 89):- Node 0 (89) has children 1 (19) and 2 (100).
- Max child is 100. . Swap and .
- Array:
- Interchanges: 3
- Node 2 (89) now has children 5 (50) and 6 (2). and . No further swap for 89.
Total minimum interchanges needed: 3.Therefore, the correct option is (D).31
Q31MCQ1 markMediumTwo processes and need to access a critical section. Consider the following synchronization construct used by both the processes Process X [code] Process Y [code] Here,…Think it through. Then check your answer.Question
Two processes and need to access a critical section. Consider the following synchronization construct used by both the processesProcess XProcess Y/* other code for process X */ while(true) { varP = true; while(varQ == true) { /* Critical Section */ varP = false; } } /* other code for process X */Here,/* other code for process Y */ while(true) { varQ = true; while(varP == true) { /* Critical Section */ varQ = false; } } /* other code for process Y */varPandvarQare shared variables and both are initialized to false. Which one of the following statements is true?Correct answer
(A) The proposed solution prevents deadlock but fails to guarantee mutual exclusion
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the execution trace:1.InitiallyvarP = false,varQ = false.2.Process X executesvarP = true.3.Context switch to Process Y.4.Process Y executesvarQ = true.5.Process Y checkswhile(varP == true). SincevarPis true, Y enters the Critical Section (CS).6.Context switch to Process X.7.Process X checksBoth processes are in the Critical Section simultaneously, so Mutual Exclusion is violated.Regarding Deadlock: Deadlock implies processes are waiting indefinitely for a condition that will never become true. Here, processes do not wait; they enter the CS (incorrectly) or loop. If executed sequentially (e.g., X runs alone), X setswhile(varQ == true). SincevarQis true, X enters the Critical Section (CS).varP=true, checksvarQ(false), skips the inner loop (CS), and repeats. While this might be a liveness issue (starvation/livelock), it is not a deadlock in the sense of circular wait preventing any progress. The primary failure is Mutual Exclusion. The option stating it prevents deadlock but fails mutual exclusion is the most appropriate description of the race condition allowing both to enter.32
Q32MCQ1 markMediumLet L be the language represented by the regular expression where . What is the minimum number of states in a DFA that recognizes…Think it through. Then check your answer.Question
Let L be the language represented by the regular expression where . What is the minimum number of states in a DFA that recognizes (complement of L)?Correct answer
(B) 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The language consists of all strings containing the substring "0011".
A minimal DFA for requires 5 states:1.: Start state (no progress towards 0011)2.: Seen "0"3.: Seen "00"4.: Seen "001"5.: Seen "0011" (Accepting/Trap state)The transitions are:- : 0->1, 1->0
- : 0->2, 1->0
- : 0->2, 1->3
- : 0->1, 1->4
- : 0->4, 1->4
33
Q33NAT1 markMediumConsider a software program that is artificially seeded with 100 faults. While testing this program, 159 faults are detected, out of which 75 faults are from those artificially…Think it through. Then check your answer.Question
Consider a software program that is artificially seeded with 100 faults. While testing this program, 159 faults are detected, out of which 75 faults are from those artificially seeded faults. Assuming that both real and seeded faults are of same nature and have same distribution, the estimated number of undetected real faults is ________.Correct answer
28 to 28
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
This is a Capture-Recapture estimation problem.Let:
(Total seeded faults)
(Total detected faults)
(Detected seeded faults)
(Detected real faults)The efficiency of detection is estimated as the fraction of seeded faults found:
Assuming real faults are detected with the same efficiency, the total number of real faults () can be estimated by:
The number of undetected real faults is:
Alternatively:
Undetected = .34
Q34MCQ1 markMediumConsider a machine with a byte addressable main memory of bytes, block size of 16 bytes and a direct mapped cache having cache lines. Let the addresses of two…Think it through. Then check your answer.Question
Consider a machine with a byte addressable main memory of bytes, block size of 16 bytes and a direct mapped cache having cache lines. Let the addresses of two consecutive bytes in main memory be and . What are the tag and cache line address (in hex) for main memory address ?Correct answer
(A) E, 201
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Main memory size = bytes Physical Address = 20 bits.
Block size = 16 bytes = bytes Block Offset = 4 bits.
Number of cache lines = Line Number (Index) = 12 bits.
Tag bits = Physical Address bits - (Line Number bits + Block Offset bits)
Tag bits = bits.Address given:
Binary representation (20 bits): Splitting the address:- Block Offset (LSB 4 bits): (F)
- Line Number (Next 12 bits):
- Tag (MSB 4 bits):
35
Q35MCQ1 markMediumConsider a CSMA/CD network that transmits data at a rate of 100 Mbps ( bits per second) over a 1 km (kilometer) cable with no repeaters. If the minimum frame size required…Think it through. Then check your answer.Question
Consider a CSMA/CD network that transmits data at a rate of 100 Mbps ( bits per second) over a 1 km (kilometer) cable with no repeaters. If the minimum frame size required for this network is 1250 bytes, what is the signal speed (km/sec) in the cable?Correct answer
(D) 20000
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For CSMA/CD, the condition for collision detection is:
Transmission Time () Propagation Time ()Given:
Bandwidth () = 100 Mbps = bps
Distance () = 1 km
Frame Size () = 1250 bytes = bits = 10,000 bits secondsLet signal speed be km/sec.
secondsSubstitute into the condition:
km/secThe minimum signal speed required is 20,000 km/sec.36
Q36NAT2 marksMediumThe velocity (in kilometer/minute) of a motorbike which starts from rest, is given at fixed intervals of time (in minutes) as follows: | t | 2 | 4 | 6 | 8 | 10 | 12 | 14 |…Think it through. Then check your answer.Question
The velocity (in kilometer/minute) of a motorbike which starts from rest, is given at fixed intervals of time (in minutes) as follows:The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson’s rule is __________.t 2 4 6 8 10 12 14 16 18 20 v 10 18 25 29 32 20 11 5 2 0 Correct answer
308 to 310
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The motorbike starts from rest, which implies at , . We need to calculate the distance covered in 20 minutes, which is .The data points are:
Step size .
Number of intervals (even), so Simpson's 1/3 rule is applicable.Formula: Sum of ends () =
Sum of odds () =
Sum of evens () =
The distance is approximately 309.33 km.37
Q37MCQ2 marksMediumAssume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem…Think it through. Then check your answer.Question
Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?Correct answer
(B) 512
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The worst-case time complexity of Merge Sort is . Let the time taken be .Given:
seconds.We want to find such that minutes seconds.Now we check the options:
(A) :
(B) : (Matches exactly)
(C) : Thus, the maximum input size is 512.38
Q38MCQ2 marksMediumConsider the following recursive C function. [code] Ifget(6)function is being called inmain()then how many times will theget()function be invoked before returning to…Think it through. Then check your answer.Question
Consider the following recursive C function.Ifvoid get(int n) { if (n < 1) return; get(n - 1); get(n - 3); printf("%d", n); }get(6)function is being called inmain()then how many times will theget()function be invoked before returning to themain()?Correct answer
(B) 25
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the total number of times the functionget(n)is invoked.1.Base Case: For , the function is called, the conditionif (n < 1)evaluates to true, and it returns immediately. Thus, for all .2.Recursive Step: For , the function is called once, and then it recursively callsget(n - 1)andget(n - 3). The recurrence relation for the number of calls is:3.Step-by-step Calculation:- (since )
- (since )
- (since )
get()is invoked a total of 25 times.39
Q39NAT2 marksMediumConsider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of…Think it through. Then check your answer.Question
Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ___________.Correct answer
50 to 50
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a B+ tree, non-leaf nodes (internal nodes) contain only block pointers and search keys. They do not contain record pointers (which are only in leaf nodes). Let be the order of the B+ tree (maximum number of block pointers in a node).
A node with block pointers will have keys.The size of a block pointer is bytes.
The size of a search key is bytes.
The block size is bytes.The inequality for the size of a non-leaf node is:Since must be an integer, the maximum order is .
The maximum number of keys in a non-leaf node is .40
Q40MCQ2 marksMediumGiven the function , where is a function in three Boolean variables and and , consider the following statements. (S1) (S2)…Think it through. Then check your answer.Question
Given the function , where is a function in three Boolean variables and and , consider the following statements.(S1)
(S2)
(S3)
(S4)
Which of the following is true?Correct answer
(A) (S1)- False, (S2)- True, (S3)- True, (S4)- False
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function is .
Let's construct the truth table:
(minterm 0)
(minterm 1)
(minterm 2)
(minterm 3)
(maxterm 4)
(maxterm 5)
(maxterm 6)
(minterm 7)The minterms (where ) are . Thus, . Statement (S2) is True.
The maxterms (where ) are . Thus, . Statement (S3) is True.Consequently:
(S1) is False.
(S2) is True.
(S3) is True.
(S4) is False.This corresponds to option (A).41
Q41MCQ2 marksMediumLanguage is polynomial time reducible to language . Language is polynomial time reducible to , which in turn is polynomial time reducible to language .…Think it through. Then check your answer.Question
Language is polynomial time reducible to language . Language is polynomial time reducible to , which in turn is polynomial time reducible to language . Which of the following is/are true?I. if , then
II. if or , then
III. , if and only if
IV. if , then andCorrect answer
(C) I and IV only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:1.2.3.By transitivity of polynomial time reduction:
Analysis of statements:
I. If , then . Since , if the harder problem () is solvable in polynomial time, the easier problem () is also solvable in polynomial time. True.II. If or , then . This is incorrect. means is at least as hard as . Knowing is easy () tells us nothing about the difficulty of . False.III. if and only if . There is no direct relationship between and other than they both reduce to . One could be in and the other not (assuming allows it). False.IV. If , then and . Since and , if , then both and must be in . True.Statements I and IV are true.42
Q42NAT2 marksMediumConsider the following C program. [code] The output of the program is ________.Think it through. Then check your answer.Question
Consider the following C program.The output of the program is ________.#include<stdio.h> int f1(void); int f2(void); int f3(void); int x = 10; int main( ) { int x = 1; x += f1( ) + f2( ) + f3( ) + f2( ); printf("%d", x); return 0; } int f1( ) { int x = 25; x++; return x;} int f2( ) { static int x = 50; x++; return x;} int f3( ) { x *= 10; return x;}Correct answer
230 to 230
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the execution:1.Global variablexis initialized to 10.2.Inmain, a local variablexis initialized to 1.3.The expressionx += f1() + f2() + f3() + f2()is evaluated. The order of function calls is not strictly defined in C, but since addition is commutative and the side effects are on different variables (mostly), we can evaluate them:f1(): Localxis 25, increments to 26. Returns 26. (Globalxis untouched).f2()(1st call): Staticxis 50, increments to 51. Returns 51.f3(): Modifies globalx. Globalxbecomes . Returns 100.f2()(2nd call): Staticxis 51, increments to 52. Returns 52.
4.The localxinmainis updated:x = x + 229x = 1 + 229 = 230.5.printfprints the localx, which is 230.43
Q43NAT2 marksMediumConsider the following C program. [code] The output of the program is ___________.Think it through. Then check your answer.Question
Consider the following C program.The output of the program is ___________.#include<stdio.h> int main( ) { static int a[ ] = {10, 20, 30, 40, 50}; static int *p[ ] = {a, a+3, a+4, a+1, a+2}; int **ptr = p; ptr++; printf("%d%d", ptr-p,**ptr); }Correct answer
140 to 140
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the code step by step:1.Arraystatic int a[] = {10, 20, 30, 40, 50};ahas elements at indices 0 to 4.
Let address ofabe 1000 (assuming int size 4).a[0]at 1000,a[1]at 1004, etc.2.static int *p[] = {a, a+3, a+4, a+1, a+2};pis an array of pointers.
p[0] = a(points toa[0]= 10)
p[1] = a+3(points toa[3]= 40)
p[2] = a+4(points toa[4]= 50)
p[3] = a+1(points toa[1]= 20)
p[4] = a+2(points toa[2]= 30)3.int **ptr = p;ptrpoints to the first element of arrayp, i.e.,ptr = &p[0].4.ptr++;ptris incremented to point to the next element ofp. Nowptr = &p[1].5.printf("%d%d", ptr-p, **ptr);ptr - p: Pointer arithmetic.ptris&p[1],pis&p[0]. The difference is 1 element. So this prints1.**ptr:*ptrgives the valueptrpoints to, which isp[1].p[1]is the addressa+3.**ptrdereferencesa+3, givinga[3], which is40. So this prints40.
140.44
Q44MCQ2 marksMediumWhich of the following languages are context-free?
Think it through. Then check your answer.Question
Which of the following languages are context-free?Correct answer
(B) L₁ and L₃ only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze :This language can be generated by a Context-Free Grammar (CFG). The structure implies a nested dependency: the outer and the inner . We can construct a grammar:
Since a CFG exists (and it can be recognized by a PDA), is Context-Free.2.Analyze :This language represents a copy structure ( form where ). We can use the Pumping Lemma for CFLs to show this is not Context-Free. If we pump the first or , we lose the equality with the second half. Dependencies cross each other ( with , with ), which a stack cannot handle simultaneously.3.Analyze :Here, the number of 's is determined linearly by the number of 's (). This can be rewritten as . A PDA can read one , then for every two 's push one symbol, and pop for every . Alternatively, the grammar is:
Thus, is Context-Free.Conclusion: and are Context-Free. is not.45
Q45MCQ2 marksMediumConsider the following policies for preventing deadlock in a system with mutually exclusive resources. I. Processes should acquire all their resources at the beginning of…Think it through. Then check your answer.Question
Consider the following policies for preventing deadlock in a system with mutually exclusive resources.I. Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released
II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource numbers
III. The resources are numbered uniquely, and processes are allowed to request for resources only in decreasing resource numbers
IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resourcesWhich of the above policies can be used for preventing deadlock?Correct answer
(D) Any one of I, II, III, and IV
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Deadlock prevention involves violating at least one of the four necessary conditions for deadlock (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait).- Policy I: Requires processes to acquire all resources at the start. This violates the Hold and Wait condition because a process does not hold resources while waiting for others (it either gets all or none). Thus, it prevents deadlock.
- Policy II: Imposes a strict ordering (increasing) on resource requests. This violates the Circular Wait condition. If a cycle existed, it would imply , which is impossible. Thus, it prevents deadlock.
- Policy III: Imposes a strict ordering (decreasing). Similar to II, this also prevents cycles and violates Circular Wait. Thus, it prevents deadlock.
- Policy IV: This is effectively the same as Policy II (requesting only resources with larger numbers). It enforces an increasing order, preventing Circular Wait.
46
Q46NAT2 marksEasyIn the network 200.10.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned to a host is _________.Think it through. Then check your answer.Question
In the network 200.10.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned to a host is _________.Correct answer
158 to 158
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Identify the Subnet:- IP Address: 200.10.11.144
- Subnet Mask: /27
- A /27 mask corresponds to . The block size in the last octet is (or ).
- The multiples of 32 are: 0, 32, 64, 96, 128, 160, ...
- The given fourth octet is 144. Since , the network address is 200.10.11.128.
- The next network starts at 200.10.11.160.
- Therefore, the broadcast address for this subnet is (i.e., 200.10.11.159).
- First usable host: Network + 1 = 200.10.11.129
- Last usable host: Broadcast - 1 = 200.10.11.158
- The fourth octet of the last assignable host IP is 158.
47
Q47NAT2 marksMediumConsider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is bits per second. The propagation speed of the media is…Think it through. Then check your answer.Question
Consider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is bits per second. The propagation speed of the media is meters per second. It is needed to design a Go-Back- sliding window protocol for this network. The average packet size is bits. The network is to be used to its full capacity. Assume that processing delays at nodes are negligible. Then, the minimum size in bits of the sequence number field has to be _________.Correct answer
8 to 8
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Bandwidth bps
Distance km m
Speed m/s
Packet size bitsPropagation time seconds.
Transmission time seconds.Let .For a sliding window protocol to utilize full capacity (100% efficiency), the sender window size must be at least .
.In the Go-Back- protocol, the relationship between the sequence number space size (where sequence numbers are ) and the sender window size is . If is the number of bits for the sequence number, then .
So, .Substituting :
We need to find the minimum integer satisfying this:
(too small)
(sufficient)Thus, the minimum size in bits of the sequence number field is 8.48
Q48NAT2 marksMediumConsider the following reservation table for a pipeline having three stages and . | | 1 | 2 | 3 | 4 | 5 | | ------ | ------ | ------ | ------ | ------ |…Think it through. Then check your answer.Question
Consider the following reservation table for a pipeline having three stages and .The minimum average latency (MAL) is _________.1 2 3 4 5 X X X X X Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Identify Forbidden Latencies:- Stage : X at 1 and 5. Distance = .
- Stage : X at 2 and 4. Distance = .
- Stage : X at 3. No distance.
2.Collision Vector:The maximum forbidden latency is 4. The collision vector has 4 bits ().
(latency 4 is forbidden), (latency 2 is forbidden).
.3.State Diagram:- Initial State:
- Try shift 1 (latency 1): Allowed since bit 1 is 0.
- Shift right by 1: .
- OR with initial: .
- From state , all latencies 1, 2, 3, 4 are forbidden. Must wait 5 or more cycles.
- Cycle: Average Latency = .
- Try shift 3 (latency 3): Allowed since bit 3 is 0.
- Shift right by 3: .
- OR with initial: .
- From state :
- Bit 1 is 1 (latency 1 forbidden).
- Bit 2 is 1 (latency 2 forbidden).
- Bit 3 is 0 (latency 3 allowed).
- Bit 4 is 1 (latency 4 forbidden).
- Try shift 3 again: Shift right by 3 . OR with initial .
- This forms a greedy cycle: Average Latency = 3.
The maximum number of X's in any single row is 2 (in and ). Thus, MAL .
However, no cycle with average latency < 3 exists.Therefore, the Minimum Average Latency (MAL) is 3.49
Q49MCQ2 marksMediumConsider the following code sequence having five instructions to . Each of these instructions has the following format. OP Ri, Rj, Rk where operation OP is performed on…Think it through. Then check your answer.Question
Consider the following code sequence having five instructions to . Each of these instructions has the following format.OP Ri, Rj, Rkwhere operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri.
: ADD R1, R2, R3
: MUL R7, R1, R3
: SUB R4, R1, R5
: ADD R3, R2, R4
: MUL R7, R8, R9Consider the following three statements.S1: There is an anti-dependence between instructions and
S2: There is an anti-dependence between instructions and
S3: Within an instruction pipeline an anti-dependence always creates one or more stallsWhich one of above statements is/are correct?Correct answer
(B) Only S2 is true
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the dependencies:- Anti-dependence (WAR - Write After Read): Occurs when an instruction writes to a register that a previous instruction reads. The write must not happen before the read.
- : MUL R7, R1, R3 (Reads R1, R3; Writes R7)
- : MUL R7, R8, R9 (Reads R8, R9; Writes R7)
- Both write to R7. This is an Output Dependence (WAW), not anti-dependence. S1 is False.
- : MUL R7, R1, R3 (Reads R3)
- : ADD R3, R2, R4 (Writes R3)
- reads R3 and writes R3. Since comes before , this is an Anti-dependence (WAR). S2 is True.
- Anti-dependencies (WAR) typically do not cause stalls in a standard 5-stage pipeline because the read (in ID stage) happens before the write (in WB stage) of the subsequent instruction. Even if stages are different, register renaming or simple pipeline timing usually resolves WAR without stalls. It does not always create stalls. S3 is False.
50
Q50MCQ2 marksMediumConsider the following two C code segments. Y and X are one and two dimensional arrays of size and respectively, where . Assume that in both code…Think it through. Then check your answer.Question
Consider the following two C code segments. Y and X are one and two dimensional arrays of size and respectively, where . Assume that in both code segments, elements of Y are initialized to 0 and each element X[i][j] of array X is initialized to i+j. Further assume that when stored in main memory all elements of X are in same main memory page frame.Code segment 1:Code Segment 2://initialize elements of Y to 0 //initialize elements X[i][j] of X to i+j for(i = 0; i < n; i++) Y[i] += X[0][i];Which of the following statements is/are correct?S1: Final contents of array Y will be same in both code segments//initialize elements of Y to 0 //initialize elements X[i][j] of X to i+j for(i = 0; i < n; i++) Y[i] += X[i][0];
S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory
S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memoryCorrect answer
(C) Only S1 and S2 are correct
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the dependencies:S1: Anti-dependence between and- : MUL R7, R1, R3 (Reads R1, R3; Writes R7)
- : MUL R7, R8, R9 (Reads R8, R9; Writes R7)
- Anti-dependence (WAR) occurs if reads a register that later writes. Here, reads {R1, R3} and writes {R7}. No intersection.
- Both write to R7, which is an Output Dependence (WAW), not Anti-dependence. So S1 is False.
- : MUL R7, R1, R3 (Reads R1, R3)
- : ADD R3, R2, R4 (Writes R3)
- reads R3, and subsequently writes to R3. This is a Write-After-Read (WAR) dependency, also known as anti-dependence. So S2 is True.
- In a typical in-order pipeline, instructions are fetched and operands are read (e.g., in ID stage) in order. reads R3 before reaches the Write Back (WB) stage. Thus, the read happens before the overwrite, naturally satisfying the dependency without stalls. Stalls are usually required for RAW (Read-After-Write) hazards, not WAR, unless in specific out-of-order scenarios without renaming. The statement "always creates one or more stalls" is too strong and generally False for standard pipelines.
51
Q51MCQ2 marksMediumConsider the following partial Schedule involving two transactions and . Only the read and the write operations have been shown. The read operation on data item…Think it through. Then check your answer.Question
Consider the following partial Schedule involving two transactions and . Only the read and the write operations have been shown. The read operation on data item is denoted by read(P) and the write operation on data item is denoted by write(P).Suppose that the transaction fails immediately after time instance 9. Which one of the following statements is correct?Time instance T1 T2 1 read(A) 2 write(A) 3 read(C) 4 write(C) 5 read(B) 6 write(B) 7 read(A) 8 commit 9 read(B) Correct answer
(B) Schedule S is non-recoverable and cannot ensure transaction atomicity
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
S1 Analysis:- is initialized to .
- Segment 1 computes . Value added is .
- Segment 2 computes . Value added is .
- Since , the final contents of Y are identical (). S1 is True.
- Segment 1 accesses .
- In C, 2D arrays are stored in row-major order. Elements of the same row are stored contiguously. Thus, and are adjacent in memory. S2 is True.
- Segment 2 accesses .
- These elements belong to the first column of different rows. In row-major order, they are separated by the size of a row ( elements). They are not contiguous. S3 is False.
52
Q52MCQ2 marksMediumIf the following system has non-trivial solution, px + qy + rz = 0 qx + ry + pz = 0 rx + py + qz = 0, then which one of the following options is TRUE?Think it through. Then check your answer.Question
If the following system has non-trivial solution,px + qy + rz = 0
qx + ry + pz = 0
rx + py + qz = 0,then which one of the following options is TRUE?Correct answer
(C) p + q + r = 0 or p = q = r
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze Dependencies:- At time 2, writes A.
- At time 7, reads A.
- This is a "dirty read" because reads a value written by before has committed.
- commits at time 8.
- is still active and fails after time 9.
- A schedule is recoverable if for every transaction that reads from , commits before commits.
- Here, reads from , but commits before . Thus, the schedule is non-recoverable.
- Since fails, it must be rolled back (aborted) to ensure atomicity. However, has already committed and cannot be aborted (Durability property). But used a value from which is now invalid. This inconsistency means atomicity cannot be ensured for the system as a whole given the commit of .
53
Q53NAT2 marksMediumConsider the following C program: [code] The number of times printf statement is executed is __________.Think it through. Then check your answer.Question
Consider the following C program:The number of times printf statement is executed is __________.#include<stdio.h> int main( ) { int i, j, k = 0; j = 2 * 3 / 4 + 2.0 / 5 + 8 / 5; k -= --j; for(i = 0; i < 5; i++) { switch(i + k) { case 1: case 2: printf("\n%d", i+k); case 3: printf("\n%d", i+k); default: printf("\n%d", i+k); } } return 0; }Correct answer
10 to 10
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Step 1: Evaluatej.j = 2 * 3 / 4 + 2.0 / 5 + 8 / 52 * 3 = 6,6 / 4 = 1(integer division)2.0 / 5 = 0.4(float division)8 / 5 = 1(integer division)j = 1 + 0.4 + 1 = 2.4
Sincejis an integer,j = 2.Step 2: Evaluatek.k -= --j
Pre-decrementjbecomes 1.k = k - 1 = 0 - 1 = -1.Step 3: Loopifrom 0 to 4.
Inside loop, switch oni + k(which isi - 1).i = 0:switch(-1). No match. Goes todefault. Prints once.i = 1:switch(0). No match. Goes todefault. Prints once.i = 2:switch(1). Matchescase 1. Falls through tocase 2(print),case 3(print),default(print). Total 3 prints.i = 3:switch(2). Matchescase 2. Prints. Falls through tocase 3(print),default(print). Total 3 prints.i = 4:switch(3). Matchescase 3. Prints. Falls through todefault(print). Total 2 prints.
54
Q54MCQ2 marksMediumIf for non-zero , where then isThink it through. Then check your answer.Question
If for non-zero , where then isCorrect answer
(A) (1)/(a² - b²) [ a(ln 2 - 25) + (47b)/(2) ]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
(1) Replace with :
(2) Multiply (1) by and (2) by :
Subtract the second from the first:
Integrate from 1 to 2:55
Q55NAT2 marksMediumLet be a connected undirected graph of 100 vertices and 300 edges. The weight of a minimum spanning tree of is 500. When the weight of each edge of is increased by…Think it through. Then check your answer.Question
Let be a connected undirected graph of 100 vertices and 300 edges. The weight of a minimum spanning tree of is 500. When the weight of each edge of is increased by five, the weight of a minimum spanning tree becomes __________.Correct answer
995 to 995
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A Minimum Spanning Tree (MST) of a graph with vertices always has edges.
Here, , so the MST has edges.When the weight of every edge in the graph is increased by a constant , the structure of the MST remains the same (since the relative order of edge weights does not change). The weight of the new MST will be the old weight plus times the number of edges in the MST.New Weight = Old Weight + (Number of edges in MST Increase per edge)
New Weight =
New Weight = .56
Q56NAT2 marksMediumTwo hosts are connected via a packet switch with bits per second links. Each link has a propagation delay of 20 microseconds. The switch begins forwarding a packet 35…Think it through. Then check your answer.Question
Two hosts are connected via a packet switch with bits per second links. Each link has a propagation delay of 20 microseconds. The switch begins forwarding a packet 35 microseconds after it receives the same. If 10000 bits of data are to be transmitted between the two hosts using a packet size of 5000 bits, the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is __________.Correct answer
1575 to 1575
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Bandwidth bps.
Propagation delay .
Packet size bits.
Total data = 10000 bits Number of packets = 2.
Switch processing/forwarding delay (starts forwarding 35 after reception).Transmission time per packet .Packet 1:- Transmission from Host A starts at .
- Host A finishes sending at .
- Packet 1 arrives at Switch at .
- Switch starts forwarding at .
- Switch finishes sending at .
- Packet 1 arrives at Host B at .
- Host A transmits Packet 2 immediately after Packet 1 (from to ).
- Packet 2 arrives at Switch at .
- Switch is ready to forward Packet 2 at .
- Switch becomes free after sending Packet 1 at .
- Earliest start time based on arrival: .
- Since the switch becomes free exactly at , it can start sending Packet 2 immediately at .
- Switch finishes sending Packet 2 at .
- Packet 2 arrives at Host B at .
57
Q57MCQ2 marksMediumFor the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time? | Process | Arrival Time | Processing Time…Think it through. Then check your answer.Question
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?Process Arrival Time Processing Time A 0 3 B 1 6 C 4 4 D 6 2 Correct answer
(C) Shortest Remaining Time
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the average turnaround time (TAT = Completion Time - Arrival Time) for each algorithm.1. Shortest Remaining Time (SRT) - Preemptive SJF:- : P_A arrives (burst 3). Runs A.
- : P_B arrives (burst 6). A has 2 left. , continue A.
- : A finishes. Ready: {B(6)}. Run B.
- : P_C arrives (burst 4). B has 5 left. , preempt B. Run C.
- : P_D arrives (burst 2). C has 2 left. . Continue C (tie-breaking usually favors current or FCFS).
- : C finishes. Ready: {B(5), D(2)}. Run D.
- : D finishes. Ready: {B(5)}. Run B.
- : B finishes.
TAT: A=3, B=14, C=4, D=4. Average = .2. FCFS:
Order: A, B, C, D.
Completion: A=3, B=9, C=13, D=15.
TAT: A=3, B=8, C=9, D=9. Average = .3. Non-preemptive SJF:- : Run A (3). Finishes at 3.
- : Ready {B(6)}. Run B. Finishes at 9.
- : Ready {C(4), D(2)}. Run D. Finishes at 11.
- : Ready {C(4)}. Run C. Finishes at 15.
Completion: A=5, B=15, C=13, D=11.
TAT: A=5, B=14, C=9, D=5. Average = .Lowest is SRT (6.25).58
Q58MCQ2 marksMediumConsider three software items: Program-X, Control Flow Diagram of Program-Y and Control Flow Diagram of Program-Z as shown below [figure] The values of McCabe’s Cyclomatic…Think it through. Then check your answer.Question
Consider three software items: Program-X, Control Flow Diagram of Program-Y and Control Flow Diagram of Program-Z as shown belowThe values of McCabe’s Cyclomatic complexity of Program-X, Program-Y, and Program-Z respectively are
Correct answer
(A) 4, 4, 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Cyclomatic Complexity where is the number of predicate nodes (decision points).Program-X:
Predicates:1.if (value < 0)2.while ((i<value) AND (result <= maxint))- This contains a compound condition. However, in standard McCabe complexity for C programs,whileis 1 loop predicate. If the compound condition is treated as a single decision for the loop entry, it counts as 1. If short-circuiting is considered, it might be 2. Let's check other structures.3.Total predicates = 3. .Program-Y:if (result <= maxint)
From the control flow diagram:- There is a decision node at the top (splits into 2).
- One branch goes to another decision node (splits into 2).
- There is a loop back edge.
1.Outer region.2.Region formed by the firstif-elsesplit and merge.3.Region formed by the loop.4.Region formed by the second split/merge.Visually, there are 3 binary decision nodes. .Program-Z:
Program-Z is a sequential composition of Program-X and Program-Y (as indicated by the arrow from X's box to Y's box).
For sequential composition of two modules and :
(assuming they are combined into a single graph where the exit of A is the entry of B).
.Thus, the complexities are 4, 4, 7.59
Q59NAT2 marksMediumConsider the equation where and are unknown. The number of possible solutions is __________.Think it through. Then check your answer.Question
Consider the equation where and are unknown. The number of possible solutions 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 equation: Expanding the base notation:
Constraints on digits based on the base:1.For base : digits 4 and 3 must be less than . So .2.For base 8: digits and 3 must be less than 8. So .Substitute into :
So the possible integer values for are .Let's find corresponding values:- If (Valid since )
- If (Valid since )
- If (Valid since )
- If (Valid since )
- If (Valid since )
60
Q60MCQ2 marksMediumLet be a relation on the set of ordered pairs of positive integers such that if and only if . Which one of the following is true about ?Think it through. Then check your answer.Question
Let be a relation on the set of ordered pairs of positive integers such that if and only if . Which one of the following is true about ?Correct answer
(C) Not reflexive but symmetric
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The condition is given by . Rearranging terms, this is equivalent to .Reflexivity:
Check if for all .
Condition: .
This is not true for all pairs of positive integers (e.g., is not related to itself because ). Thus, is not reflexive.Symmetry:
Check if .
Given: .
To prove: .
Since addition is commutative, and , so the condition holds. Thus, is symmetric.Therefore, the relation is not reflexive but symmetric.61
Q61NAT2 marksMediumSuppose for are independent and identically distributed random variables whose probability mass functions are for…Think it through. Then check your answer.Question
Suppose for are independent and identically distributed random variables whose probability mass functions are for . Define another random variable , where denotes XOR. Then __________.Correct answer
0.75 to 0.75
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to find .Given , the expression for becomes:
Since , we have .We want to find the probability that , i.e., .The product is 0 if either or (or both). It is 1 only if both and .Since are independent Bernoulli(0.5) variables:
.Therefore,
.62
Q62NAT2 marksMediumThe total number of prime implicants of the function is ________.Think it through. Then check your answer.Question
The total number of prime implicants of the function 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
The minterms are .Using a 4-variable K-map:- Quad (0, 2, 4, 6): Covers corners of the top two rows. Term: .
- Pair (4, 5): Covers and . Term: .
- Pair (2, 10): Covers and . Term: .
63
Q63NAT2 marksMediumSuppose is an array of length , where all the entries are from the set . For any positive integers and , consider the…Think it through. Then check your answer.Question
Suppose is an array of length , where all the entries are from the set .
For any positive integers and , consider the following pseudocode.If and , then the output of DOSOMETHING() is ________.DOSOMETHING (c, a, n) z <- 1 for i <- 0 to k - 1 do z <- z^2 mod n if c[i] = 1 then z <- (z * a) mod n return zCorrect answer
0 to 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We trace the execution with . Initial .Iteration ():
Since , Iteration ():
Since , no change.Iteration ():
Since , Iteration ():
Since , Final return value is 0.64
Q64MCQ2 marksMediumLet and , where is a positive integer. Which of the following statements is/are correct? I. II.Think it through. Then check your answer.Question
Let and , where is a positive integer. Which of the following statements is/are correct?I.
II.Correct answer
(D) Neither I nor II
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function oscillates between -1 and 1.Check I:
This requires for large .
When , . The condition becomes , which is false for large .Check II:
This requires for large .
When , . The condition becomes , which implies , false for large .Thus, neither statement is true.65
Q65MCQ2 marksMediumConsider the following grammar where , and are non-terminal symbols, , and are terminal symbols.…Think it through. Then check your answer.Question
Consider the following grammar where , and are non-terminal symbols, , and are terminal symbols. Which of the following statement(s) is/are correct?S1. LL(1) can parse all strings that are generated using grammar
S2. LR(1) can parse all strings that are generated using grammarCorrect answer
(D) Neither S1 nor S2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
First, let's analyze the language generated by the grammar :
Notice that the string "c" can be derived in two different ways:1.2.Since the string "c" has more than one distinct leftmost derivation (and more than one parse tree), the grammar is ambiguous.Properties of ambiguous grammars:- An ambiguous grammar is never LL(1).
- An ambiguous grammar is never LR(k) for any .
- S1 is false because the grammar is ambiguous (First(F) First(H) = , causing a conflict in the S production).
- S2 is false because ambiguous grammars cannot be parsed by any LR(1) parser.