Distance between two stations A and B is 842 km. A train covers the journey from A to B at 74 km per hour and returns back to A with a uniform speed of 46 km per hour. Find the average speed of the train during the whole journey.
48.12 kmph
56.73 kmph
67.42 kmph
58.42 kmph
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Three numbers are in ratio 1:2:3 and their H.C.F is 12. The numbers are:
6; 12; 18
12; 24; 32
11; 22; 33
12; 24; 36
Correct Answer
Option 4
Solution
Since the numbers are given in the form of ratio that means, their common factor have been cancelled.
Each one’s common factor is HCF, here H.C.F = 12
The numbers are 12, 24, 36.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
16, 36, 72, 144, 196, 225
From these series find the odd number:
16
36
72
196
Correct Answer
Option 3
Solution
Other than 72 remaining all are perfect squares.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
The ratio of the circumferences of two circles is 4:5. What is the ratio of their areas?
2:3
5:6
4:5
2:5
Correct Answer
Option 3
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Two vessels A and B contain 57.5% and 72.5% of alcohol respectively. If 2 litres from vessel A is mixed with 4 litres from vessel B, the ratio of alcohol and water in the resulting mixture is
27:13
39:14
12:13
1:2
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A person buys an article at Rs. 750. At what price should he sell the article so as to make a profit of 20%?
300
150
450
900
Correct Answer
Option 4
Solution
Cost price = Rs. 750
Profit = 20% of 750 = Rs. 150
Selling price = 750 + 150 = Rs. 900
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
_______ is the action of asking something humbly.
Application
Supplication
Germination
Segregation
Correct Answer
Option 2
Solution
Application is the action of putting something into action.
Supplication is the action of asking something humbly.
Germination is the development of a plant from a seed.
Segregation is the action of setting something or someone apart from others.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What is the idiom for ' not speaking precisely or to the point'?
Beating around the bush
Over the moon
Bite the bullet
Break a leg
Correct Answer
Option 1
Solution
Beating around the bush means not speaking precisely or to the point.
Over the moon means extremely happy or
delighted.
Bite the bullet means to get something over because it's inevitable.
Break a leg means good luck.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
The house upon the rock ______ firm.
stand
stood
standing
stands
Correct Answer
Option 2,3
Solution
In present tense the sentence is ' The house upon the rock stands firm.'
In the past tense the sentence is ' The house upon the rock stood firm.'
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
When all shapes given are connected in the corresponding edges (X to X, Y to Y and etc.)
The complete shape looks like shape:
1
2
3
4
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What will be output if you will compile and execute the following c code? (1 mark)
#include<stdio.h>
int main(){
const int x=25;
int * const p=&x;
*p=2*x;
printf("%d",x);
return 0;
}
25
50
0
Compiler error
Correct Answer
Option 2
Solution
const keyword in c doesn’t make any variable as constant but it only makes the variable as read only. With the help of a pointer we can modify the const variable. In this example pointer p is pointing to the address of variable x. In the following line: int * const p=&x; p is constant pointer while content of p i.e. *p is not constant. *p=2*x put the value 50 at the memory location of variable x.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a snippet of the executing C program:
for(i = 100; i > 0; i /= 3)
3rd value of i printed by above for loop are?
33
11
3
66
Correct Answer
Option 2
Solution
If you execute the above for loop in an executing C code and print the values of i then the for loop will print the values in following sequence:
100, 33, 11, 3, 1
The 3rd one is 11.
i=i/3
First iteration i=100 will be printed as it is.
100/3 = 33 …….. 2nd iteration
33/3= 11 ……….3rd iteration
11/3= 3 ………...4th iteration
3/1 ……………..5th iteration
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Insert 5,4,10,3,9,2,12 in an empty binary search tree (BST) in the sequence,
Which element will be in the lowest level ?
2
5
12
3
Correct Answer
Option 1
Solution
The BST after inserting the elements looks like:
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What will be the output of the following C program? (1 marks)
#include<stdio.h>
int function(unsigned x)
{
int b;
for (b = 0; x != 0; x &= (x-1))
b++;
return b;
}
void main()
{
if( function(3)==function(10))
printf("Vaccine\n");
else
printf("Injection\n");
}
Vaccine
Injection
Nothing will print
Compiler error
Correct Answer
Option 1
Solution
/* function:bitcount: count 1 bits in x */
// function(3) and function(10) both will return value as 2 hence if is True
If x is odd, then (x-1) has the same bit representation as x except that the rightmost 1-bit is now a 0. In this case, (x & (x-1)) == (x-1).
If x is even, then the representation of (x-1) has the rightmost zeros of x becoming ones and the rightmost one becoming a zero. Anding the two clears the rightmost 1-bit in x and all the rightmost 1-bits from (x-1).
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Correct choice of data structures can improve the performance of algorithms. (2 marks)
Match the following algorithms with appropriate data structures:
i. Breadth first search a. Heap
ii. Depth first search b. Stack
iii. Sorting c. Queue
i-a ii-b iii-c
i-b ii-a iii-c
i-c ii-b iii-a
i-b ii-c iii-a
Correct Answer
Option 3
Solution
Among the given choices, queue is the most appropriate for BFS, stack for DFS and heap
for sorting.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
If the function lower() returns the lower case of character passed in an argument then what will be correct the expression EXPR? (2 marks)
#include <stdio.h>
int lower(int c) {
return (c >= 'A' && c <= 'Z') ? EXPR : c;
}
int main() {
printf("%c\n", lower('A'));
return 0;
}
c - 'a' + 'A'
c + 'a' - 'A'
c + 'A' - 'a'
c - 'A' - 'a'
Correct Answer
Option 2
Solution
#include <stdio.h>
int lower(int c) {
return (c >= 'A' && c <= 'Z') ? EXPR : c;
}
int main() {
printf("%c\n", lower('A'));
return 0;
}
The ternary expression’s result is returned by lower function.
Condition here says that if c is greater than ‘A’ (or c’s ASCII is greater than ASCII of ‘A’) and c is less than ‘Z’ => This clearly means that if the character c is Upper case then the LHS part of : will be returned. If the condition is false then c itself is getting returned. From this we can assert that the EXPR is the expression which converts Uppercase character to lower case character.
How to do that?(converting Uppercase character to lower case character)
Eg. c==’A’
To convert ‘A’ to ‘a’ if
c + ’a’ - ‘A’ // this will give we result as ‘a’
Hence b option is correct.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
char *a = "";
char b[1] = {0};
char c = 0;
Which among the following statements is correct about the above 3 snippets of code? [MSQ]
a points to an empty string
b is an array of 1 char, containing an empty string
&c points to an empty string
The three lines each define a string containing only a null character
Correct Answer
Option 1,2,3,4
Solution
A string in C is a contiguous sequence of characters in memory, terminated by and including a null character. The characters in strings are accessed through the char data type. There are also wide strings whose characters are accessed through wchar_t objects.
/* The following three lines each define a string containing only a null character */
char *a = ""; /* a points to an empty string */
char b[1] = {0}; /* b is an array of 1 char, containing an empty string */
char c = 0; /* &c points to an empty string */
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Which of the following is not a topological ordering of the following graph ?
123456
132456
132645
324165
Correct Answer
Option 4
Solution
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u v, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG.
3 can not come before 1 and 2
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Which of the following statement(s) is/are TRUE?
P: Adding an edge to a tree will form a loop. Removing an edge of a tree will result in two disconnected subtrees.
Q: Given Graph G, contains distinct edges, and a cycle C in G. The heaviest edge on C is not in the MST of G.
Only P
Only Q
Both P and Q
Neither P and Nor Q
Correct Answer
Option 3
Solution
Based on the example graph, we can claim that both statements are correct.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Find the total number of strongly connected components for a given graph is ____?
2
Correct Answer
Option 1
Solution
A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph is a maximal strongly connected subgraph.
The strongly connected components are
Time complexity is O(V+E) because using DFS
We can find strongly connected components using the Kosaraju algorithm and Trojan’s algorithm. The kosaraju algorithm and Trojan’s algorithm are not required for GATE.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following array A[ ] with 10 elements
A[ 21, 7, 41, 22, 15, 18, 25, 58, 103 , 203 ]
Find the total number of inversions possible for the given array.
[ Hint: Inversion formal definition is two elements A[i] and A[j] form an inversion if A[i] > A[j] and i < j ]
9
Correct Answer
Option 1
Solution
As per the inversion definition, we have to consider the
21 > 7, 21 > 15 , 21 > 18 → 3 inversions
41 > 22, 41 > 15, 41> 18, 41 > 25 → 4 inversions
22 > 15, 22 > 18 → 2 inversions.
15, 18, 25, 58, 103, 203 are in ascending order, so we won’t get single inversion from these elements.
Total= 3 + 4 + 2
= 9
Key points in inversion array:
1. If the array is already sorted then the inversion count is 0.
2. If the array is sorted in reverse order that inversion count is the maximum.
Time Complexity: Using divide and conquer we will get O(n log n).
Space Complexity: No extra space is required for this algorithm.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Let A, B, C, D be four matrices of dimensions 10x5, 5x6, 6x7, 7x9 respectively. Find the maximum number of scalar multiplications required to find the product A B C D using the Matrix Chain Multiplication method is_____?
1350
Correct Answer
Option 1
Solution
The recurrence relation to get minimum number of scalar multiplications are
We can get a maximum of 5 possible parentheses using standard dynamic programming method (or) using catalan numbers.
Given the matrices A,B,C,D
Assume the dimensions of A=d0×d1, etc..,
Below are the five possible parenthesizations of these arrays, along with the number of multiplications:
→ The minimum number of scalar multiplications are 975 and optimal parenthesization is A((BC)D)
→ The maximum number of scalar multiplications are 1350 and optimal parenthesization is ((AB)C)D
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Bob has wanted to send a message to Alice. Bob uses the encrypted message by using given letters along with probabilities of their occurrence.
Letter
A
L
G
O
R
I
T
H
M
Probability
20
18
16
12
10
6
5
2
1
Alice got a message in combination of 1’s and 0’s. Alice needs to apply a hamming code algorithm to understand the given message.
110100110011011110101
Find the decrypted message sent by Bob which considers two consecutive ‘1’ and ‘0’. The consecutive numbers may or may not be in continuous order ____? [ Hint: consider left node as 0 ] [MSQ]
M
I
T
H
Correct Answer
Option 1,2
Solution
Step 1:
Step-2:
Step-3:
Letter
A
L
G
O
R
I
T
H
M
Probability
20
18
16
12
10
6
5
2
1
Codes
01
00
111
101
100
1100
11011
110101
110100
110100 → M
1100 → I
11011 → T
110101 → H
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let P be a Quicksort algorithm to sort numbers in descending order. The quick sort using the last element as pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {10, 15, 3, 9, 30} and {50, 40, 30, 20, 10} respectively. Which one of the following is not the correct relation by using quick sort in the context of time complexities ? [ MSQ ]
t1 = t2
t1< t2
t1 > t2
t1 ⊃ t2
Correct Answer
Option 1,3,4
Solution
The quicksort gives worst case time complexity for two scenarios.
If all the elements are in sorted order
All elements are having the same number.
According to above scenarios t1 gives average case time complexity and t2 also gives worst case time complexity.
→ It would be t1< t2
The best and average case time complexity of quick sort is O(nlogn). The worst case time complexity is O(n^2).
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider a relation R(A,B,C,D,E) and the following functional dependencies:
AB → C
C → D
BD → E
Which of the following is/are super key(s) of R? [MSQ]
AB
ABD
BCD
ACD
Correct Answer
Option 1,2
Solution
(AB)+ = ABCD
AB is the candidate key. Hence, AB, ABC are super keys.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
This Query can be replaced by which one of the following?
SELECT name, course_id
FROM instructor, teaches
WHERE instructor_ID= teaches_ID;
Select name,course_id from teaches,instructor where instructor_id=course_id;
Select name, course_id from instructor natural join teaches;
Select name, course_id from instructor;
Select course_id from instructor join teaches;
Correct Answer
Option 2
Solution
The given SQL query can be replaced by “Select name, course_id from instructor natural join teaches”
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following log sequence:
< T0, start >
< T0, A, 2000, 1950 >
< T0, B, 3000, 3050 >
< T0, commit >
< T1, start >
< T1, C, 1700, 1600 >
What will be the recovery action by immediate modification recovery?
undo T0, redo T1
redo T0, redo T1
redo T0, undo T1
undo T0, undo T1
Correct Answer
Option 3
Solution
Transaction Ti needs to be undone if the log contains the record <Ti start> but does not contain either the record <Ti commit> or the record <Ti abort>.
Transaction Ti needs to be redone if log contains record <Ti start> and either the record <Ti commit> or the record <Ti abort>.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
There are five records in a database.
Name
Age
Occupation
Category
Shiva
Abdul
Dev
Anil
Anand
29
26
28
27
25
Professor 1
Engineer2
Teacher3
Business4
Doctor5
A
A
B
D
C
There is an index file associated with this and it contains the values 4, 5, 2, 1 and 3. Which one of the fields is the index built from?
Age
Name
Occupation
Category
Correct Answer
Option 3
Solution
Indexing will be an occupation field because the occupation field lexicographically sorted will be 4, 5, 2, 1, 3.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider a language L over ∑={a} such that every string in L contains even number (greater than zero) of a’s. The min DFA which accept (L*)* has ________number of states.
2
Correct Answer
Option 1
Solution
Regular expression for even number of a’s (greater than zero) is = aa(aa)*
Now (L*)* = (aa (aa)*)* = (aa)*
The reason is in (aa(aa)*)* if we suppose inner (aa)*=ϵ then (L*)*= (aa)* and (aa)* generates every string present in (aa(aa)*)*.
The minimal DFA is
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following Finite Automata with S as the initial state. Select the correct option.[MSQ]
If S is the only final state then given FA accepts (0+1)*
If F is the only final state then language accepted by FA and language accepted by reversal of FA will be equal.
If S is the only final state then the corresponding minimal DFA equivalent to the given NFA will have two states.
If F is the only final state then the corresponding minimal DFA equivalent to the given NFA will have exactly one state.
Correct Answer
Option 2,3,4
Solution
If S is the only final state then FA accepts only empty string (as initial state is final state), hence minimal DFA requires two states.. If F is the final state then FA accepts (0+1)*, hence minimal DFA requires only one state..
If F is final state then
The reversal of FA is
Both accepts (0+1)*.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following context free grammar and select the correct option with reference to the given CFG. [MSQ]
S ⟶ aSA | a
A⟶ bB
B⟶b
The given grammar is in GNF form
The language generated by the grammar is DCFL.
The grammar generates the language L={a^(n+1) b^2n | n>0}
The grammar is in CNF form
Correct Answer
Option 1,2
Solution
The grammar is in GNF form. The given CFG is equivalent to
S ⟶ aSbb | a
Which generates the language L={a^(n+1) b^2n | n>=0}. Please note grammar generate string “a” also, hence the option that the grammar generates the language L={a^(n+1) b^2n | n>0} is wrong as it generates minimum string “aabb”. The grammar is not in CNF form.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let A= (a, aab, baaa) and B = (aaa, bba, aa) and the alphabet ∑= {a,b} . Then the solution for PCP is _____.
Since the sequence 2,3,1 doesn't match for A and B hence (2,3,1) is not a solution for PCP
Option B: = (2,1,3) It is also not matching
Option C: (1,2,3)
A1 A2 A3: a aab baaa
B1 B2 B3: aaa bba aa
a aab baaa = aaa bba aa
The sequence (1,2,3) matches for A and B hence (1,2,3) is a solution for PCP.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A is decidable (recursive).
A cannot be recursive
Correct Answer
Option 1,2,3
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider the following regular expressions.
R1: (a*b*b*)*
R2: (a*b*+b*)*
Select the correct option:
R1=R2 but both R1 and R2 ≠(a+b)*
R1≠R2 but R1=(a+b)*
R1=R2=(a+b)*
None of these
Correct Answer
Option 3
Solution
As we know (a+b)* = (a*b*)* = (a*+b*)*
R1=R2, both generate same set of strings and both are equal to (a+b)*
R1: (a*b*b*)*
Consider second b*= ϵ
So R1= (a*b*)* which is equal to (a+b)*
R2= (a*b*+b*)*
Consider first b*= ϵ
So R2=(a*+b*)* which is equal to (a+b)*
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following grammars, where {@, id, #} are terminal symbols.
G1:
S→A+A*id
A→ id*A | id
G2:
S→A+id*A
A→idB
B→*idB | ϵ
Select the correct option.
Both are LL(1) grammar.
G2 is LL(1) but G(1) is not LL(1)
Both G1 and G2 are ambiguous
G1 has left factoring and G2 is ambiguous
Correct Answer
Option 2
Solution
G2 is LL(1) hence it cannot be ambiguous
G1 is not LL(1) grammar as it has left factoring.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following Grammar G, whose productions are:
S→P | R
P→ a | t
R→ b | t
where {S, P, R} are set of non-terminals and {a,b,t} are set of terminals. Select the correct option. [MSQ]
Grammar G is LL(1).
Grammar G has two parse trees for a string of length one.
Grammar G is ambiguous
Grammar G is not LR(1)
Correct Answer
Option 2,3,4
Solution
Grammar G is ambiguous as for string “t” it generates two parse trees. Hence it cannot be LL(1) or LR(1).
The two parse trees for string “t” are:
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider the following three address code:
1). t1= i*4
2). t2=a[t1]
3). param t2
4). t3 = call f, 1
5). t4 = t3 *2
6). n=t3
Select the correct expression for which this three address code belongs to:
a[i] = f(n)*2
n=f(a[i])*2
i[a] =f(n)*2
a=f(n[i])*2
Correct Answer
Option 2
Solution
The first two lines compute the value of a[i] and assigns in temporary t2. Line 3 makes t2 an actual parameter for the call of f on line 4. Line 4 calls the function “f” where “1” means number of parameters (here parameter is a[i]) and line 5 multiply 2 into value return by f(a[i]) and line 6 assigns the value of line 5 in “n”.
hence, it is n=f(a[i])*2
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following grammar, where set {a,b,d} are terminals and set {S,A,B} are non-terminals. [MSQ]
S → Aa
A → d | SB
B → ϵ | b
Select the correct option / options.
Given grammar is LL(1).
Given grammar is LR(0) but not LL(1)
Given grammar is SLR(1) but not LR(0).
Given grammar has indirect left recursion.
Correct Answer
Option 3,4
Solution
The given grammar is not LL(1) as productions
A-> d and A->SB will go in the same cell of LL(1) parsing table.
The given grammar is not LR(0) as the production B → ϵ will cause shift -reduce conflict in state I1.
But the given grammar is SLR(1) as B → ϵ will go in follow(B)= {a} only, so there will not be any SR conflict.
Given grammar has productions S->Aa and A -> SB, so it has indirect left recursion.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider a computer system with a 32 bit logical address and 4KB page size. The system supports up to 512MB of physical memory. What is the page table size using a one level conventional page table?
4MB
3MB
2.725MB
2.125MB
Correct Answer
Option 4
Solution
Memory for storing single-level page table = number of pages × number of bits for representing frame.
In a TLB, if 75% of all page-table references are found in the TLBs, what is the effective memory reference time? (Assume that finding a page-table entry in the TLBs takes 2 nanoseconds, if the entry is present, and a memory reference takes 50 nanoseconds)
A system is having 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlock will occur is
3
4
5
6
Correct Answer
Option 2
Solution
Maximum number of units of resource R that ensures deadlock = 1 + 1 + 1 = 3. Therefore, the minimum number of units of resource R that ensures no deadlock = 3 + 1 = 4.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider a process with 4 pages 0,1, 2 and 3. The process accesses pages in the following sequence: 0, 1, 0, 2, 3, 3, 0, 2. Assume that the main memory can hold only 3 out of these 4 pages, is initially empty, and there is no other process executing on the system. Assuming the demand paging system is using an optimal page replacement policy, how many page faults do page accesses above generate?
Consider the information about the following processes :
Process
Arrival
Burst1
IO
Burst2
P1
0
10
0
0
P2
6
3
3
5
P3
9
2
0
0
The CPU utilization using the Shortest Remaining time First (SRTF) Scheduling policy is :
100%
86.95%
95.65%
85.71%
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Binary exponential backoff is a mechanism used in some MAC protocols. Which of the following is true?
It ensures that two nodes that experience a collision in a time slot will never collide with each other when they each retry that packet.
It can be used with slotted aloha but not with carrier sense multiple access.
Over short time scales, it improves the fairness of the throughput achieved by different nodes compared to not using the mechanism.
It ensures that two or more nodes that experience a collision in a time slot will experience a lower probability of colliding with each other when they each retry that packet.
Correct Answer
Option 4
Solution
By binary exponential backoff mechanism, after the collision, if both stations try to send the same frame, their probability of collision will decrease but not guaranteed that collision will never happen. Binary exponential backoff mechanism used in CSMA protocol.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which of the following is incorrect?
In a circuit-switched network, switches require connection establishment and teardown phases, whereas in the packet-switched network doesn’t.
Unlike packet switching, circuit-switched networks do not need any information about the network topology for correct functionality.
Once a connection is correctly established, a switch in the circuit-switched network can forward data directly without requiring data frames to conclude a destination address.
Under some circumstance, a circuit-switched network may prevent some sender from starting a new conversation.
Correct Answer
Option 1
Solution
Since in circuit-switched network before sending any information connection is established. So information about the whole network is needed for starting data transfer.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following statements, when a distance vector routing protocol finding minimum cost paths suffers from count to infinity problem:
S1: The count-to-infinity problem may arise in the distance vector routing protocol when the network gets disconnected.
S2: The count to infinity problem may arise in a distance vector routing protocol even when the network never gets disconnected.
S3: The “path-vector” enhancement to a distance vector routing protocol always enables the protocol to converge without count to infinity.
Which of the following is correct?
Only S1 and S3 are true
Only S2 and S3 are true
Only S2 is true
S1, S2 and S2 are true
Correct Answer
Option 1
Solution
• Count to infinity problem occurs when the network gets disconnected but due to updation problem i.e. Before updation of correct information of disconnected node, some other node trying to send data through the disconnected node. So, count to infinity problem cannot happen in the connected network.
• Path vector routing is an enhancement to distance vector routing since instead of relying on the cost reaching a given destination to determine whether each path available is loop-free or not, we rely on the analysis of the path to reach the destination to learn if it is loop-free or not.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the sliding window protocol used at the transport layer to transfer the segments, the receiver sends “ACK K + 1” when it receives a packet with sequence number “K” and window size is denoted by “W”. Assume the sender’s packets start with sequence number 1. Which of the following is correct about sliding window protocol?
Between two ACK packets, the sender will never send more than one packet.
The sender must retransmit any packets for every single duplicate ACK it receives.
Any new (previously unsent) packet with a sequence number greater than “W” is sent by sender iff a new (previously unseen) ACK arrives.
None of the above
Correct Answer
Option 3
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
The number of integers between 100 to 1000 that have distinct digits
648
Correct Answer
Option 1
Solution
All the required are 3 digit numbers.
To get distinct digit numbers
FIrst position can be filled with {1-9} in 9 ways as 0 cant be in the first position from left
Second position can be filled with 9 digits(excluding the first digit )
Third position can be filled with 8 ways ( excluding the first two digits)
Intotal 9*9*8 = 648 numbers with distinct digits
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
0
1
1/2
Not finite
Correct Answer
Option 4
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
The number of ways of selecting three non negative integers such that their sum is 27 is __
406
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
The chromatic number of the following graph is ___
2
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
The number of ways in which 7 people can be grouped into 3 identical groups is_
365
Correct Answer
Option 1
Solution
Note: Its given identical groups, so whenever its like (5,1,1), there is chance of a peson repeating in second and third group., thus we divide the 7! /5! With 2!
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
The number of asymmetric relations with a set of 3 elements is __
27
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
p=⅓, q=⅙
p=⅙ , q=⅙
p=⅓,q=⅓
p=⅓,q=1/9
Correct Answer
Option 4
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Choose the correctly matched logically equivalent statements [MSQ]
p v ( p ∧ q)≡ p
~( p∧ q)≡ ~p v~q
P v ( q ∧ r) ≡ ( p v q )∧ ( p v r )
( p v q ) v r ≡ p v ( q v r )
Correct Answer
Option 1,2,3,4
Solution
Two statements are logically equivalent if, and only if, their resulting forms are logically equivalent when identical statement variables are used to represent component statements.
Two statement forms are logically equivalent if, and only if, their resulting truth tables are identical for each variation of statement variables.
All the options are part of Logical equivalences.
Associative law:
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
(p v q) v rp v (q v r)
De Morgan’s Law:
~(p ∧ q) ≡ ~p ∨ ~q
~(p ∨ q) ≡ ~p ∧ ~q
Absorption
p ∨ (p ∧ q) ≡ p
p ∧ (p ∨ q) ≡ p
Distributive
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
A 4-way set associative cache consists of a total of 256 blocks. The main memory contains 8192 blocks each with 128 words. How is the address divided as TAG, SET, OFFSET?
7,5,6
7,6,5
5,6,7
7,6,7
Correct Answer
Option 4
Solution
In a set associative cache the address is divided as three parts...(TAG+SET+OFFSET).
In this question it is given that there are 8192 blocks in the main memory and each block is 128 words size,
so size of the main memory = 8192*128 words = 2^13 * 2^7 = 2^20 words.
So the physical address is 20 bits long.
Block size is 128 words = 2^7 words, OFFSET needs 7 bits.
Cache contains 256 blocks and it is a 4-way set associative cache, so no. of sets = 256/4 = 64= 2^6 sets. So the SET field in the address needs 6 bits.
Out of 20 bits of the address TAG bits = 20 - 6- 7 = 7 bits.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
A program is running on a machine which has a total of 500 instructions, average cycles per instruction for the program is 1.8, and CPU clock rate is 2 GHz. The execution time of the program in nanoseconds is___________.
450
400
600
800
Correct Answer
Option 1
Solution
Instruction Count = 500
CPI = 1.8
Clock Rate or frequency = 2 GHz = 2*10^9
Clock Cycle Time = 1/frequency = 1/(2*10^9)= 0.5 ns
Execution Time of the program = No. of instructions * CPI * Clock cycle time
= 500 * 1.8 * 0.5 ns = 450 ns
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a 4-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on this 4-stage pipeline, the speedup achieved with respect to non-pipelined execution if 40% of the instructions incur 2 pipeline stall cycles is ______________________.
1.82
2.82
2.22
3.22
Correct Answer
Option 3
Solution
For 4 stages, non-pipelining takes 4 cycles.
So, CPI in non-pipeline = 4 clock cycles.
There were 2 stall cycles for pipelining for 40% of the instructions
Speed up =CPI Non-pipeline/CPI Pipeline= 4/1.8 = 2.22
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A hard disk is connected to a 20 MHz processor through a DMA controller. Assume that the initial set-up of a DMA transfer takes 500 clock cycles for the processor, and assume that the handling of the interrupt at DMA completion requires 200 clock cycles for the processor. The hard disk has a transfer rate of 1000 Kbytes/sec and the average block transferred is 2K bytes. What percentage of the processor time is consumed by the disk?
1.72
2.46
3.38
4.23
Correct Answer
Option 1
Solution
It is given the hard disk speed is 1000KB/sec
So 2KB can be transferred by this disk in (2/1000)s = 2ms. This is also called data preparation time as the disk keeps the data ready in the I/O buffer for DMA to transfer.
Total cycle required for locking and handling of interrupt after DMA transfer control =(500+200) clock cycle = 700 clock cycles
The speed or frequency of the given processor is 20MHz, so each clock cycle time = 1 / (20 * 10^6) = 0.05 microseconds
Since DMA needs 700 clock cycles to transfer data, time needed= (700 * 0.05 ) = 35 microseconds
Here nothing is mentioned whether DMA works in burst mode or cycle stealing mode, so by default we consider it as burst mode.
In burst mode the fraction of processor time consumed by the disk = DMA transfer time / (DMA transfer time + data preparation time)
= 35 / 2035 = 0.01719. In percentages, it is 1.72%
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
In a 4-way set associative cache, the cache is divided into 16 sets. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered 250 must be mapped to any one of the cache lines from
32 to 47
40 to 43
2 to 17
10 to 13
Correct Answer
Option 2
Solution
Number of sets in cache = 16.
The main memory block numbered 250 will be mapped to set number (250 mod 16) = 10. Since it is a 4-way set associative cache, there are 4 blocks in each set. It is given in the question that the blocks in consecutive sets are sequenced. It means for set-0 the cache lines are numbered 0, 1,2,3 and for set-1, the cache lines are numbered 4,5,6,7 and so on. As the main memory block 250 will be mapped to set (250 mod 16), it will be any one of the cache lines from (250 mod 16)*4 to (250 mod 16)*4+3. So, (250 mod 16)*4 = 40 and (250 mod 16)*4+3 = 43.
Hence the main memory block number 250 will be mapped to set number 10, and within that set the cache line numbers are 40, 41, 42 and 43.
So the main memory block 250 can be mapped to any one of the cache line numbers in 40 to 43.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
If (212)x = (153)8 then the base x is
5
6
7
8
Correct Answer
Option 3
Solution
2x^2 + 1 · x + 2 = 1 × 8^2 + 5 × 8 + 3
2x^2 + x = 105
Roots = 28/4 or – 30/4
= 7 or – 7.5
Base can never be –ve or decimal point.
∴ Base x is 7.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What does the following circuit yield to?
0
1
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the function f(a,b,c) = ab’ + c’. Which of the following statements is true?
f is not functionally complete
f is partially functionally complete by using ‘1’
f is partially functionally complete by using ‘0’
f is functionally complete
Correct Answer
Option 4
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following circuit:
Which of the below state transitions is not possible with the above circuit?
0 -> 3
1 -> 2
3 -> 1
2 -> 2
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
If the receiver received 1011101 with hamming code incorporated with even parity, what did the sender send?