Grand Test 4
Grand Test 4
Grand Test 4
+91 844-844-0102 gatecse@appliedroots.com Importance of the GATE exam PRACTICE TESTS My Account Logout
Correct Answer
Solution: (291)
A C(11,5)
B C(12,5)
Solution: (C)
D C(12,4)
Correct Answer
Solution: (-22)
https://gate.appliedroots.com/report?id=185806 1/35
5/15/2021 GATE CS Applied Course
Correct Answer
Solution: (7.5)
Tt = 1 KB/ 100 KB/sec = .01 sec
0.4 = 1 / 1+ 2a
1+2a= 1 /0.4
1 + 2 Tp/Tt = 1 / 0.4
Tp = 0.0075 sec = 7.5 m sec
Solution: (B)
Set of all the strings of a’s and b’s in which every string ends with b
https://gate.appliedroots.com/report?id=185806 2/35
5/15/2021 GATE CS Applied Course
B Set of all the strings of a’s and b’s in which every string contains a substring ab.
C Set of all the strings of a’s and b’s in which every string starts with a or b and ends with b. Your answer is Wrong
Solution: (D)
Set of all the strings of a’s and b’s in which every string ends with b False
The string like ‘b’ also ends with ‘b’ but is not accepted by the DFA.
Set of all the strings of a’s and b’s in which every string contains a substring ab. Fa;se
Strings like ‘bb’ are also accepted by the DFA but do not contain ab as a substring.
Set of all the strings of a’s and b’s in which every string starts with a or b and ends with b. False
The strings like ‘abb’ also start with ‘a’ and end with ‘b’ but are not accepted by the DFA.
The language accepted by the DFA is set of all the strings that starts with ‘a’ or ‘b’ followed by zero or more occurrences of ‘a’ and ends with ‘b’.
Solution: (-3969)
https://gate.appliedroots.com/report?id=185806 3/35
5/15/2021 GATE CS Applied Course
Solution: (D)
A O(f(n))
B O(g(n))
Solution: (C)
f(n)+h(n)=O(g(n)+O(i(n)), among g(n) and i(n) we know that i(n) is growing faster as g(n)=O(i(n)) hence f(n)+h(n)=O(i(n)).
Solution: (D)
A foo is the function pointer which takes the double pointer and returns the pointer to the integer.
B A function foo is taking the pointer to integer as an argument and returning the integer pointer.
C A function foo is taking the pointer to pointer to an integer as an argument and returning the pointer to Correct Option | Attempted
pointer to an integer.
https://gate.appliedroots.com/report?id=185806 4/35
5/15/2021 GATE CS Applied Course
Solution: (C)
Function foo here is taking the double pointer as the argument, foo is not the function pointer.
A function foo is taking the pointer to pointer to an integer as an argument and returning the pointer to pointer to
an integer.
The nonterminals are URL, PROTO, HOST, I, FILE and G. Then the entries in the LL(1) parse table for [URL,http] and [URL, p] respectively is
C Correct Option
Solution: (C)
B O(nlogn)
C Correct Option
Solution: (C)
The time complexity of Dijkstra's single-source shortest path algorithm when we have an adjacency matrix in the input O(n^2(log(n)).
A 192.123.220.68
Solution: (B)
D None of these
Solution: (C)
Immediate: Operand value is present in the instruction itself (address field)
Direct: The address field contains the address (in main memory) where the operand is stored.
Indirect: The address field refers to the address of a word in the memory, which in-turn contains the address of the operand.
Register Direct: The address field of the operand is a register
https://gate.appliedroots.com/report?id=185806 6/35
5/15/2021 GATE CS Applied Course
Solution: (D)
Solution: (A)
B S1 is False, S2 is True
https://gate.appliedroots.com/report?id=185806 7/35
5/15/2021 GATE CS Applied Course
Solution: (A)
SMTP =25
HTTP =80
DNS =53
POP client = 110
FTP = 21
Correct Answer
Solution: (16)
A 7.5ns
https://gate.appliedroots.com/report?id=185806 8/35
5/15/2021 GATE CS Applied Course
B 8 ns
C 8.5ns
Solution: (D)
A Only I
B Only II
Solution: (C)
Both R and S are set operations compatible and here we are performing set di erence in RA query. In the given SQL query it is mentioned
distinct so that it works like a projection operator only. In the inner query we are performing the set di erence operation using EXCEPT operator
and storing it in resultant relation Z. Therefore, this statement is true.
This statement is also correct because both the queries are retrieving the attributes A, and C a er joining the relations R and S.
D Neither I nor II
A I and II only
https://gate.appliedroots.com/report?id=185806 9/35
5/15/2021 GATE CS Applied Course
Solution: (C)
D I, II and III
Which of the following is the correct characteristic equation of the given flip flop?
A A . Q(n)’ + B’ . Q(n)
Solution: (B)
Based on the given excitation table, the truth table of the given flip flop will be:
https://gate.appliedroots.com/report?id=185806 10/35
5/15/2021 GATE CS Applied Course
The minimal expression obtained from above k-map for Q(n+1) is: A + B’ . Q(n)
Therefore, the correct option is (ii).
C A . Q(n) + B’ . Q(n)’
D A + B’ . Q(n)’
Solution: (C)
https://gate.appliedroots.com/report?id=185806 11/35
5/15/2021 GATE CS Applied Course
Correct Answer
Solution: (9)
If we apply the DP algorithm we get the possible longest common subsequences are
pqpqp
pqrqp
prpqp
prqpq
C Correct Option
https://gate.appliedroots.com/report?id=185806 12/35
5/15/2021 GATE CS Applied Course
Solution: (C)
A 68740 bytes
Solution: (B)
There are 12 block references in an inode, and one single-indirect block that refers to another 512/4 = 128 blocks. So there are a total of 140 blocks.
With 512 bytes per block, the maximum file size is = 140 ×512 = 71680 bytes.
C 74770 bytes
https://gate.appliedroots.com/report?id=185806 13/35
5/15/2021 GATE CS Applied Course
Solution: (A)
B II only
Solution: (429)
https://gate.appliedroots.com/report?id=185806 14/35
5/15/2021 GATE CS Applied Course
Solution: (D)
A 1/2
B 1/3
https://gate.appliedroots.com/report?id=185806 15/35
5/15/2021 GATE CS Applied Course
Solution: (C)
D 1
Correct Answer
Solution: (31)
B Correct Option
Solution: (B)
https://gate.appliedroots.com/report?id=185806 16/35
5/15/2021 GATE CS Applied Course
Solution: (C)
A No conflicts
Solution: (C)
https://gate.appliedroots.com/report?id=185806 17/35
5/15/2021 GATE CS Applied Course
A Livelock
Solution: (C)
The first process acquires the non_mutex and executes the CS. On completion of CS, it tries to acquire the non_mutex again and gets blocked.
And the second process tries to acquire non_mutex, it also gets blocked.
Since both the processes are in their blocked state, it is a deadlock.
Correct Answer
Solution: (13)
https://gate.appliedroots.com/report?id=185806 18/35
5/15/2021 GATE CS Applied Course
A 56 8 11
B 55 7 10 Correct Option
Solution: (B)
Variable e is representing how many times the outer loop will run.
which is 1 , 2 , 4 , 8 ,16, 32, 64 , 128, 256 = 9 times
So d= d + 6 = 7
c= c + 54 = 55
C 72 8 9
Correct Answer
https://gate.appliedroots.com/report?id=185806 19/35
5/15/2021 GATE CS Applied Course
Solution: (27)
A 55555
Solution: (B)
It will print 5 4 3 2 1
C 12345
Solution: (A)
Tally is to calculate the number of something, say votes in this case. Similarly census is the process of counting something, say population.
https://gate.appliedroots.com/report?id=185806 20/35
5/15/2021 GATE CS Applied Course
B taxation : revenue
C government : laws
D team : athletes
A 1/3
B 2/5
C 2/3
Solution: (D)
A 453
Solution: (B)
C 755
https://gate.appliedroots.com/report?id=185806 21/35
5/15/2021 GATE CS Applied Course
In the corporate sector, approximately how many degrees should be there in the central angle?
A 120
B 121
Solution: (C)
D 123
A fragile
Solution: (B)
The meaning of the word sturdy is “strongly and solidly built.” Here it is used as an adjective to describe the old stone farmhouse. Hence the correct
option is b.
C flimsy
https://gate.appliedroots.com/report?id=185806 22/35
5/15/2021 GATE CS Applied Course
C II, I.
Solution: (D)
Rohit does not show mock anger signifies that Rohit is angry as per the statement. (III, II)
Rohit is not angry signifies that Rohit shows mock anger as per the statement. (IV, I)
Hence the correct option is (d).
B Correct Option
Solution: (B)
In each of the response figures, the right halves are dotted, which indicates that the right half of the transparent sheet has been folded and placed over
the le half. Taking into consideration the design on the right half of the sheet, the design formed on the folded sheet will be a combination of the
designs on the two halves. Note here that the mirror image of the design on the right half of the sheet will reach the le half. Clearly option (b) is the
answer.
https://gate.appliedroots.com/report?id=185806 23/35
5/15/2021 GATE CS Applied Course
Solution: (C)
Any angle subtended by a minor arc in the alternate segment is acute and any angle subtended by a major arc in the alternate segment is obtuse.
In the figure below
A 2x
B 3x
Solution: (C)
https://gate.appliedroots.com/report?id=185806 24/35
5/15/2021 GATE CS Applied Course
D 1
B Having completed the physical examination, the tonsils were found to be diseased. Correct Option
Solution: (B)
Option (b) is the correct answer as it indicates the best way of writing with all the sentence formation to be correct.
C When the physical examination was completed, the tonsils were found to be diseased. Your answer is Wrong
A PR -> U
Solution: (B)
Solution: (C)
https://gate.appliedroots.com/report?id=185806 25/35
5/15/2021 GATE CS Applied Course
D PQS -> R
Solution: (A)
Given the entities Living things, Animals, and Plants The relationship of Plants and Animals with Living things is many-to-one. That is many animals
and plants belong to one kind of living thing. Similarly, the relationship of Mammal, Reptiles, Trees, and Flowers is many-to-one with Animal and
Plants respectively.
Therefore, the primary key of Living things will work as foreign key(inherit attributes) for entities Animals and Plants. Similarly the primary keys of
entities Animals and Plants will work as foreign keys(inherit attributes) for Mammal, Reptiles, Trees, and Flowers. Therefore, option (i) and (iii) are
correct which says, entity trees inherit the attributes of entity plants and entity animals inherit attributes of entity living things.
Solution: (C)
Given the entities Living things, Animals, and Plants The relationship of Plants and Animals with Living things is many-to-one. That is many animals
and plants belong to one kind of living thing. Similarly, the relationship of Mammal, Reptiles, Trees, and Flowers is many-to-one with Animal and
Plants respectively.
Therefore, the primary key of Living things will work as foreign key(inherit attributes) for entities Animals and Plants. Similarly the primary keys of
entities Animals and Plants will work as foreign keys(inherit attributes) for Mammal, Reptiles, Trees, and Flowers. Therefore, option (i) and (iii) are
correct which says, entity trees inherit the attributes of entity plants and entity animals inherit attributes of entity living things.
Solution: (A)
Solution: (B)
Solution: (C)
Solution: (D)
A First-come, first-served
Solution: (B)
C Round robin
Solution: (D)
https://gate.appliedroots.com/report?id=185806 27/35
5/15/2021 GATE CS Applied Course
Solution: (A)
Solution: (B)
Solution: (D)
Solution: (A)
B 7 Correct Option
https://gate.appliedroots.com/report?id=185806 28/35
5/15/2021 GATE CS Applied Course
Solution: (B)
Solution: (C)
Solution: (A)
Refer : http://faculty.salina.k-state.edu/tim/ossg/Introduction/sys_calls.html
https://gate.appliedroots.com/report?id=185806 29/35
5/15/2021 GATE CS Applied Course
Solution: (B)
Refer : http://faculty.salina.k-state.edu/tim/ossg/Introduction/sys_calls.html
Solution: (C)
Refer : http://faculty.salina.k-state.edu/tim/ossg/Introduction/sys_calls.html
Solution: (A)
S1 :
TRUE.
A surjection would hit all real numbers, but this hits only the square roots of naturals. It's an injection because every natural has a di erent square
root.
S2 :
FALSE.
There are one-to-one functions that are not onto, but this statement is true if the domain and range are finite sets of the same size.
https://gate.appliedroots.com/report?id=185806 30/35
5/15/2021 GATE CS Applied Course
A The function returns the sum of elements of the linked list which are at even locations. Correct Option | Attempted
Solution: (A)
Since the summation statement is in the if block with the condition i%2==0 the function returns the sum of even elements and the print statement is
present in the else block it prints the odd elements.
B The function returns the sum of elements of the linked list which are at odd locations.
C The function prints the elements of the linked list which are at even locations. Your answer is Wrong
D The function prints the elements of the linked list which are at odd locations. Correct Option
Solution: (D)
Since the summation statement is in the if block with the condition i%2==0 the function returns the sum of even elements and the print statement is
present in the else block it prints the odd elements.
A Persistent connections require less delay for multiple objects in the webpage. Correct Option | Attempted
Solution: (A)
One TCP connection is su icient in the persistent HTTP , not requires the individual TCP connections.
B Individual TCP connections are required for every object in the web page for persistent HTTP. Your answer is Wrong
C Persistent HTTP shows the greatest performance advantage over nonpersistent HTTP when Correct Option | Attempted
downloading a page with more objects.
Solution: (C)
One TCP connection is su icient in the persistent HTTP , not requires the individual TCP connections.
D When the server has finished sending data for all objects referenced by the initially requested page, the Correct Option | Attempted
server closed the connection.
Solution: (D)
One TCP connection is su icient in the persistent HTTP , not requires the individual TCP connections.
A A don’t care in the excitation table indicates that the specific transition will take place irrespective of the Correct Option | Attempted
variable under consideration being 0 or 1.
Solution: (A)
(i) This statement is correct because a don’t care is always considered as either 0 or 1 and can also indicate a specific transition in an excitation table.
(ii) A characteristic equation gives/represents the next state in terms of current state and output and not on the basis of current state (present input).
Therefore, this statement is false.
(iii) A state analysis of a flip flop can either be represented using a state diagram or verbally (text description). Therefore, this statement is true.
(iv) A state analysis table will have both the present state and next state and it depicts the transitions from one state to another in the form of the truth
table. Thus, this statement is also true.
B Characteristic equation of a flip flop is a minimized representation of the next state by considering present input only. Your answer is Wrong
C State analysis results of a flip flop are presented through a state transition diagram or through a text Correct Option | Attempted
description.
Solution: (C)
(i) This statement is correct because a don’t care is always considered as either 0 or 1 and can also indicate a specific transition in an excitation table.
(ii) A characteristic equation gives/represents the next state in terms of current state and output and not on the basis of current state (present input).
Therefore, this statement is false.
(iii) A state analysis of a flip flop can either be represented using a state diagram or verbally (text description). Therefore, this statement is true.
(iv) A state analysis table will have both the present state and next state and it depicts the transitions from one state to another in the form of the truth
table. Thus, this statement is also true.
D The state analysis table lists all the inputs of the flip flop at a given state and finds out the next state Correct Option | Attempted
using flip flop truth table and also notes the final output.
Solution: (D)
(i) This statement is correct because a don’t care is always considered as either 0 or 1 and can also indicate a specific transition in an excitation table.
(ii) A characteristic equation gives/represents the next state in terms of current state and output and not on the basis of current state (present input).
Therefore, this statement is false.
(iii) A state analysis of a flip flop can either be represented using a state diagram or verbally (text description). Therefore, this statement is true.
(iv) A state analysis table will have both the present state and next state and it depicts the transitions from one state to another in the form of the truth
table. Thus, this statement is also true.
A Edges BD and DG are a part of every MST of the graph Correct Option | Attempted
https://gate.appliedroots.com/report?id=185806 32/35
5/15/2021 GATE CS Applied Course
Solution: (A)
C The above graph has more than one MST Correct Option | Attempted
Solution: (C)
A In the IPV4 header the maximum possible value TTL value is 256.
B The identification and the header checksum is of 16 bits in the IPv4 header. Correct Option | Attempted
https://gate.appliedroots.com/report?id=185806 33/35
5/15/2021 GATE CS Applied Course
Solution: (B)
The size of TTL value is 8 bits.Form 8 bits the maximum value is 255
True both id and checksum is of 16 bits.
Excluding options it is 20 bytes which is 160 bits.
HLEN is use to calculate the size of header only.
A The height of the Hu man Tree which is created using the above message is 4 Correct Option
Solution: (A)
Following is one possible Hu man tree for the message
The total number of bits for the message “this is the secret” is 3*3+3*2+3*2+2*3+2*3+4*1+4*1=41.
B The height of the Hu man Tree which is created using the above message is 5 Your answer is Wrong
C The number of bits required to encode the above message using Hu man encoding is 42
https://gate.appliedroots.com/report?id=185806 34/35
5/15/2021 GATE CS Applied Course
close
https://gate.appliedroots.com/report?id=185806 35/35