GATE CS 2022 Question Paper with Solutions: 65 Questions, Answer Key & Section-wise Analysis
GATE CS 2022 previous year paper: 65 questions with answer key and detailed solutions, section-wise breakdown and free sample questions.
65 Qs
Total Questions
100 Marks
Total Marks
0 Mins
Duration
Section-wise Paper Structure
Engineering Mathematics
14 Qs
22% of total marks
Programming and Data Structures
7 Qs
11% of total marks
Computer Organization and Architecture
7 Qs
11% of total marks
Computer Networks
6 Qs
9% of total marks
Theory of Computation
5 Qs
8% of total marks
Operating System
5 Qs
8% of total marks
Databases
5 Qs
8% of total marks
Quantitative Aptitude
3 Qs
5% of total marks
Compiler Design
3 Qs
5% of total marks
Analytical Aptitude
3 Qs
5% of total marks
Spatial Aptitude
2 Qs
3% of total marks
Digital Logic
2 Qs
3% of total marks
Algorithms
2 Qs
3% of total marks
Verbal Aptitude
1 Qs
2% of total marks
Free Solved Questions with Step-by-Step Solutions
Authentic examination problems with detailed derivations and answer keys.
Question 1
2022 PYQ
Level 3: Exam Standard
A box contains five balls of same size and shape. Three of them are green coloured balls and two of them are orange coloured balls. Balls are drawn from the box one at a time. If a green ball is drawn, it is not replaced. If an orange ball is drawn, it is replaced with another orange ball.
First ball is drawn. What is the probability of getting an orange ball in the next draw?
Question 2
2022 PYQ
Level 2: Moderate
Consider the following two statements with respect to the matrices Am×n, Bn×m, Cn×n and Dn×n.
where tr() represents the trace of a matrix. Which one of the following holds?
Question 3
2022 PYQ
Level 3: Exam Standard
Which of the following statements is/are TRUE for a group G?
Question 4
2022 PYQ
Level 3: Exam Standard
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,
the reversed linked list should look like
Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1) space?
Question 5
2022 PYQ
Level 3: Exam Standard
Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h1 and h2. Further suppose our hashing scheme uses h1 for the odd keys and h2 for the even keys. What is the expected number of keys in a slot?
Question 6
2022 PYQ
Level 3: Exam Standard
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
int x = 1, z[2] = {10, 11};
int *p = NULL;
p = &x;
*p = 10;
p = &z[1];
*(&z[0] + 1) += 3;
printf("%d, %d, %d\n", x, z[0], z[1]);
return 0;
}
Question 7
2022 PYQ
Level 3: Exam Standard
Which one of the following facilitates transfer of bulk data from hard disk to main memory with the highest throughput?
Question 8
2022 PYQ
Level 3: Exam Standard
Let WB and WT be two set associative cache organizations that use LRU algorithm for cache block replacement. WB is a write back cache and WT is a write through cache. Which of the following statements is/are FALSE?
Question 9
2022 PYQ
Level 3: Exam Standard
A cache memory that has a hit rate of 0.8 has an access latency 10 ns and miss penalty 100 ns. An optimization is done on the cache to reduce the miss rate. However, the optimization results in an increase of cache access latency to 15 ns, whereas the miss penalty is not affected. The minimum hit rate (<i>rounded off to two decimal places</i>) needed after the optimization such that it should not increase the average memory access time is _____________.
Question 10
2022 PYQ
Level 3: Exam Standard
Consider an enterprise network with two Ethernet segments, a web server and a firewall, connected via three routers as shown below.
What is the number of subnets inside the enterprise network?
Question 11
2022 PYQ
Level 3: Exam Standard
Consider the resolution of the domain name <code>www.gate.org.in</code> by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is_____________.
Question 12
2022 PYQ
Level 3: Exam Standard
Consider routing table of an organization’s router shown below:
Subnet Number
Subnet Mask
Next Hop
12.20.164.0
255.255.252.0
R1
12.20.170.0
255.255.254.0
R2
12.20.168.0
255.255.254.0
Interface 0
12.20.166.0
255.255.254.0
Interface 1
default
R3
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
Question 13
2022 PYQ
Level 3: Exam Standard
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
Question 14
2022 PYQ
Level 3: Exam Standard
Which of the following statements is/are TRUE?
Question 15
2022 PYQ
Level 3: Exam Standard
Which of the following is/are undecidable?
Question 16
2022 PYQ
Level 3: Exam Standard
Consider the following threads, T1, T2, and T3 executing on a single processor, synchronized using three binary semaphore variables, S1, S2, and S3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.
T1
T2
T3
while(true){ wait(S3); print(“C”); signal(S2); }
while(true){ wait(S1); print(“B”); signal(S3); }
while(true){ wait(S2); print(“A”); signal(S1); }
Which initialization of the semaphores would print the sequence BCABCABCA….?
Question 17
2022 PYQ
Level 3: Exam Standard
Which of the following statements is/are TRUE with respect to deadlocks?
Question 18
2022 PYQ
Level 4: Challenger
Consider four processes P, Q, R, and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t=0. There is exactly one context switch from S to Q, exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is <b>NOT</b> possible as CPU burst time (in time units) of these processes?
Question 19
2022 PYQ
Level 3: Exam Standard
In a relational data model, which one of the following statements is TRUE?
Question 20
2022 PYQ
Level 3: Exam Standard
Consider the following three relations in a relational database.
Which of the following relational algebra expressions return the set of eIds who own all the brands?
Question 21
2022 PYQ
Level 3: Exam Standard
Consider a relation R(A,B,C,D,E) with the following three functional dependencies.
AB→C;BC→D;C→E;
The number of superkeys in the relation R is ____________.
Question 22
2022 PYQ
Level 3: Exam Standard
A function y(x) is defined in the interval [0,1] on the x-axis as
y(x)=⎩⎨⎧231if 0≤x<31if 31≤x<43if 43≤x≤1
Which one of the following is the area under the curve for the interval [0,1] on the x-axis?
Question 23
2022 PYQ
Level 3: Exam Standard
Let r be a root of the equation x2+2x+6=0.
Then the value of the expression (r+2)(r+3)(r+4)(r+5) is
Question 24
2022 PYQ
Level 3: Exam Standard
In a recently conducted national entrance test, boys constituted 65% of those who appeared for the test. Girls constituted the remaining candidates and they accounted for 60% of the qualified candidates.
Which one of the following is the correct logical inference based on the information provided in the above passage?
Question 25
2022 PYQ
Level 3: Exam Standard
Which one of the following statements is TRUE?
Question 26
2022 PYQ
Level 3: Exam Standard
Consider the augmented grammar with {+,∗,(,),id} as the set of terminals.
S′SRP→S→S+R∣R→R∗P∣P→(S)∣id
If I0 is the set of two LR(0) items {[S′→S⋅],[S→S⋅+R]}, then goto(closure(I0),+) contains exactly __________ items.
Question 27
2022 PYQ
Level 3: Exam Standard
Consider the following grammar along with translation rules.
SSTTR→S1#T→T→T1%R→R→id{S.val=S1.val∗T.val}{S.val=T.val}{T.val=T1.val÷R.val}{T.val=R.val}{R.val=id.val}
Here # and % are operators and id is a token that represents an integer and id.val represents the corresponding integer value. The set of non-terminals is {S,T,R,P} and a subscripted non-terminal indicates an instance of the non-terminal.
Using this translation scheme, the computed value of S.val for root of the parse tree for the expression 20#10%5#8%2%2 is_____________.
Question 28
2022 PYQ
Level 3: Exam Standard
Given below are four statements.
Statement 1: All students are inquisitive.
Statement 2: Some students are inquisitive.
Statement 3: No student is inquisitive.
Statement 4: Some students are not inquisitive.
From the given four statements, find the two statements that CANNOT BE TRUE simultaneously, assuming that there is at least one student in the class.
Question 29
2022 PYQ
Level 3: Exam Standard
Some people believe that “what gets measured, improves”. Some others believe that “what gets measured, gets gamed”. One possible reason for the difference in the beliefs is the work culture in organizations. In organizations with good work culture, metrics help improve outcomes. However, the same metrics are counterproductive in organizations with poor work culture.
Which one of the following is the CORRECT logical inference based on the information in the above passage?
Question 30
2022 PYQ
Level 3: Exam Standard
The corners and mid-points of the sides of a triangle are named using the distinct letters P, Q, R, S, T and U, but not necessarily in the same order. Consider the following statements:
• The line joining P and R is parallel to the line joining Q and S. • P is placed on the side opposite to the corner T. • S and U cannot be placed on the same side.
Which one of the following statements is correct based on the above information?
Question 31
2022 PYQ
Level 3: Exam Standard
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters.
From the additional plates given in the options, which one of the combinations of additional plates would allow the player to construct a five-letter palindrome. The player should use all the five plates exactly once. The plates can be rotated in their plane.
Question 32
2022 PYQ
Level 3: Exam Standard
A plot of land must be divided between four families. They want their individual plots to be similar in shape, not necessarily equal in area. The land has equally spaced poles, marked as dots in the below figure. Two ropes, R1 and R2, are already present and cannot be moved.
What is the least number of additional straight ropes needed to create the desired plots? A single rope can pass through three poles that are aligned in a straight line.
Question 33
2022 PYQ
Level 3: Exam Standard
Let R1 and R2 be two 4-bit registers that store numbers in 2’s complement form. For the operation R1+R2, which one of the following values of R1 and R2 gives an arithmetic overflow?
Question 34
2022 PYQ
Level 3: Exam Standard
Consider a digital display system (DDS) shown in the figure that displays the contents of register X. A 16-bit code word is used to load a word in X, either from S or from R. S is a 1024-word memory segment and R is a 32-word register file. Based on the value of mode bit M, T selects an input word to load in X. P and Q interface with the corresponding bits in the code word to choose the addressed word. Which one of the following represents the functionality of P, Q, and T?
Question 35
2022 PYQ
Level 3: Exam Standard
Which one of the following statements is TRUE for all positive functions f(n)?
Question 36
2022 PYQ
Level 3: Exam Standard
Consider a simple undirected weighted graph G, all of whose edge weights are distinct. Which of the following statements about the minimum spanning trees of G is/are TRUE?
Question 37
2022 PYQ
Level 3: Exam Standard
The _________ is too high for it to be considered _________.
Unlock All 65 Questions in Real Examination Mode
Practice with the authentic timer, on-screen calculator, instant percentile ranking, and section-wise analytics.
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Free sample questions from GATE CS 2022 Question Paper
Question 1 · Engineering Mathematics · 2022MCQ
A box contains five balls of same size and shape. Three of them are green coloured balls and two of them are orange coloured balls. Balls are drawn from the box one at a time. If a green ball is drawn, it is not replaced. If an orange ball is drawn, it is replaced with another orange ball.
First ball is drawn. What is the probability of getting an orange ball in the next draw?
A.
21
B.
258
C.
5019
D.
5023
Correct Answer:
D
Step-by-Step Solution
Insight: This is an asymmetric replacement problem requiring the Law of Total Probability over the unknown first draw.
Exam route: Branch into two paths: 1st is Green (prob 3/5, new state 2G, 2O) and 1st is Orange (prob 2/5, new state 3G, 2O). Multiply and sum the path probabilities.
Learning route:
Step 1: Identify initial state: 3 Green (G), 2 Orange (O). Total = 5.
Step 2: Define the two mutually exclusive paths for the first draw.
Path A: First ball is Green.
Probability of Path A: P(1st G) = 3/5.
Rule: Green is not replaced. New state: 2 G, 2 O. Total = 4.
Probability of 2nd Orange given Path A: P(2nd O | 1st G) = 2/4 = 1/2.
Joint probability of Path A: (3/5) * (1/2) = 3/10 = 15/50.
Path B: First ball is Orange.
Probability of Path B: P(1st O) = 2/5.
Rule: Orange is replaced with another Orange. The drawn orange is removed, but another is added, so the count of Orange remains 2, and total remains 5. New state: 3 G, 2 O. Total = 5.
Probability of 2nd Orange given Path B: P(2nd O | 1st O) = 2/5.
Joint probability of Path B: (2/5) * (2/5) = 4/25 = 8/50.
Step 3: Apply the Law of Total Probability.
P(2nd O) = P(Path A) + P(Path B) = 15/50 + 8/50 = 23/50.
Verification: The sum of all path probabilities for the second draw must equal 1. P(2nd G) = (3/5 2/4) + (2/5 3/5) = 15/50 + 12/50 = 27/50. Total = 23/50 + 27/50 = 1. The math is perfectly consistent.
Question 2 · Engineering Mathematics · 2022MCQ
Consider the following two statements with respect to the matrices Am×n, Bn×m, Cn×n and Dn×n.
where tr() represents the trace of a matrix. Which one of the following holds?
A.
Statement 1 is correct and Statement 2 is wrong.
B.
Statement 1 is wrong and Statement 2 is correct.
C.
Both Statement 1 and Statement 2 are correct.
D.
Both Statement 1 and Statement 2 are wrong.
Correct Answer:
C
Step-by-Step Solution
Key idea: This is a trace identity question, recognizable because it tests the cyclic property of the trace operator for matrix products. The trigger is the presence of tr(AB) and tr(BA) for matrices of compatible dimensions.
Step 1: Analyze Statement 1. Let A be an m×n matrix and B be an n×m matrix. The product AB is an m×m matrix, and BA is an n×n matrix. Both traces are well-defined.
Step 2: By definition, tr(AB)=∑i=1m(AB)ii=∑i=1m∑j=1nAijBji.
Step 4: Since scalar multiplication is commutative (AijBji=BjiAij) and finite sums can be swapped, tr(AB)=tr(BA). Statement 1 is correct.
Step 5: Analyze Statement 2. C and D are both n×n matrices. This is a special case of Statement 1 where m=n. Thus, tr(CD)=tr(DC) is also correct.
Step 6: Both statements are universally true for matrices of compatible dimensions.
Answer: Both Statement 1 and Statement 2 are correct. (Option C)
Question 3 · Engineering Mathematics · 2022MSQ
Which of the following statements is/are TRUE for a group G?
A.
If for all x,y∈G, (xy)2=x2y2, then G is commutative.
B.
If for all x∈G, x2=1, then G is commutative. Here, 1 is the identity element of G.
C.
If the order of G is 2, then G is commutative.
D.
If G is commutative, then a subgroup of G need not be commutative.
Correct Answer:
["A","B","C"]
Step-by-Step Solution
Insight: Test each algebraic identity by expanding and cancelling. For small orders, use group classification.
Exam route:
Option A: (xy)2=x2y2⟹xyxy=xxyy. Left-multiply by x−1 and right-multiply by y−1 to get yx=xy. True.
Option B: x2=1⟹x=x−1. Then (xy)−1=y−1x−1=yx. But since xy∈G, (xy)2=1⟹(xy)−1=xy. Thus xy=yx. True.
Option C: ∣G∣=2⟹G={e,a}. The only products are ee,ea,ae,aa, all of which commute. True.
Option D: Subgroups of Abelian groups are always Abelian. The statement "need not be" is False.
Learning route:
For A, expand (xy)(xy)=xxyy. Cancel x on the left: yxy=xyy. Cancel y on the right: yx=xy.
For B, the condition means every element is its own inverse. The inverse of xy is y−1x−1=yx. But xy is also its own inverse, so xy=yx.
For C, a group of order 2 is isomorphic to Z2, which is Abelian.
For D, if ab=ba for all a,b∈G, then for any a,b∈H⊆G, ab=ba still holds.
Question 4 · Programming and Data Structures · 2022MCQ
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,
the reversed linked list should look like
Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1) space?
A.
The best algorithm for the problem takes θ(n) time in the worst case.
B.
The best algorithm for the problem takes θ(nlogn) time in the worst case.
C.
The best algorithm for the problem takes θ(n2) time in the worst case.
D.
It is not possible to reverse a singly linked list in O(1) space.
Correct Answer:
A
Step-by-Step Solution
Insight: This is a linked list reversal complexity question, recognizable because it asks for the time complexity of reversing a singly linked list under a strict O(1) space constraint.
Exam route: Iterative reversal uses 3 pointers and visits each node exactly once, yielding θ(n) time and O(1) space.
Learning route:
Step 1: Understand the constraints. We must reverse a singly linked list of n nodes using only O(1) extra space (i.e., a constant number of pointers, no recursion stack, no auxiliary arrays).
Step 2: Recall the standard iterative reversal algorithm. We maintain three pointers: prev (initially NULL), curr (initially head), and next_temp (initially NULL).
Step 3: Traverse the list. In each iteration, we store curr->next in next_temp, reverse the link by setting curr->next = prev, and then advance prev and curr by one step.
Step 4: Analyze the complexity. The algorithm visits each of the n nodes exactly once, performing a constant number of pointer assignments per node. Therefore, the time complexity is strictly θ(n). The space complexity is O(1) because only three pointers are used.
Question 5 · Programming and Data Structures · 2022MCQ
Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h1 and h2. Further suppose our hashing scheme uses h1 for the odd keys and h2 for the even keys. What is the expected number of keys in a slot?
A.
nm
B.
mn
C.
m2n
D.
2mn
Correct Answer:
B
Step-by-Step Solution
Insight: Simple uniform hashing guarantees that every key independently has a 1/m probability of landing in any specific slot, regardless of the deterministic rule used to pick the hash function.
Exam route: Recognize that any simple uniform hash function distributes keys evenly in expectation. The expected load is simply total keys divided by total slots.
Learning route:
Let Xi,j be an indicator random variable that is 1 if key i hashes to slot j, and 0 otherwise.
Because both h1 and h2 are simple uniform hash functions, for any key k, the probability that it maps to slot j is exactly 1/m, whether it uses h1 or h2.
Thus, E[Xi,j]=1/m for all i∈{1…n}.
The total number of keys in slot j is Yj=∑i=1nXi,j.
By linearity of expectation:
E[Yj]=∑i=1nE[Xi,j]=∑i=1nm1=mn.
Question 6 · Programming and Data Structures · 2022MCQ
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
int x = 1, z[2] = {10, 11};
int *p = NULL;
p = &x;
*p = 10;
p = &z[1];
*(&z[0] + 1) += 3;
printf("%d, %d, %d\n", x, z[0], z[1]);
return 0;
}
A.
1, 10, 11
B.
1, 10, 14
C.
10, 14, 11
D.
10, 10, 14
Correct Answer:
D
Step-by-Step Solution
Insight: This is a pointer tracing question with array indexing, recognizable by mixed pointer assignments and arithmetic on array base addresses.
Exam route: Track x, z[0], and z[1]. p = 10 changes x to 10. (&z[0] + 1) is equivalent to z[1], so z[1] becomes 11 + 3 = 14. z[0] remains 10.
Learning route:
Initial state: x = 1, z[0] = 10, z[1] = 11.
p = &x: p points to x.
*p = 10: The value at p (which is x) is updated to 10.
p = &z[1]: p is redirected to point to z[1]. (This line does not change z[1]'s value, only p's target).
*(&z[0] + 1) += 3:
&z[0] is the address of the first element.
Adding 1 scales by the size of int, yielding the address of the next element, &z[1].
Dereferencing this gives z[1].
z[1] += 3 updates z[1] from 11 to 14.
Final values: x = 10, z[0] = 10, z[1] = 14.
Output matches option D.
Question 7 · Computer Organization and Architecture · 2022MCQ
Which one of the following facilitates transfer of bulk data from hard disk to main memory with the highest throughput?
A.
DMA based I/O transfer
B.
Interrupt driven I/O transfer
C.
Polling based I/O transfer
D.
Programmed I/O transfer
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a conceptual comparison question about I/O transfer mechanisms, recognisable because it asks for the "highest throughput" for "bulk data" among standard I/O techniques.
Step 1: Evaluate Programmed I/O. The CPU must execute a sequence of instructions for every single byte or word transferred. This keeps the CPU 100% occupied with the transfer, resulting in the lowest throughput.
Step 2: Evaluate Polling. Similar to programmed I/O, the CPU continuously checks the device status in a loop, wasting even more cycles when the device is not ready. Throughput remains very low.
Step 3: Evaluate Interrupt-driven I/O. The CPU can do other work while waiting for the device. However, when the device is ready, the CPU still must execute instructions to move each byte from the device interface to memory.
Step 4: Evaluate DMA (Direct Memory Access). The DMA controller takes over the system bus and transfers entire blocks of data directly between the device and main memory without CPU intervention. The CPU is only involved at the start and end. This minimizes overhead and maximizes data transfer rate.
Answer: A
Question 8 · Computer Organization and Architecture · 2022MSQ
Let WB and WT be two set associative cache organizations that use LRU algorithm for cache block replacement. WB is a write back cache and WT is a write through cache. Which of the following statements is/are FALSE?
A.
Each cache block in WB and WT has a dirty bit.
B.
Every write hit in WB leads to a data transfer from cache to main memory.
C.
Eviction of a block from WT will not lead to data transfer from cache to main memory.
D.
A read miss in WB will never lead to eviction of a dirty block from WB.
Correct Answer:
["A","B","D"]
Step-by-Step Solution
Insight: This is a multi-statement write-policy comparison. Evaluate each statement against the fundamental rules of WB and WT.
Exam route:
A: WT does not use dirty bits → FALSE.
B: WB write hit updates cache only, not memory → FALSE.
D: A read miss in WB can evict a dirty block if the set is full → FALSE.
Answer: A, B, D
Learning route:
This is a multi-statement true/false question about write policies, recognisable by the WB vs WT comparison and the "which is/are FALSE" phrasing.
Recall the fundamental rules:
<b>Write-Through (WT):</b> Write hit → update cache AND memory. No dirty bit needed. Eviction → discard (memory is already current).
<b>Write-Back (WB):</b> Write hit → update cache only, set dirty bit. Eviction → writeback to memory if dirty bit = 1.
Now evaluate each statement:
<b>A.</b> "Each cache block in WB and WT has a dirty bit." — WB needs dirty bits, but WT does not (cache and memory are always in sync). <b>FALSE.</b>
<b>B.</b> "Every write hit in WB leads to a data transfer from cache to main memory." — In WB, a write hit updates only the cache and sets the dirty bit. Memory is updated only on eviction. <b>FALSE.</b>
<b>C.</b> "Eviction of a block from WT will not lead to data transfer from cache to main memory." — In WT, memory is always current, so eviction simply discards the line. No writeback. <b>TRUE.</b>
<b>D.</b> "A read miss in WB will never lead to eviction of a dirty block from WB." — A read miss loads a new block. If the target set is full, a replacement occurs. The evicted block may be dirty (if it was previously written). <b>FALSE.</b>
The question asks for FALSE statements: A, B, D.
Question 9 · Computer Organization and Architecture · 2022NAT
A cache memory that has a hit rate of 0.8 has an access latency 10 ns and miss penalty 100 ns. An optimization is done on the cache to reduce the miss rate. However, the optimization results in an increase of cache access latency to 15 ns, whereas the miss penalty is not affected. The minimum hit rate (<i>rounded off to two decimal places</i>) needed after the optimization such that it should not increase the average memory access time is _____________.
Correct Answer:
0.85
Step-by-Step Solution
Key idea: This is a cache optimization AMAT comparison problem. We must calculate the original AMAT, set up an inequality for the new AMAT, and solve for the minimum required hit rate.
Step 1: Calculate the original AMAT.
Original hit rate (Hold) = 0.8 ⟹ miss rate (Mold) = 0.2
Original access latency (Told) = 10 ns
Miss penalty (P) = 100 ns
AMATold=Told+Mold×P
AMATold=10+0.2×100=10+20=30 ns.
Step 2: Set up the equation for the optimized cache.
New access latency (Tnew) = 15 ns
Miss penalty (P) = 100 ns (unaffected)
Let the new hit rate be Hnew. Then the new miss rate is (1−Hnew).
AMATnew=Tnew+(1−Hnew)×P
AMATnew=15+(1−Hnew)×100
Step 3: Apply the optimization constraint.
The optimization should not increase the AMAT, so AMATnew≤AMATold.
15+100×(1−Hnew)≤30
15+100−100×Hnew≤30
115−100×Hnew≤30
115−30≤100×Hnew
85≤100×Hnew
Hnew≥0.85
Step 4: Format the answer.
The minimum hit rate needed is 0.85. Rounded to two decimal places, this is 0.85.
Answer: 0.85
Question 10 · Computer Networks · 2022MCQ
Consider an enterprise network with two Ethernet segments, a web server and a firewall, connected via three routers as shown below.
What is the number of subnets inside the enterprise network?
A.
3
B.
12
C.
6
D.
8
Correct Answer:
C
Step-by-Step Solution
Insight: Each point-to-point link between routers, and each link connecting a router to a LAN or host, constitutes a separate subnet (broadcast domain).
Understand that a subnet is a broadcast domain, and routers do not forward broadcast traffic. Therefore, every interface on a router belongs to a different subnet.
Analyze the diagram to identify all distinct network segments (links):
Link 1: Between the Firewall and the middle Router.
Link 2: Between the middle Router and the left Router.
Link 3: Between the middle Router and the right Router.
Link 4: Between the middle Router and the Web Server.
Link 5: Between the left Router and the left Ethernet segment.
Link 6: Between the right Router and the right Ethernet segment.
Sum the segments: 1+1+1+1+1+1=6 subnets.
Note: The link to the "Internet" is outside the enterprise network, and the question specifically asks for subnets "inside the enterprise network".
Answer: Option C (6).
Question 11 · Computer Networks · 2022NAT
Consider the resolution of the domain name <code>www.gate.org.in</code> by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is_____________.
Correct Answer:
4.00
Step-by-Step Solution
Insight: Count the exact number of query-response pairs generated by the stub resolver and the recursive resolver traversing the hierarchy.
Exam route: The host's stub resolver queries the Local DNS server (1 pair). The Local DNS server then iteratively queries the Root server (1 pair), the TLD server for .in (1 pair), and the Authoritative server for gate.org.in (1 pair). Total = 1 + 3 = 4 pairs.
Learning route: Let us trace the message flow step-by-step for an empty cache using iterative queries.
<b>Host → Local DNS Server:</b> The stub resolver on the host sends a query to its configured Local DNS server. The server responds. (Pair 1)
<b>Local DNS → Root Server:</b> The Local DNS server queries a root server. The root server replies with a referral to the .in TLD servers. (Pair 2)
<b>Local DNS → TLD Server:</b> The Local DNS server queries a .in TLD server. The TLD server replies with a referral to the authoritative servers for .org.in or gate.org.in. (Pair 3)
<b>Local DNS → Authoritative Server:</b> The Local DNS server queries the authoritative server for gate.org.in. The authoritative server replies with the final IP address for www.gate.org.in. (Pair 4)
The Local DNS server then returns this IP to the host (completing the response for Pair 1).
Total query-response pairs involved in completely resolving the name = 4.
Question 12 · Computer Networks · 2022MSQ
Consider routing table of an organization’s router shown below:
Subnet Number
Subnet Mask
Next Hop
12.20.164.0
255.255.252.0
R1
12.20.170.0
255.255.254.0
R2
12.20.168.0
255.255.254.0
Interface 0
12.20.166.0
255.255.254.0
Interface 1
default
R3
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
A.
12.20.164.0/20
B.
12.20.164.0/22
C.
12.20.164.0/21
D.
12.20.168.0/22
Correct Answer:
["B","D"]
Step-by-Step Solution
Insight: This is a route aggregation (supernetting) question, recognizable because it asks to "collectively aggregate" multiple subnets.
Exam route: Convert each subnet to its IP range, then find the minimal set of valid CIDR blocks from the options that cover all these ranges without gaps.
Learning route:
Step 1: Analyze the given subnets.
12.20.164.0 / 255.255.252.0 is a /22. Range: 12.20.164.0 to 12.20.167.255.
12.20.170.0 / 255.255.254.0 is a /23. Range: 12.20.170.0 to 12.20.171.255.
12.20.168.0 / 255.255.254.0 is a /23. Range: 12.20.168.0 to 12.20.169.255.
12.20.166.0 / 255.255.254.0 is a /23. Range: 12.20.166.0 to 12.20.167.255.
Step 2: Check the options for valid CIDR blocks that cover these ranges.
Option A (12.20.164.0/20): Invalid network address. A /20 block must start at a multiple of 16 in the third octet (e.g., 160.0), not 164.0.
Option B (12.20.164.0/22): Valid /22 block. Range: 12.20.164.0 to 12.20.167.255. This perfectly covers the first and fourth subnets.
Option C (12.20.164.0/21): Invalid network address. A /21 block must start at a multiple of 8 (e.g., 160.0 or 168.0), not 164.0.
Option D (12.20.168.0/22): Valid /22 block. Range: 12.20.168.0 to 12.20.171.255. This perfectly covers the second and third subnets (168-169 and 170-171).
Step 3: Combine the valid options.
Using Option B and Option D collectively covers all four subnets (164-167 and 168-171).
Verification: 12.20.164.0/22 covers 164, 165, 166, 167. 12.20.168.0/22 covers 168, 169, 170, 171. Together they cover 164 through 171, which matches all given subnets.
Question 13 · Theory of Computation · 2022MCQ
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
A.
ab∗bab∗+ba∗aba∗
B.
(ab∗b)∗ab∗+(ba∗a)∗ba∗
C.
(ab∗b+ba∗a)∗(a∗+b∗)
D.
(ba∗a+ab∗b)∗(ab∗+ba∗)
Correct Answer:
B
Step-by-Step Solution
Key idea: This is a DFA-to-Regex conversion problem. We can use Arden's Theorem or State Elimination.
Step 1: Write state equations.
Let q0 be start, q1,q2 be finals.
q0=ϵ+q1b+q2a
q1=q0a+q1b (Wait, diagram: q0aq1. q1bq1? No, q1bq0?
Let's trace P3 diagram carefully.
Start -> Left Circle (q0).
q0aq1 (Top Right, Final).
q0bq2 (Bottom Right, Final).
q1bq0.
q1aq1? No, loop on q1 is labeled 'b'?
Diagram:
Left (q0) to Top (q1): 'a'.
Left (q0) to Bottom (q2): 'b'.
Top (q1) to Left (q0): 'b'.
Top (q1) loop: 'a'? No, arrow from q1 to q1?
The SVG shows:
Path from q1 (300,55) curving back to itself? No.
Path from q1 to q2? No.
Path from q1 to q0: 'b'.
Path from q2 to q0: 'a'.
Loop on q1: 'b'? The text 'b' is at (363, 48). The path is a loop on q1.
Loop on q2: 'a'? The text 'a' is at (363, 170). The path is a loop on q2.
So:
q0=ϵ+q1b+q2a
q1=q0a+q1b
q2=q0b+q2a
Step 2: Solve for q1 and q2 using Arden's.
q1=q0a+q1b⟹q1=q0ab∗
q2=q0b+q2a⟹q2=q0ba∗
Step 3: Substitute into q0.
q0=ϵ+(q0ab∗)b+(q0ba∗)a
q0=ϵ+q0(ab∗b+ba∗a)
Let R=ab∗b+ba∗a.
q0=ϵ+q0R⟹q0=R∗=(ab∗b+ba∗a)∗
Step 4: Find Language (q1+q2).
L=q1+q2=q0ab∗+q0ba∗=q0(ab∗+ba∗)
L=(ab∗b+ba∗a)∗(ab∗+ba∗)
Compare with Option B: ((ab∗b)∗ab∗+(ba∗a)∗ba∗)? No.
Option B: (ab∗b)∗ab∗+(ba∗a)∗ba∗. This looks like two separate parts.
Let's check Option D: (ba∗a+ab∗b)∗(ab∗+ba∗).
My result: (ab∗b+ba∗a)∗(ab∗+ba∗).
This matches Option D exactly (order of union doesn't matter).
Answer: D
Question 14 · Theory of Computation · 2022MSQ
Which of the following statements is/are TRUE?
A.
Every subset of a recursively enumerable language is recursive.
B.
If a language L and its complement L are both recursively enumerable, then L must be recursive.
C.
Complement of a context-free language must be recursive.
D.
If L1 and L2 are regular, then L1∩L2 must be deterministic context-free.
Correct Answer:
["B","C","D"]
Step-by-Step Solution
Insight: This is a multi-statement classification question testing the language hierarchy, closure properties, and the bidirectional theorem.
Exam route: Evaluate each option using the hierarchy Regular ⊂ DCFL ⊂ CFL ⊂ Recursive ⊂ RE and known closure properties.
Learning route:
Option A: The language Σ∗ is recursively enumerable (RE). Every RE language is a subset of Σ∗. Since there are RE languages that are not recursive, not every subset of an RE language is recursive. This statement is FALSE.
Option B: This is the Bidirectional Theorem. If both L and L are RE, we can run their recognizers in parallel on the same input. Since every string is in L or L, one recognizer is guaranteed to halt and accept. This parallel execution creates a decider for L, proving L is recursive. This statement is TRUE.
Option C: Context-free languages (CFL) are a proper subset of Recursive languages. The class of Recursive languages is closed under complement. Therefore, the complement of any CFL is guaranteed to be Recursive. This statement is TRUE.
Option D: Regular languages are closed under intersection, so L1∩L2 is Regular. Since every Regular language is also a Deterministic Context-Free Language (DCFL), the intersection must be DCFL. This statement is TRUE.
Question 15 · Theory of Computation · 2022MSQ
Which of the following is/are undecidable?
A.
Given two Turing machines M1 and M2, decide if L(M1)=L(M2).
B.
Given a Turing machine M, decide if L(M) is regular.
C.
Given a Turing machine M, decide if M accepts all strings.
D.
Given a Turing machine M, decide if M takes more than 1073 steps on every string.
Correct Answer:
["A","B","C"]
Step-by-Step Solution
Insight: Rice's theorem makes non-trivial language properties of TMs undecidable. Bounded step properties are decidable because the TM's behavior is confined to a finite prefix of the input.
Exam route: Options A, B, and C are non-trivial language properties of TMs, hence undecidable by Rice's theorem. Option D is bounded by a constant (1073 steps), making it decidable via finite simulation.
Learning route:
Option A: Equivalence of TM languages (L(M1)=L(M2)) is a non-trivial property, undecidable.
Option B: Regularity of a TM language (L(M) is regular) is a non-trivial property, undecidable by Rice's theorem.
Option C: Accepting all strings (ALLTM) is a non-trivial property, undecidable.
Option D: Since 1073 is a constant, a TM can read at most 1073 symbols in 1073 steps. We can simulate the TM on all inputs of length up to 1073 for 1073 steps. This finite simulation decides whether it takes more than 1073 steps on every string.
Question 16 · Operating System · 2022MCQ
Consider the following threads, T1, T2, and T3 executing on a single processor, synchronized using three binary semaphore variables, S1, S2, and S3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.
T1
T2
T3
while(true){ wait(S3); print(“C”); signal(S2); }
while(true){ wait(S1); print(“B”); signal(S3); }
while(true){ wait(S2); print(“A”); signal(S1); }
Which initialization of the semaphores would print the sequence BCABCABCA….?
A.
S1 = 1; S2 = 1; S3 = 1
B.
S1 = 1; S2 = 1; S3 = 0
C.
S1 = 1; S2 = 0; S3 = 0
D.
S1 = 0; S2 = 1; S3 = 1
Correct Answer:
C
Step-by-Step Solution
Insight: This is a semaphore ordering question. The desired output sequence strictly dictates which thread must execute first, which in turn determines the initial values of the semaphores.
Exam route:
The target sequence starts with 'B'. Therefore, T2 must be the first thread to successfully pass its wait() operation.
T2 waits on S1. For T2 to proceed immediately, S1 must be initialized to 1.
After printing 'B', T2 executes signal(S3). This increments S3 to 1, enabling T1 (which waits on S3) to run next and print 'C'.
After printing 'C', T1 executes signal(S2). This increments S2 to 1, enabling T3 (which waits on S2) to run next and print 'A'.
After printing 'A', T3 executes signal(S1), restoring S1 to 1 and resetting the system to its initial state for the next cycle.
Thus, the required initialization is S1 = 1, S2 = 0, S3 = 0.
Learning route:
Step 1: Analyze the dependency chain from the desired output. Output "B → C → A" means T2 → T1 → T3.
Step 2: Map this to semaphore signals. T2 must signal T1, so T2 signals the semaphore T1 waits on (S3). T1 must signal T3, so T1 signals the semaphore T3 waits on (S2). T3 must signal T2, so T3 signals the semaphore T2 waits on (S1).
Step 3: Set initial values. The thread that starts the cycle (T2) must have its waiting semaphore (S1) initialized to 1. All other semaphores (S2, S3) must be 0 to prevent out-of-order execution.
Step 4: Verify the cycle. T2 (S1=1 → 0) prints B, signals S3 (0 → 1). T1 (S3=1 → 0) prints C, signals S2 (0 → 1). T3 (S2=1 → 0) prints A, signals S1 (0 → 1). The cycle repeats perfectly.
Question 17 · Operating System · 2022MSQ
Which of the following statements is/are TRUE with respect to deadlocks?
A.
Circular wait is a necessary condition for the formation of deadlock.
B.
In a system where each resource has more than one instance, a cycle in its wait-for graph indicates the presence of a deadlock.
C.
If the current allocation of resources to processes leads the system to unsafe state, then deadlock will necessarily occur.
D.
In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.
Correct Answer:
["A","D"]
Step-by-Step Solution
Insight: This is a conceptual deadlock properties question. It tests the precise definitions of Coffman conditions, RAG cycles, and safe/unsafe states.
Exam route:
Option A: Circular wait is one of the 4 necessary Coffman conditions. (TRUE)
Option B: In a multi-instance system, a cycle in the Resource Allocation Graph (RAG) is necessary but NOT sufficient for deadlock. The option mentions "wait-for graph". A wait-for graph is typically only used for single-instance resources. If applied to multi-instance, a cycle does not guarantee deadlock. (FALSE)
Option C: An unsafe state means deadlock is possible, not necessary. (FALSE)
Option D: If every edge is an assignment edge, no process is waiting for any resource. Thus, no circular wait can exist. (TRUE)
Learning route:
Step 1: Evaluate Option A. The 4 Coffman conditions (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait) must all hold for deadlock. Thus, circular wait is necessary.
Step 2: Evaluate Option B. For multi-instance resources, a cycle in the RAG only indicates a possibility of deadlock. Wait-for graphs are generally defined for single-instance systems where cycle = deadlock.
Step 3: Evaluate Option C. Safe state ⟹ no deadlock. Unsafe state ⟹ deadlock is possible, but not guaranteed (processes might not request their maximum).
Step 4: Evaluate Option D. Assignment edges mean resources are held. If there are no request edges, no process is waiting, so deadlock is impossible.
Question 18 · Operating System · 2022MCQ
Consider four processes P, Q, R, and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t=0. There is exactly one context switch from S to Q, exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is <b>NOT</b> possible as CPU burst time (in time units) of these processes?
A.
P = 4, Q = 10, R = 6, S = 2
B.
P = 2, Q = 9, R = 5, S = 1
C.
P = 4, Q = 12, R = 5, S = 4
D.
P = 3, Q = 7, R = 7, S = 3
Correct Answer:
D
Step-by-Step Solution
Insight: This is a reverse-engineering question. Given constraints on context switch sequences, deduce which burst time assignment is impossible. The key is to trace the Round Robin execution for each option and count the switches.
Exam route: For each option, trace the Gantt chart with quantum=4. Count the number of each type of switch (S→Q, R→Q, Q→R, S→P). Check which option violates the constraints.
Learning route:
Step 1: Understand the constraints.
Exactly one S→Q switch.
Exactly one R→Q switch.
Exactly two Q→R switches.
No S→P switch.
Termination switches count.
Step 2: Trace Option A: P=4, Q=10, R=6, S=2.
t=0-4: P runs 4. P finishes. Queue: Q,R,S. Switch: P→Q.
Insight: A 2-attribute relation has so few possible non-trivial FDs that BCNF is guaranteed, because any single-attribute determinant that determines the other is automatically a superkey.
Exam route: Enumerate all possible non-trivial FDs for R(A, B) and verify that the determinant is always a superkey.
Learning route:
Step 1: Recall BCNF definition. A relation is in BCNF if for every non-trivial FD X -> Y, X is a superkey.
Step 2: Consider R(A, B) with only two attributes. The only possible non-trivial FDs are A -> B, B -> A, or both.
Step 3: If A -> B holds, then A+ = AB, so A is a superkey. The FD satisfies BCNF.
Step 4: If B -> A holds, then B+ = AB, so B is a superkey. BCNF holds.
Step 5: If both hold, both A and B are superkeys. BCNF holds.
Step 6: If neither holds, BCNF holds vacuously.
Step 7: In all cases, BCNF holds. Option (A) is TRUE.
Step 8: Check other options: (B) is FALSE (counterexample: R(A,B,C) with keys AB, BC and FD C->A; all prime, but C is not a superkey). (C) is FALSE (R(A,B) with A->B and B->A has no non-prime attributes). (D) is FALSE (BCNF decomposition may lose dependency preservation).
Verification: The exhaustive case analysis for 2-attribute relations confirms that BCNF always holds.
Question 20 · Databases · 2022MSQ
Consider the following three relations in a relational database.
Insight: This is a relational division question, recognizable by the phrase "own all the brands", which is the classic "for-all" universal quantification pattern.
Exam route: Identify the standard division operator form and its equivalent expansion using basic operators (Cartesian product and set difference).
Learning route:
Step 1: The goal is to find eId who own every bId present in the Brand relation. This is exactly Own÷Brand.
Step 2: Option A is the direct division expression: ΠeId(ΠeId,bId(Own)/ΠbId(Brand)). This is syntactically and logically correct.
Step 3: Option B is the standard expansion of division using basic operators: Candidates − Failures.
Candidates: ΠeId(Own) (all employees who own at least one brand).
All possible pairs: ΠeId(Own)×ΠbId(Brand).
Missing pairs: (All possible pairs) −ΠeId,bId(Own).
Failures (employees with missing pairs): ΠeId(Missing pairs).
Result: Candidates − Failures. This matches Option B exactly.
Step 4: Option C divides by ΠbId(Own), which only contains brands that are actually owned by someone. If a brand exists in Brand but is owned by no one, Option C would incorrectly ignore it, failing the "all brands" requirement.
Step 5: Option D creates a Cartesian product of ΠeId(Own) and ΠbId(Own), which generates spurious pairs not present in the actual Own relation, corrupting the division logic.
Final Answer: Options A and B are correct.
Question 21 · Databases · 2022NAT
Consider a relation R(A,B,C,D,E) with the following three functional dependencies.
AB→C;BC→D;C→E;
The number of superkeys in the relation R is ____________.
Correct Answer:
8.00
Step-by-Step Solution
Insight: This is a superkey counting question. The fastest route is to find the single candidate key using the L-R-LR-N heuristic, then apply the formula 2n−k.
Exam route: Classify attributes, find the mandatory core, verify it's the only key, and compute 2n−k.
Learning route:
Step 1: Identify the attributes and FDs. R(A,B,C,D,E), FDs: AB→C, BC→D, C→E.
Step 2: Classify attributes using the L-R-LR-N heuristic.
L (Left only): A, B
R (Right only): D, E
LR (Both): C
N (Neither): None
Step 3: The mandatory core for any candidate key is L∪N={A,B}.
Step 4: Compute the closure of the mandatory core: {A,B}+.
Start: {A,B}
Apply AB→C: {A,B,C}
Apply BC→D: {A,B,C,D}
Apply C→E: {A,B,C,D,E}
Since {A,B}+=R, {A,B} is a candidate key.
Step 5: Since the mandatory core {A,B} already determines all attributes, there are no other candidate keys. (Any other key would have to contain {A,B}, making it a superkey, not a minimal candidate key).
Step 6: Count the superkeys. There is exactly 1 candidate key of size k=2 in a relation of size n=5.
Formula: Total Superkeys = 2n−k=25−2=23=8.
Verification: The 8 superkeys are all supersets of {A,B}: {A,B}, {A,B,C}, {A,B,D}, {A,B,E}, {A,B,C,D}, {A,B,C,E}, {A,B,D,E}, {A,B,C,D,E}. The count is exactly 8.
Question 22 · Quantitative Aptitude · 2022MCQ
A function y(x) is defined in the interval [0,1] on the x-axis as
y(x)=⎩⎨⎧231if 0≤x<31if 31≤x<43if 43≤x≤1
Which one of the following is the area under the curve for the interval [0,1] on the x-axis?
A.
65
B.
56
C.
613
D.
136
Correct Answer:
C
Step-by-Step Solution
Insight: The area under a piecewise constant (step) function is simply the sum of the areas of the rectangular blocks it forms.
Exam route: Area = 2(1/3)+3(3/4−1/3)+1(1−3/4)=2/3+5/4+1/4=2/3+6/4=13/6.
Learning route:
The function is constant on three sub-intervals. The area under the curve is the sum of the areas of three rectangles.
Combine the fractions with denominator 4: 5/4+1/4=6/4=3/2.
Add to the first term: 2/3+3/2. The common denominator is 6.
Total Area = 4/6+9/6=13/6.
Wrong path: Miscalculating the width of the second interval (e.g., 3/4−1/3=2/1 due to bad fraction subtraction), or adding the heights instead of multiplying by width, or confusing the interval bounds. Option A (5/6) might come from missing the middle term entirely.
Question 23 · Quantitative Aptitude · 2022MCQ
Let r be a root of the equation x2+2x+6=0.
Then the value of the expression (r+2)(r+3)(r+4)(r+5) is
A.
51
B.
−51
C.
126
D.
−126
Correct Answer:
D
Step-by-Step Solution
Insight: If r is a root of x2+2x+6=0, then r2+2r=−6. We can group the factors of the target expression to form this known polynomial.
Exam route: Group (r+2)(r+3)=r2+5r+6=(r2+2r+6)+3r=3r. Group (r+4)(r+5)=r2+9r+20=(r2+2r+6)+7r+14=7(r+2). Multiply them: 3r⋅7(r+2)=21(r2+2r)=21(−6)=−126.
Learning route:
Step 1: Write the given equation as r2+2r=−6.
Step 2: Expand pairs of the target expression to reveal the polynomial r2+2r+6.
Step 3: (r+2)(r+3)=r2+5r+6=(r2+2r+6)+3r. Since r2+2r+6=0, this simplifies to 3r.
Step 4: (r+4)(r+5)=r2+9r+20=(r2+2r+6)+7r+14. Since r2+2r+6=0, this simplifies to 7r+14=7(r+2).
Step 5: Multiply the simplified parts: 3r×7(r+2)=21r(r+2)=21(r2+2r).
Step 6: Substitute r2+2r=−6 to get 21(−6)=−126.
Question 24 · Quantitative Aptitude · 2022MCQ
In a recently conducted national entrance test, boys constituted 65% of those who appeared for the test. Girls constituted the remaining candidates and they accounted for 60% of the qualified candidates.
Which one of the following is the correct logical inference based on the information provided in the above passage?
A.
Equal number of boys and girls qualified
B.
Equal number of boys and girls appeared for the test
C.
The number of boys who appeared for the test is less than the number of girls who appeared
D.
The number of boys who qualified the test is less than the number of girls who qualified
Correct Answer:
D
Step-by-Step Solution
Insight: Percentages of the qualified pool tell us the boys-vs-girls split among qualifiers directly — no need to know the pass rates.
Exam route: Girls are 60% of qualified ⟹ boys are 40% of qualified. So fewer boys qualified than girls. Option D.
Learning route:
Step 1: Let total appeared =100. Boys appeared =65, girls appeared =35.
Step 2: Girls account for 60% of qualified candidates. Therefore boys account for the remaining 40% of qualified candidates.
Step 3: Compare the options:
A: "Equal number of boys and girls qualified" — false, since 60%=40%.
B: "Equal number of boys and girls appeared" — false, 65=35.
C: "Boys who appeared < girls who appeared" — false, 65>35.
D: "Boys who qualified < girls who qualified" — true, since 40%<60% of the same qualified pool.
Trap warning: Students often try to compute actual numbers of qualifiers, but the pass rates are not given. The inference must come purely from the qualified-pool split.
Verification: Whatever the total qualified count Q is, boys qualified =0.4Q and girls qualified =0.6Q, so boys < girls always holds.
Question 25 · Compiler Design · 2022MCQ
Which one of the following statements is TRUE?
A.
The LALR(1) parser for a grammar G cannot have reduce-reduce conflict if the LR(1) parser for G does not have reduce-reduce conflict.
B.
Symbol table is accessed only during the lexical analysis phase.
C.
Data flow analysis is necessary for run-time memory management.
D.
LR(1) parsing is sufficient for deterministic context-free languages.
Correct Answer:
D
Step-by-Step Solution
Key idea: Evaluate each statement based on formal language theory and compiler design principles.
Step 1: Analyze Option A. LALR(1) parsers are formed by merging states of LR(1) parsers. This merging can introduce reduce-reduce conflicts that were not present in the original LR(1) parser. Thus, Option A is FALSE.
Step 2: Analyze Option B. The symbol table is a central data structure accessed by almost all compiler phases (lexical, syntax, semantic, intermediate code generation, optimization, and code generation), not just lexical analysis. Thus, Option B is FALSE.
Step 3: Analyze Option C. Data flow analysis is a technique used for code optimization (e.g., constant propagation, dead code elimination), not for run-time memory management. Run-time memory management is handled by the run-time system. Thus, Option C is FALSE.
Step 4: Analyze Option D. Deterministic Context-Free Languages (DCFLs) are exactly the class of languages that can be recognized by a Deterministic Pushdown Automaton (DPDA). LR(1) parsing is a deterministic parsing technique that can parse all DCFLs. Thus, Option D is TRUE.
Answer: D
Question 26 · Compiler Design · 2022NAT
Consider the augmented grammar with {+,∗,(,),id} as the set of terminals.
S′SRP→S→S+R∣R→R∗P∣P→(S)∣id
If I0 is the set of two LR(0) items {[S′→S⋅],[S→S⋅+R]}, then goto(closure(I0),+) contains exactly __________ items.
Correct Answer:
5.00
Step-by-Step Solution
Insight: The closure of a set of items where no dot is immediately before a non-terminal is just the set itself. The GOTO operation then shifts the dot past the specified terminal and expands the closure.
Exam route: Recognize that closure(I0) = I0. Filter for the '+' terminal, shift the dot, and count the resulting closure items.
Learning route:
Given I0 = {[S' -> S.], [S -> S.+R]}. Neither item has a dot immediately before a non-terminal, so CLOSURE(I0) = I0.
We need GOTO(I0, +). Filter items in I0 with the dot before '+':
Only [S -> S . + R] matches.
Shift the dot past '+':
[S -> S + . R]
Compute CLOSURE of {[S -> S + . R]}. The dot is immediately before the non-terminal R, so we add all productions of R with the dot at the beginning:
[R -> . R * P]
[R -> . P]
Now the dot is before P in [R -> . P], so we add all productions of P:
[P -> . (S)]
[P -> . id]
The dot is before '(' in [P -> . (S)], which is a terminal. So we do NOT add productions of S.
Total items:
S -> S + . R
R -> . R * P
R -> . P
P -> . (S)
P -> . id
Total = 5 items.
Question 27 · Compiler Design · 2022NAT
Consider the following grammar along with translation rules.
SSTTR→S1#T→T→T1%R→R→id{S.val=S1.val∗T.val}{S.val=T.val}{T.val=T1.val÷R.val}{T.val=R.val}{R.val=id.val}
Here # and % are operators and id is a token that represents an integer and id.val represents the corresponding integer value. The set of non-terminals is {S,T,R,P} and a subscripted non-terminal indicates an instance of the non-terminal.
Using this translation scheme, the computed value of S.val for root of the parse tree for the expression 20#10%5#8%2%2 is_____________.
Correct Answer:
80.00
Step-by-Step Solution
Insight: This is a synthesized attribute evaluation question with left-recursive grammar. The key is to build the unique parse tree dictated by the grammar and evaluate bottom-up.
Exam route: Parse the string using the grammar's associativity rules, then compute values from leaves to root.
Learning route:
Grammar:
S→S1#T {S.val = S1.val * T.val} (Left-associative for #)
S→T {S.val = T.val}
T→T1%R {T.val = T1.val / R.val} (Left-associative for %)
T→R {T.val = R.val}
R→id {R.val = id.val}
Input: 20 # 10 % 5 # 8 % 2 % 2
Since # is only produced by S, and % is only produced by T, the # operators must be at higher levels in the parse tree than % operators. The string is uniquely parsed as:
S→S1#T
Where S1 derives "20 # 10 % 5" and T derives "8 % 2 % 2".
Further parsing of S1:
S1→S2#T2
S2→T3→R→20 (val = 20)
T2→T4%R→10%5 (val = 10 / 5 = 2)
S1.val=S2.val∗T2.val=20∗2=40.
Further parsing of T (right side):
T→T5%R
T5→T6%R→8%2 (val = 8 / 2 = 4)
R→2 (val = 2)
T.val=T5.val/R.val=4/2=2.
Final computation:
S.val=S1.val∗T.val=40∗2=80.
Verification: The grammar enforces left associativity for both # and %. The parse tree is unique. The arithmetic is straightforward: ((20 (10/5)) ((8/2)/2)) = (20 2) (4/2) = 40 * 2 = 80.
Question 28 · Analytical Aptitude · 2022MCQ
Given below are four statements.
Statement 1: All students are inquisitive.
Statement 2: Some students are inquisitive.
Statement 3: No student is inquisitive.
Statement 4: Some students are not inquisitive.
From the given four statements, find the two statements that CANNOT BE TRUE simultaneously, assuming that there is at least one student in the class.
A.
Statement 1 and Statement 3
B.
Statement 1 and Statement 2
C.
Statement 2 and Statement 4
D.
Statement 3 and Statement 4
Correct Answer:
A
Step-by-Step Solution
Insight: "All S are P" and "No S is P" are mutually exclusive; they cannot both be true for a non-empty set.
Exam route: Statement 1 is Type A (All), Statement 3 is Type E (No). A and E are contraries. Select Option A.
Learning route: In categorical logic, assuming the subject class is not empty, the universal affirmative (All students are inquisitive) and the universal negative (No student is inquisitive) cannot both be true. If all are inquisitive, it is false that none are. Statement 2 (Some are) and Statement 4 (Some are not) can both be true simultaneously if only a portion are inquisitive. Therefore, Statements 1 and 3 are the pair that cannot be true simultaneously.
Wrong path: A student might think "Some" means "Some but not all" (everyday language trap), leading them to believe Statements 2 and 4 cannot both be true (Option C). This breaks because in formal logic, "Some" means "at least one" and does not exclude "All". If all are inquisitive, both "Some are" and "Some are not" (wait, if all are, "Some are not" is false. But if some are, then some are not can also be true. The pair 2 and 4 can both be true if the set is partially inquisitive). Generalization: Never assume "Some S are P" implies "Some S are not P" in formal logic. Verification: Statements 1 and 3 directly contradict each other for any non-empty set.
Question 29 · Analytical Aptitude · 2022MCQ
Some people believe that “what gets measured, improves”. Some others believe that “what gets measured, gets gamed”. One possible reason for the difference in the beliefs is the work culture in organizations. In organizations with good work culture, metrics help improve outcomes. However, the same metrics are counterproductive in organizations with poor work culture.
Which one of the following is the CORRECT logical inference based on the information in the above passage?
A.
Metrics are useful in organizations with poor work culture
B.
Metrics are useful in organizations with good work culture
C.
Metrics are always counterproductive in organizations with good work culture
D.
Metrics are never useful in organizations with good work culture
Correct Answer:
B
Step-by-Step Solution
Insight: The passage explicitly states the effect of metrics in good work cultures. Deductive inference requires selecting what must be true based strictly on the text.
Exam route: Scan for "good work culture". The text says "metrics help improve outcomes". This directly means metrics are useful. Match with Option B.
Learning route:
Analyze the passage: The text states, "In organizations with good work culture, metrics help improve outcomes."
Apply the Golden Rule of Deductive Inference: Accept the passage as absolute truth and look for what must be true without adding outside assumptions.
Evaluate options:
Option A claims metrics are useful in poor work culture, but the text says they are "counterproductive".
Option B claims metrics are useful in good work culture, which perfectly matches "help improve outcomes".
Options C and D claim metrics are counterproductive or never useful in good work culture, directly contradicting the text.
Answer is B.
Question 30 · Analytical Aptitude · 2022MCQ
The corners and mid-points of the sides of a triangle are named using the distinct letters P, Q, R, S, T and U, but not necessarily in the same order. Consider the following statements:
• The line joining P and R is parallel to the line joining Q and S. • P is placed on the side opposite to the corner T. • S and U cannot be placed on the same side.
Which one of the following statements is correct based on the above information?
A.
P cannot be placed at a corner
B.
S cannot be placed at a corner
C.
U cannot be placed at a mid-point
D.
R cannot be placed at a corner
Correct Answer:
B
Step-by-Step Solution
Insight: In a triangle, the only way two lines formed by {corners, midpoints} are parallel is if one is a mid-segment (connecting two midpoints) and the other is the side parallel to it (connecting two corners).
Exam route:
Step 1: PR || QS. This means either {P, R} are midpoints and {Q, S} are corners, OR {P, R} are corners and {Q, S} are midpoints.
Step 2: "P is placed on the side opposite to the corner T." This implies T is a corner, and the side containing P is opposite to T.
Step 3: Test Case A: {P, R} are midpoints. Then PR is a mid-segment. It is parallel to the side connecting the two corners not on the sides of P and R. For QS to be parallel to PR, Q and S must be those two corners. Thus, corners = {Q, S, T}. This leaves {P, R, U} as midpoints. But S is a corner, so it belongs to two sides. U is a midpoint, so it must lie on one of those two sides, violating "S and U cannot be placed on the same side". Contradiction.
Step 4: Test Case B: {P, R} are corners. Then PR is a side. For QS to be parallel to PR, QS must be the mid-segment. Thus, {Q, S} are midpoints. This perfectly satisfies all clues: T is the third corner, and S (a midpoint) and U (the remaining midpoint) are on different sides.
Step 5: Conclusion: S must be a midpoint. Therefore, "S cannot be placed at a corner" is definitively true.
Learning route:
Step 1: Recall the geometric constraint: Parallel lines in this context require one mid-segment and one side.
Step 2: Set up the two mutually exclusive cases for {P, R} and {Q, S}.
Step 3: Use the "opposite to corner T" clue to anchor T as a corner and link P to a specific side.
Step 4: Apply the negative constraint "S and U not on same side" to eliminate the case where S is a corner (as it would force U onto a side touching S).
Step 5: Deduce that S must be a midpoint, making the statement "S cannot be placed at a corner" the correct answer.
Question 31 · Spatial Aptitude · 2022MCQ
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters.
From the additional plates given in the options, which one of the combinations of additional plates would allow the player to construct a five-letter palindrome. The player should use all the five plates exactly once. The plates can be rotated in their plane.
A.
B.
C.
D.
Correct Answer:
B
Step-by-Step Solution
Insight: A 5-letter palindrome requires exactly one letter to appear an odd number of times (the middle letter) and all other letters to appear an even number of times (as symmetric pairs).
Exam route: Count the frequency of each letter in the combined set (given plates + option plates).
Given: A, D.
Option A adds D, D, J → Total: A(1), D(3), J(1). Three odd counts. Invalid.
Option B adds R, A, R → Total: A(2), D(1), R(2). Exactly one odd count (D). Valid (forms RADAR).
Option C adds Z, E, D → Total: A(1), D(2), Z(1), E(1). Three odd counts. Invalid.
Option D adds I, L, Y → Total: A(1), D(1), I(1), L(1), Y(1). Five odd counts. Invalid.
Learning route:
Understand the palindrome constraint: For a word of odd length N, the character frequencies must consist of exactly one character with an odd count, and (N−1)/2 characters with even counts.
Tally the given plates: We start with one 'A' and one 'D'.
Evaluate Option B: Adding 'R', 'A', 'R' gives us two 'A's, two 'R's, and one 'D'.
Construct the word: Place the odd-count letter 'D' in the center (position 3). Place the pairs 'A' and 'R' symmetrically at positions (1,5) and (2,4). This yields "RADAR", which reads the same forwards and backwards. The spatial rotation mentioned in the prompt is a permissible transformation that does not change the letter's identity, only its physical orientation on the table.
Question 32 · Spatial Aptitude · 2022MCQ
A plot of land must be divided between four families. They want their individual plots to be similar in shape, not necessarily equal in area. The land has equally spaced poles, marked as dots in the below figure. Two ropes, R1 and R2, are already present and cannot be moved.
What is the least number of additional straight ropes needed to create the desired plots? A single rope can pass through three poles that are aligned in a straight line.
A.
2
B.
4
C.
5
D.
3
Correct Answer:
D
Step-by-Step Solution
Key idea: This is a geometric partitioning problem where we must divide an irregular polygon into 4 similar shapes using the minimum number of additional straight lines (ropes).
Step 1: Analyze the given shape and existing ropes.
The land is a hexagon with equally spaced poles. R1 is a horizontal rope of length 2 units. R2 is a vertical rope of length 2 units.
Step 2: Understand the goal.
We need 4 similar plots. Similarity means they must have the same shape and angles, though their areas can differ.
Step 3: Visualize the partition.
To create 4 similar shapes from this specific hexagon, we need to extend the existing boundaries and create proportional divisions. By adding 3 strategic ropes (e.g., extending R1, extending R2, and adding one diagonal or connecting rope), we can divide the land into 4 regions that are scaled versions of each other.
Step 4: Verify the minimum number.
With 2 additional ropes, we can at most create 3 or 4 regions, but they will not maintain the required similarity in shape. With exactly 3 additional ropes, we can achieve the required 4 similar plots by completing the internal grid that mirrors the outer boundary's proportions.
Answer: D
Question 33 · Digital Logic · 2022MCQ
Let R1 and R2 be two 4-bit registers that store numbers in 2’s complement form. For the operation R1+R2, which one of the following values of R1 and R2 gives an arithmetic overflow?
A.
R1 = 1011 and R2 = 1110
B.
R1 = 1100 and R2 = 1010
C.
R1 = 0011 and R2 = 0100
D.
R1 = 1001 and R2 = 1111
Correct Answer:
B
Step-by-Step Solution
Insight: Overflow in 2's complement only occurs when adding two numbers of the same sign yields a result with a different sign.
Exam route:
Check the sign bits (MSB) of R1 and R2.
A) 1011 (-), 1110 (-). Same sign. Sum = 11001 → 1001 (-). No overflow.
B) 1100 (-), 1010 (-). Same sign. Sum = 10110 → 0110 (+). OVERFLOW.
C) 0011 (+), 0100 (+). Same sign. Sum = 0111 (+). No overflow.
D) 1001 (-), 1111 (-). Same sign. Sum = 11000 → 1000 (-). No overflow.
Learning route:
In a 4-bit 2's complement system, the range is -8 to +7. Overflow happens if the true mathematical sum exceeds this range.
The golden rule for detection: Overflow can ONLY happen when adding two numbers of the same sign. If the operands have the same sign, but the result's sign bit is different, overflow has occurred.
Let's evaluate the options:
A) R1 = 1011 (-5), R2 = 1110 (-2). Both negative. Sum = -7. Binary: 1011 + 1110 = 11001. Discard carry → 1001 (-7). Sign matches. Valid.
B) R1 = 1100 (-4), R2 = 1010 (-6). Both negative. True sum = -10 (out of range). Binary: 1100 + 1010 = 10110. Discard carry → 0110 (+6). Two negatives gave a positive. OVERFLOW.
C) R1 = 0011 (+3), R2 = 0100 (+4). Both positive. Sum = +7. Binary: 0011 + 0100 = 0111 (+7). Sign matches. Valid.
Consider a digital display system (DDS) shown in the figure that displays the contents of register X. A 16-bit code word is used to load a word in X, either from S or from R. S is a 1024-word memory segment and R is a 32-word register file. Based on the value of mode bit M, T selects an input word to load in X. P and Q interface with the corresponding bits in the code word to choose the addressed word. Which one of the following represents the functionality of P, Q, and T?
A.
P is 10:1 multiplexer; Q is 5:1 multiplexer; T is 2:1 multiplexer
B.
P is 10:210 decoder; Q is 5:25 decoder; T is 2:1 encoder
C.
P is 10:210 decoder; Q is 5:25 decoder; T is 2:1 multiplexer
D.
P is 1:10 de-multiplexer; Q is 1:5 de-multiplexer; T is 2:1 multiplexer
Correct Answer:
C
Step-by-Step Solution
Insight: The system routes a 16-bit word from either a 1024-word memory (S) or a 32-word register file (R) based on a mode bit M, requiring specific address decoding and data selection hardware.
Exam route:
S requires 10 address bits (210=1024), so P must be a 10-to-210 decoder.
R requires 5 address bits (25=32), so Q must be a 5-to-25 decoder.
T selects between the two 16-bit outputs based on M, making it a 2:1 multiplexer.
Option C matches this hardware configuration perfectly.
Learning route:
Identify address requirements: 1024 words need 10 bits, 32 words need 5 bits.
Decoders convert n-bit addresses to 2n selection lines. Thus, P is 10:210 and Q is 5:25.
A multiplexer selects one of multiple data inputs. T chooses between S and R, so it is a 2:1 MUX.
Option C perfectly matches this hardware configuration.
Question 35 · Algorithms · 2022MCQ
Which one of the following statements is TRUE for all positive functions f(n)?
A.
f(n2)=θ(f(n)2), when f(n) is a polynomial
B.
f(n2)=o(f(n)2)
C.
f(n2)=O(f(n)2), when f(n) is an exponential function
D.
f(n2)=Ω(f(n)2)
Correct Answer:
A
Step-by-Step Solution
Insight: This is an asymptotic verification question. To determine if a statement holds for "all positive functions", we must test it against different function classes: polynomials, exponentials, and decreasing functions.
Exam route:
Test Option A: Let f(n)=nk (a polynomial). Then f(n2)=(n2)k=n2k and f(n)2=(nk)2=n2k. The ratio is exactly 1, so f(n2)=Θ(f(n)2). This holds for all positive polynomials.
Test Option B: Let f(n)=n. Then f(n2)=n2 and f(n)2=n2. The ratio is 1, not 0. Thus, f(n2)=o(f(n)2).
Test Option C: Let f(n)=2n (an exponential). Then f(n2)=2n2 and f(n)2=22n. The ratio is 2n2−2n→∞. Thus, f(n2)=O(f(n)2).
Test Option D: Let f(n)=2−n (a positive decreasing function). Then f(n2)=2−n2 and f(n)2=2−2n. The ratio is 22n−n2→0. Thus, f(n2)=Ω(f(n)2).
Learning route:
The statement must be universally true for the specified class of functions.
For Option A, any positive polynomial f(n)=cknk+⋯+c0 (with ck>0) has the property that f(n2) is dominated by ckn2k and f(n)2 is dominated by ck2n2k. Since both are Θ(n2k), their ratio approaches a non-zero constant (1/ck), proving f(n2)=Θ(f(n)2).
Options B, C, and D fail because they make universal claims that are easily broken by choosing a specific counterexample from a different function class.
Answer: A
Question 36 · Algorithms · 2022MSQ
Consider a simple undirected weighted graph G, all of whose edge weights are distinct. Which of the following statements about the minimum spanning trees of G is/are TRUE?
A.
The edge with the second smallest weight is always part of any minimum spanning tree of G.
B.
One or both of the edges with the third smallest and the fourth smallest weights are part of any minimum spanning tree of G.
C.
Suppose S⊆V be such that S=ϕ and S=V. Consider the edge with the minimum weight such that one of its vertices is in S and the other in V∖S. Such an edge will always be part of any minimum spanning tree of G.
D.
G can have multiple minimum spanning trees.
Correct Answer:
["A","B","C"]
Step-by-Step Solution
Insight: Distinct edge weights guarantee a unique MST, and Kruskal's algorithm rejects an edge only if it forms a cycle with strictly lighter edges.
Exam route: Since weights are distinct, the MST is unique (D is false). e1 and e2 can form at most one cycle, rejecting at most one of e3 or e4, so at least one must be in the MST (B is true). e2 cannot form a cycle with e1 alone (A is true). The minimum weight edge crossing any cut is always in the MST (C is true). Select A, B, C.
Learning route:
Step 1: Analyze the distinct weights condition. Since all edge weights are distinct, the Minimum Spanning Tree (MST) of the graph is strictly unique. There are no ties to break. This immediately makes statement D ("G can have multiple minimum spanning trees") FALSE.
Step 2: Evaluate the smallest edges. Let the edges sorted by weight be e1<e2<e3<e4… By Kruskal's algorithm, e1 is always included.
Step 3: Evaluate e2. Can e2 form a cycle with e1? No, because a cycle requires at least 3 edges in a simple graph. Thus, e2 will never be rejected by Kruskal's and is always in the MST. Statement A is TRUE.
Step 4: Evaluate e3 and e4. For an edge to be rejected by Kruskal's, it must form a cycle with edges already accepted into the MST. The only edges lighter than e3 and e4 are e1 and e2. These two edges can form at most one path of length 2 (if they share a vertex). Therefore, they can form a cycle with at most ONE additional edge (the one closing the triangle).
Step 5: Since e1 and e2 can only cause the rejection of at most one edge, they cannot cause the rejection of BOTH e3 and e4. Thus, at least one of e3 or e4 must be accepted into the MST. Statement B is TRUE.
Step 6: Evaluate the cut property. Statement C describes exactly the Cut Property: the minimum weight edge crossing any cut (S,V∖S) is always safe and belongs to the MST. Statement C is TRUE.
Tempting wrong path: Assuming that because e1 and e2 are in the MST, they might somehow block both e3 and e4. This fails because two edges can only close one specific cycle, leaving the other edge free to be added.
Verification: If e1=(u,v) and e2=(v,w), they form a path u−v−w. Only the edge (u,w) can form a cycle with them. If e3=(u,w), it is rejected, but e4 will be accepted. If e3=(u,w), both e3 and e4 are accepted. In all cases, at least one is accepted.
Question 37 · Verbal Aptitude · 2022MCQ
The _________ is too high for it to be considered _________.
A.
fair / fare
B.
faer / fair
C.
fare / fare
D.
fare / fair
Correct Answer:
D
Step-by-Step Solution
Insight: This is a classic homophone and commonly confused words question, testing the distinction between "fare" (price) and "fair" (just/reasonable).
Exam route: The sentence needs a noun for the first blank (something that can be "too high") and an adjective for the second blank (a judgment of that thing). "Fare" is the price charged for a journey. "Fair" means just or reasonable. "The fare is too high for it to be considered fair."
Learning route:
Step 1: Analyze the grammatical and logical requirements of the blanks. The first blank is the subject, requiring a noun representing a cost or value. The second blank follows "considered", requiring an adjective describing a judgment of that cost.
Step 2: Define the candidate words. "Fare" (noun): The money a passenger on public transportation has to pay. "Fair" (adjective): Treating people equally without favouritism; just or reasonable.
Step 3: Test the combinations. "fair / fare" places an adjective in the noun slot. "faer" is not a standard English word. "fare / fare" makes no logical sense. "fare / fair" creates a logically sound sentence: "The fare (price) is too high for it to be considered fair (reasonable)."