A car covers its journey at the speed of 60 km/hr in 10 hours. If the same distance is to be covered in 4 hours, by how much the speed of the car will have to increase?
90 km/hr
150 km/hr
120 km/hr
125 km/hr
Correct Answer
Option 1
Solution
Total distance =6010=600 km
New speed =600/4=150 km/hr
Increase in speed =150-60=90 km/hr
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
60.4 m
21.4 m
25.4 m
21.87 m
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
How many seconds will a 600 m long train take to cross a man walking with a speed of 6 km/hr in the direction of the moving train if the speed of the train is 66 km/hr?
25 sec
30 sec
36 sec
42 sec
Correct Answer
Option 3
Solution
Speed of the train relative to man =66-6=60 km/hr
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Let N be the greatest number that will divide 1305, 4665 and 6905 and leave the remainder the same in each case. Then find the sum of the digits in N is:
4
5
6
3
Correct Answer
Option 1
Solution
N = H.C.F of (4665 - 1305), (6905 - 4665) and (6905 - 1305)
N = H.C.F of 3360, 2240 and 5600
N = 1120
Sum of digits in N is = 1 + 1 + 2 + 0 = 4
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A hall is 15m long and 12m broad. If the sum of the areas of the floor and the ceiling is equal to the sum of the areas of four walls, the volume of the wall is:
600m^2
1200m^2
400m^2
800m^2
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Water flows a tank 150m100m through a rectangular pipe 1.0m x 1.2m at the rate of 20kmph. In what time will the water rise by 2 meters?
4/5 hrs
50hrs
75min
5/6m
Correct Answer
Option 3
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What is the Antonym of the word 'Gullible'?
trusting
innocent
naive
discerning
Correct Answer
Option 4
Solution
Gullible means being easily persuaded to believe something.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Money and Position are like a passing cloud.
What is the meaning of the phrase 'passing cloud'?
heavenly
momentary
moving
shaking
Correct Answer
Option 2
Solution
Passing cloud means something that lasts only for a short period of time.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Maya ____ to the airport to say Bye to her Father who was ______ to Italy.
goes, Leave
go, going
went, leaving
going, leaves
Correct Answer
Option 3
Solution
Only Option c) is grammatically correct.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Read the passage and answer the question.
PASSAGE
Some legends are born out of fabled tales, unverifiable but ubiquitous and soaked in tradition. Some legends are as elusive as a dream, or vague as a vignette. The legend of Pradip Kumar Banerjee - the venerable PK to everyone - is, however, selfmade, built on the foundation of a dazzling career as player and coach, and subsequently passed on to generations of illustrious students who have served Indian football with distinction.
Having shepherded East Bengal to 30 trophies and Mohun Bagan to 23, he stood like a colossus for about three decades, bringing the best out of his players and inspiring them to embellish Indian football with performances that are part of Indian football’s folklore.
Born to Prabhat and Bina Banerjee at Maynaguri in Jalpaiguri district in 1936, he was named Pradip as he was the first child to light up the family.
The journey that he began with a Santosh Trophy campaign for Bihar as a 15 year old and went on to illuminate Indian football for about five decades in various capacities, have reached its final destination. A man for all seasons and equipped with extraordinary management skills to transform adversity into antidotes PK will be remembered for his famous vocal tonic - these legendary pre-match pep talks he delivered to inspire players to defy odds.
During the Federation Cup final in 1980, when a depleted and new - look East Bengal entered the Eden Gardens, Star - studded Mohun Bagan were expected to have a cake - walk. But PK pulled off a coup with newcomer Majid Bishkar, campaigning him with 1979 Iranian Revolution leader Ayatollah Khomeri and triggering the birth of a legend around the Iranian himself. It was the stuff folklore is made of. The result was an odds-defying 1-1 draw.
Question:
How did PK Banerjee inspire other players?
By giving physical training
By giving pre-match pep-talks
By inducing hatred against rivals
By assessing the quality of players
Correct Answer
Option 2
Solution
It is given in the passage ‘PK will be remembered for his famous vocal tonic - those legendary pre-match pep talks he delivered to inspire players to defy odds.’
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Suppose cursor points to a node in a linked list (using the node definition with member functions called data and link). What statement changes the cursor so that it points to the next node?
cursor == NULL
cursor->link( ) == NULL
cursor->data( ) == NULL
cursor = cursor->link()
Correct Answer
Option 4
Solution
cursor = cursor->link()
Here cursor-> link() moves the cursor to the next node and that was assigned to cursor itself, hence now it is pointing to the next pointer.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following pseudocode:
declare a stack of characters
while ( there are more characters in the word to read )
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{
write the stack's top character to the screen
pop a character off the stack
}
What is written to the screen for the input "doodles"?
seldood
doodles
lesdood
selodod
Correct Answer
Option 1
Solution
The elements pushed in the stack are d-o-o-d-l-e-s one after the other by first while loop.
In the 2nd while loop the TOP of the stack will be printed until the stack gets empty hence from top to ‘s’ to ‘d’ all characters will be printed. Hence ‘seldood’ will be the answer.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Here is an infix expression: 4+3*(63-12). Suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation. What is the maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression? ____
4
Correct Answer
Option 1
Solution
Character
Operation
Operator Stack
Operand stack
4
Push 4
4
+
Push +
+
4
3
Push 3
4 3
*
Push *
+ *
(
Push (
+ * (
4 3
63
Push 63
+ * (
4 3 63
-
Push -
+ * ( -
4 3 63
12
Push 12
+ * ( -
4 3 63 12
)
Pop operators until ( and pop 2 operands and perform the operation, push result into operand stack again
+ *
4 3 51
Pop * and perform * in 3 and 51, push the result
+
4 153
Pop + and perform addition between 4 and 153
157
In the highlighted section, you can see at one time instance the max number of operators in operator stack are 4
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
What is the meaning of the following declaration?
int(*ptr[5])();
ptr is pointer to function.
ptr is array of pointer to function
ptr is pointer to such function which return type is array.
ptr is pointer to array of function
Correct Answer
Option 2
Solution
Here ptr is array not pointer
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What will be the output of the following program?
#include <stdio.h>
typedef struct { int k; int l; int a[2]; } T;
typedef struct { int i; T t; } S;
T x = {.l = 43, .k = 42, .a[1] = 19, .a[0] = 18 };
// x initialized to {42, 43, {18, 19} }
int main(void)
{
S l = { 1,
.t = x,
.t.l = 41,
.t.a[1] = 17
};
printf(" %d\n", l.t.k);
}
42
43
18
19
Correct Answer
Option 1
Solution
#include <stdio.h>
typedef struct { int k; int l; int a[2]; } T;
typedef struct { int i; T t; } S;
T x = {.l = 43, .k = 42, .a[1] = 19, .a[0] = 18 };
printf("l.t.k is %d\n", l.t.k); // .t = x sets l.t.k to 42 explicitly
// .t.l = 42 would zero out l.t.k implicitly
}
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A Perfect Binary Tree of height h (where height is the number of nodes on path from root to leaf) has :
(2^h) – 1 nodes
(2^h) nodes
(2^(h-1)) – 1 nodes
(2^(h-1)) nodes
Correct Answer
Option 1
Solution
Perfect Binary Tree: A Binary tree is a Perfect Binary Tree in which all internal nodes have two children and all leaves are at the same level.
18
/ \
15 30
/ \ / \
40 50 100 40
A Perfect Binary Tree of height h (where height is the number of nodes on path from root to leaf) has (2^h) – 1 node.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
What will be the output of the following program?
#include<stdio.h>
struct Cricket
{
char team1[20];
char team2[20];
char ground[18];
int result;
}match[4] = {
{"IND","AUS","PUNE",1},
{"IND","PAK","NAGPUR",1},
{"IND","NZ","MUMBAI",0},
{"IND","SA","DELHI",1}
};
void main()
{
struct Cricket *ptr = match;
ptr+=2;
ptr--;
printf("\n%s Vs %s",ptr->team1,ptr->team2);
}
IND Vs AUS
IND Vs PAK
IND Vs NZ
IND Vs SA
Correct Answer
Option 2
Solution
Pointer Variable can also Store the Address of the Structure Variable.
Pointer to Array of Structure stores the Base address of the Structure array.
Pointer Is Declared and initialized as —
struct Cricket *ptr = match
Here the address of match[0] is stored in pointer Variable ptr
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
What will be output if you will compile and execute the following c code? (2 marks)
#include<stdio.h>
int main(){
int a[2][4]={3,6,9,12,15,18,21,24};
printf("%d %d %d",*(a[1]+2),*(*(a+1)+2),2[1[a]]);
return 0;
}
15 18 21
21 21 21
24 24 24
Compiler error
Correct Answer
Option 2
Solution
In c,
a [1][2]
=*(a [1] +2)
=*(*(a+1) +2)
=2[a [1]]
=2[1[a]]
Now, a [1] [2] means 1*(4) +2=6th element of an array
staring from zero i.e. 21.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
A complete n-ary tree is a tree in which nodes have children or no children. Let I be the number of internal nodes and L be the number of leaves in a complete n-ary tree. If L=41, and I=10, what is the value of n?
3
4
5
6
Correct Answer
Option 3
Solution
L =(n-1)I+1 where L= no. of leaf nodes, I= Internal Node
41 = (n-1)10+1
41 = 10n - 10+1
10n= 41-1+10
N = 5
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
In a binary max heap containing n numbers, the smallest element can be found in_____ time.
O(n)
O(log2 n)
O(1)
O(log2 log2 n)
Correct Answer
Option 1
Solution
In a MAX heap the smallest values of the heap will always be present on the last level of heap and time complexity of reaching the last level of heap is O(n).
We have to search all the elements to reach the smallest element and heap using linear search.
To traverse all elements using linear search will take O(n) time.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which of the following statement(s) is/are false
P: The running time of Radix sort is effectively independent of whether the input is already sorted
Q: The running time of RADIX-SORT on an array of n integers in the range 0,1,...,n^5 −1 when using base-10 representation will gives Θ(nlogn) complexity?
Only P
Only Q
Both P and Q
Neither P Nor Q
Correct Answer
Option 4
Solution
P: True. All input orderings give the worst case running time. The running time doesn’t depend on the order of the inputs in any significant way
Q: True: Using base 10, each integer has d = logn^5 = 5 logn digits. Each counting sort call takes Θ(n+10) = Θ(n) time, so the running time of Radix sort is Θ(nd) = Θ(nlogn).
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Suppose we run Dijkstra’s algorithm for a single source shortest path problem on the following edge weighted directed graph starting at vertex S.
P: What is the resulting shortest path tree?
Q: What is the order in which vertices get removed from the priority queue?
Correct Answer
Option 1
Solution
Q: Dijkstra will visit the vertices in the following order: S, C, A, D, F, E, B. Dijkstra will relax the edge from D to E before the edge from F to E, since D is closer to S than F.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
0/1-Knapsack is a well known problem where it is desired to get the maximum total profit by placing n items(each item is having some weight and associated profit) into a knapsack of capacity W. The table given below shows the weights and associated profits for 5 items, where one unit of each item is available to you. It is also given that the knapsack capacity W is 8. If the given 0/1 knapsack problem is solved using Dynamic Programming, which one of the following will be maximum earned profit by placing the items into the knapsack of capacity 8.
Item
1
2
3
4
5
Weight
1
2
4
5
8
Associated Profit
3
5
9
11
18
19
Correct Answer
Option 1
Solution
Here, we can get the first item using profit per weight even if we are using a 0/1 knapsack.
Item
1
2
3
4
5
Weight
1
2
4
5
8
Associated Profit
3
5
9
11
18
Profit/weight
3
2.5
2.25
2.2
2.25
→ According to the above Profit/weight ratio, the item-1 has maximum profit. So, pick item-1.
→ Now M=7, Pick item-2 because it has more profit.
→ Now M=5, Now according to profit/weight ratio we can pick item-3 or item-5 but item-5 has more weight, so it exceeds capacity. If we are selecting item-3 means we are wasting 1 slot. So, here, profit/weight ratio fails. So, follow brute force technique in this position. We can pick item-4 because it has weight 5.
→ Now, M=0 and Profit=19. [item1 + item2 + item4]
Note: In exam time, we have enough time, so cross verify once again your procedure and answer.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Given a set of cities and distance between every pair of cities, The problem is to find the shortest possible route that visits every city exactly once and returns to the starting point is _____?
10
Correct Answer
Option 1
Solution
There may be many possibilities to reach the same city to cover all other cities but the minimum distance is 10. And the shortest possible route is A-C-E-B-D-A
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let M =(Q,∑, 𝞒, 𝞭, q0,𝞫, F) be a standard Turing machine where the symbols have the usual meaning. Let we have a transition
𝛅 (q0, x) ⊢ (q1, y, R)
Select the correct option
Both x and y belongs to 𝞒.
Both x and y belongs to ∑ only.
x belongs to ∑ only and y belongs to 𝞒 only.
x belongs to 𝞒 only and y belongs to ∑ only.
Correct Answer
Option 1
Solution
∑ is alphabet set of the language to be recognized and 𝞒 is set of symbols that can exist on the tape. 𝞒 contains all symbols of ∑ and {𝞫} . Along with this 𝞒 can contain other symbol also. So x and y must belong to 𝞒.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which of the following are decidable? [MSQ]
Whether the intersection of a CFL and a finite regular language is infinite.
Whether a given context-free language is regular.
Whether two deterministic push-down automata accept the same language.
Whether a given grammar is context-free.
Correct Answer
Option 1,3,4
Solution
The given regular language is finite so the intersection must be finite, as only finite strings can be common. Hence, the intersection of a CFL and a finite regular language is always finite, so “whether the intersection of a CFL and a finite regular language is infinite” is trivially decidable.
Equality problem of two DCFL is decidable hence two deterministic push-down automata accept the same language is decidable.
We can check whether the given grammar follows the definition of Type 2 grammar (CFG) hence “Whether a given grammar is context-free” is decidable.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Which one of the following languages over the alphabet {a,b} is described by the regular expression: (a+b)*b(a+b)*b(a+b)*?
The set of all strings containing the substring bb.
The set of all strings containing at most two b’s.
The set of all strings containing at least two b’s.
The set of all strings that begin and end with either a or b.
Correct Answer
Option 3
Solution
The regular expression generates string “bab” hence “set of all strings containing the substring bb” is false.
The regular expression generates string “bbb” hence “set of all strings containing at most two b’s” is false.
The regular expression does not generate string “ab” hence “set of all strings that begin and end with either a or b” is false.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Regular
DCFL but not regular
CFL but not DCFL
CSL but not CFL
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following PDA over ∑={a,b} (Here, A is initial as well as Final state)
Select the correct option :
It will accept {L= a^n | n > 0}
It will accept {L= a^n | n >= 0} ∪ {L= b^n | n >=0}
It will accept {L= an | n > 0} ∪ { a^nbb | n >= 0 }
None of these
Correct Answer
Option 4
Solution
Since initial state is final state and PDA has transitions (a,z0|z0) and (b,z0|z0) as self loop so PDA accepts (a+b)*
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Select the correct options. [MSQ]
The output generated by the loader is the input to the linker.
Linker intakes the object codes generated by the assembler and combines them to generate the executable module.
Loader loads the executable module to the main memory.
The loader has the responsibility of combining all the object modules to generate a single executable file of the source program.
Correct Answer
Option 2,3
Solution
Assembler generates the object module and passes it to the linker. Linker has the responsibility of combining all the object modules to generate a single executable file of the source program. Linker intakes the object codes generated by the assembler and combines them to generate the executable module. The executable module generated by the linker is passed to the loader which allocates space to an executable module in main memory.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following expression,
(p+q) *(p+q-r)
The DAG representation of the above expression contains _______ number of internal nodes.
3
Correct Answer
Option 1
Solution
The DAG for: (p+q) *(p+q-r)
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following SDT , which computes the value of a string of 0’s and 1’s interpreted as positive binary integer.
A-> A1 0 {P}
| A1 1 {Q}
| 1 { R}
Select the correct option with reference to P, Q and R.
Consider a machine having two registers R0 and R1 . Consider the following instructions.
Load Ri , Mj , // Load the value in register Ri from the memory location “j” i.e., Ri = Mj
Op Ri , Ri , Rj // Ri = Ri operator Rj
Op Ri , Ri , Mj // Ri = Ri operator Mj
Load Ri , Rj , // Load the value in register Ri from the register Rj i.e., Ri = Rj
Store Mi , Rj , // store the value in register Ri to the memory Mj i.e., Mj = Ri
In these instructions, Ri is either R0 OR R1 , and Mj is a memory location. The operator op corresponds to an arithmetic binary operator.
Assume each aforementioned instruction incurs a cost of one unit. The minimum units of cost to evaluate the expression (a-b)+c*(d/e) will be _______. Assume all variables are initially present in memory.
7
Correct Answer
Option 1
Solution
There are two ways to evaluate the expression
Case 1: Compute (a-b) first then compute (d/e) and then find c*(d/e) and finally add both.
Load R0,a
SUB R0,R0,b //R0=a-b
Load R1,d
DIV R1,R1,e //R1=d/e
STORE R1,M1 //Store M1=d/e
Load R1,c //R1=c
MUL R1,R1,M1 //R1=c*(d/e)
ADD R0,R0,R1 //R0=R0+R1
Please note instruction 5 store the value of (d/e) in memory as it is required to load “c” into register in order to evaluate c*(d/e) . Hence total 8 cost units.
Case 2: Compute (d/e) first and then c*(d/e) and then (a-b) and finally add both.
Load R0,c //R0=c
Load R1,d //R1=d
DIV R1,R1,e //R1=d/e
MUL R0,R0,R1 //R0=c*(d/e)
Load R1,a
SUB R1,R1,b //R1=a-b
ADD R1,R1,R0 //R1=R1+R0
Minimum total cost is 7 units.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Considerthe following code segment
The number of nodes and edges in the control flow graph of the aforementioned code segment will be ______ and _______ respectively.
8 and 10
12 and 15
6 and 8
None
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Identify type of lock acquire/release rules in growing phase (first phase) in two-phase locking protocol.
can acquire a lock-S on item
can acquire a lock-X on item
can convert a lock-S to a lock-X
can release a lock-S
can release a lock-X
can convert a lock-X to a lock-S
can acquire a lock-S
can release a lock-X
can convert a lock-X to a lock-S
can release a lock-S on item.
can acquire a lock-X on item
can convert a lock-S to a lock-X
Correct Answer
Option 1
Solution
A transaction is said to follow Two Phase Locking protocol if Locking and Unlocking can be done in two phases.
Growing Phase: New locks on data items may be acquired but none can be released.
Shrinking Phase: Existing locks may be released but no new locks can be acquired.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
For a table T, the characteristics of three of its columns are given below.
Column A has unique values
Column B has a wide range of values
Column C contains many nulls and the non-null values are not searched much
Which of these column/s is/are good for indexing? [MSQ]
A
C
There is no potential choice.
B
Correct Answer
Option 1,4
Solution
From the given properties of the columns, only A and B are good for indexing.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Which of the following functional dependencies hold for relations R(A, B, C) and S(B, D, E):
B -> A
A -> C
The relation R contains 300 tuples and the relation S contains 200 tuples. What is the maximum number of tuples possible in the natural join of R and S (R natural join S)
200
300
500
10000
Correct Answer
Option 1
Solution
From the given set of functional dependencies, it can be observed that B is a candidate key of R.
So all 300 values of B must be unique in R.
There is no functional dependency given for S.
To get the maximum number of tuples in output, there can be two possibilities for S.
1) All 200 values of B in S are the same and there is an entry in R that matches with this value. In this case, we get 200 tuples in output.
2) All 200 values of B in S are different and these values are present in R also. In this case also, we get 200 tuples.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider a relation with schema R(A,B,C,D) and FDs {AB -> C, C -> D, D -> A}. What is/are the nontrivial FDs that can be inferred from the given FDs?
C -> ACD, D -> AD
AB -> ABCD, AC -> ACD
BC -> ABCD, BD -> ABCD, BCD -> ABCD
CD -> ACD, ABC -> ABCD, ABD -> ABCD
Correct Answer
Option 1,2,3,4
Solution
If a functional dependency X->Y holds true where Y is not a subset of X then this dependency is called non trivial Functional dependency
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following page reference string: 7,2,3,1,2,5,3,4,6,7,7,1,0,5, 4,6,2,3,0,1. Assume demand paging with 3 frames, how many page faults would occur for the FIFO page replacement algorithm?
14
18
17
13
Correct Answer
Option 3
Solution
A total of 17 page faults occurs for FIFO page replacement algorithm.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a disk queue with requests for cylinders 82,170,43,140,24,16,190. The LOOK scheduling algorithm is used. The head is initially at cylinder number 50. The cylinders are numbered from 0 to 199. The total head movements or the seek operations (in number of cylinders) incurred while servicing these requests is _______.
314
326
318
None
Correct Answer
Option 1
Solution
The total number of seeks obtained using LOOK disk scheduling algorithm is 314.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. The page fault service takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. TLB update time is negligible. The average memory access time in ns is :
Consider the following pseudo‐code for a process Pi, where “shared boolean flag[2]” is a variable declared in shared memory, initialized as: flag[0] = flag[1] = FALSE;
// i=0 for P0, i=1 for P1
P (int i) {
while (TRUE) {
flag[i] = TRUE;
while (flag[(i+1) % 2) == TRUE);
< Critical Section >
flag[i] = FALSE;
< Remainder Section >
}
}
Which of the following is FALSE?
Mutual exclusion is achieved.
Progress is achieved.
The above code uses the spin-lock mechanism.
All of them.
Correct Answer
Option 2
Solution
This solution may result in failure of progress, where neither P0 or P1 can proceed to enter their critical section. This will happen when P0 makes flag[0] = TRUE, and then there is a context switch. P1 makes the flag[1] = TRUE. Now both P0 and P1 will be waiting indefinitely in the while loop before entry to the critical section.
Rest of the statements are true, as the mutual exclusion is achieved. The code uses spin-lock mechanism to check the lock availability. ( while (flag[(i+1) % 2) == TRUE); )
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
The page size in a system is increased while keeping everything else (including the total size of main memory) the same. Which of the following is/are TRUE as a result of this increase in page size [MSQ]
Size of the page table of a process decreases.
Internal fragmentation of main memory increases
TLB hit rate increases
Size of the page table of a process increases.
Correct Answer
Option 1,2,3
Solution
Page table size decreases as we have fewer entries , TLB hit rate increases because of more coverage of memory pages-frames and Internal fragmentation increases as more space is wasted in a page.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider the address 141.14.196.46 and subnet mask 255.255.192.0. Find the subnet id?
141.14.1.46
141.14.192.0
255.255.192.0
None
Correct Answer
Option 2
Solution
Address Id - 10001101.00001110.11000100.00101110
Subnet Mask - 11111111.11111111.11000000.00000000
……………………………………………………………...
Subnet Id - 10001101.00001110.1100000.00000000
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
The transport layer protocols used for TFTP, SNMP, SMTP, RIP?
TCP, TCP, TCP, UDP
UDP, TCP, TCP, UDP
UDP, UDP, TCP, UDP
UDP, UDP, UDP, UDP
Correct Answer
Option 3
Solution
Trivial File Transfer Protocol (TFTP) process includes flow and error control. It can easily use UDP.
• UDP is used for management processes such as SNMP.
• SMTP uses TCP.
• UDP is used for some route updating protocols such as Routing Information Protocol (RIP).
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the flow specification having the maximum packet size 800 bytes, token bucket rate of 8 ×106 bytes/sec. Token bucket size is 2 MB and the maximum transmission rate 16 million bytes/sec.
What is the time for which burst be sent at maximum speed?
0.4 sec
0.25 sec
0.2 sec
0.35 sec
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Assume there are 50 nodes are connected to a 500-meter length of cable. Each node can transmit 25 frames per second and average length of frame is 2000 bits. transmission rate at each node is 10 Mbps. The efficiency of this protocol is ________ (in %).
25
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
The number of distinct possible square matrices of order 2, with each entry x (or) y (or) z is _______
81
Correct Answer
Option 1
Solution
We have three elements { -2,0,2}.
In a square matrix of order 2, we have 2 x 2 = 4 places.
Each of the 4 places can be filled with 3 elements.
So, 3 x 3 x 3 x 3 = 81 distinct matrices we can get.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
If A is an orthogonal matrix of order ‘n’ then determinant of ‘A’ is _______
1
0
-1
±1
Correct Answer
Option 4
Solution
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
LEt a relation R={(b,c),(c,d)} then the number of ordered pairs that must be added to R to make it an equivalence relation is ____
7
Correct Answer
Option 1
Solution
To make it reflexive we must add (b,b),(c,c),(d,d)
To make it symmetric we need to add (c,b),(d,c)
To make it transitive we need to add (b,d),((d,b)
We need to add 7 more ordered pairs to make it equivalence relation
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
In the multiplicative group of {1, – 1, i , – i}, the inverse of the element -i is __
i
1
-1
-i
Correct Answer
Option 4
Solution
If b is inverse of a then a*b = b*a = e where e is identity element
The identity element for the given group is 1.
Thus i*b=1
b= -i
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which of the following are equal to (2x+3y)^2 [MSQ]
Correct Answer
Option 1,3
Solution
Expand the given quadratic equation and expand the given options too then compare
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Randomly 10 distinct letters are given to a student. If words of length 5 need to be formed, then the number of words which have at least one letter repeated is ___
69760
Correct Answer
Option 1
Solution
We can form words of length 5 in 10*10*10*10*10= 10^5 ways.
We can subtract the words that are formed with unique letters from the total, which will yield the word with at least one repeated letter.
i.e we can form words with distinct letters in 10P5 ways.
We require 10^5-10P5 = 69760
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let a function f(x)= sinx+cosx, choose the correct statements [MSQ]
f is increasing on [0, π/4]
f is increasing on (5π/4, 2π)
f is decreasing on (π/4, 5π/4)
f is increasing everywhere
Correct Answer
Option 1,2,3
Solution
The domain of f(x) is restricted to the closed interval [0,2π], and its critical points occur at π/4 and 5π/4. Testing all intervals to the left and right of these values for f′(x) = cos x − sin x, you find that
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Which of the following are tautologies [MSQ]
x(xy)
p(pq)
~(pq)(~r)
(pq) [ (~p)(~q) ]
Correct Answer
Option 1,4
Solution
A tautology results only True for every input
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let Y is a 8-bit signed integer which is represented by using 2’s complement representation. If Y= 0x8A, then 16Y= ____.
0xA56
0xA58
0x8A0
0x856
Correct Answer
Option 3
Solution
Y= 1000 1010
= -128 + 8+2
= -118
16Y= - 2048 + 128 +32
= 1000 1010 0000
= 0x8A0
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following circuit.
Which of the following minimal expressions represent the above circuit?
A(B+C)
A’(B+C)
B+C
None
Correct Answer
Option 3
Solution
The output of the circuit is A(B+C) + (B+C)A’
= (A+A’) (B+C)
= B+C
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following synchronous counter with initial state Q1=Q0=0.
Which of the following is the state of the counter after 4 clock?
Q1=Q0=1
Q1=Q0=0
Q1=1, Q0=0
Q1=0, Q0=1
Correct Answer
Option 2
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following 16-bit floating point format with bias 16.
S
M
E
1 bit
10 bits
5 bits
The bits of implicitly normalized number A are laid out as follows
0
111100 0000
11111
The value of the number A in decimal is _____.
63488
65536
65535
None
Correct Answer
Option 1
Solution
S=0; A is a positive number.
Actual exponent e= Biased exponent - bias
= E-16
= 31-16
= 15
Mantissa M= 11110..0
Value of A= (-1)S x 1.M x 2e.
= +( 1.1111 x 215 ).
= + (11111.0)x 211
= 31 x 2048
= 63488
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider a k x 2^k decoder that is used to uniquely address a byte addressable
1 GB RAM, then the minimum value of k is ____
30
20
1024
log2 20
Correct Answer
Option 1
Solution
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following statements:
S1: A direct mapped cache has less number of conflict misses than a set associative cache of the same size
S2: In a fully associative cache there will not be any block replacement if there is at least one empty block in the cache
Choose the correct option:
Only S1 is true
Only S2 is true
Both S1 and S2 are true
Both S1 and S2 are false
Correct Answer
Option 2
Solution
S1 is false because direct mapped cache has more number of conflict misses compared to set associative cache of the same size.
S2 is true because in a fully associative cache a main memory block can be anywhere in the cache. If there is an empty block in the cache then there will not be any block replacement.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a disk with each sector of 512 bytes, 1000 tracks per surface, 50 sectors per track, five-double sided platters and average seek time of 5 ms.
If T is the capacity of a track in bytes and S is the capacity of each surface in bytes, then (T,S)=______
(25K, 25000K)
(50K, 25000K)
(25K, 50000K)
(50K, 50000K)
Correct Answer
Option 1
Solution
T= size of a track in bytes = number of sectors per track * size of each sector
= 50*512 bytes = 25K bytes
S = size of each surface in bytes = Number of tracks per surface * number of sectors per track * size of each sector = 1000*50*512 bytes = 25,000 K bytes
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider an L1 cache, L2 cache, and main memory. The hit rates and hit times for each are:
80% hit rate, 10 ns hit time for L1.
90% hit rate, 30 ns hit time for L2.
100% hit rate, 200 ns hit time for main memory
If there are a total of 500 memory accesses, how many of these accesses are serviced from L1, L2 and main memory respectively?
(300, 150, 50)
(400, 80, 20)
(400, 90, 10)
(300, 180, 20)
Correct Answer
Option 3
Solution
There are 500 memory accesses.
Hit rate of L1 is 80%, so out of 500 accesses, 0.8*500 = 400 are serviced from L1
L1 miss rate = 1 − 0.8 = 0.2
So, 0.2*500 = 100 accesses which are missed in L1 will go to L2.
But L2 hit rate is 90%, so out of the 100 accesses which come to L2 cache 0.9*100 = 90 are serviced from L2 and the remaining 10 are missed in L2.
The remaining 10 memory accesses which are missed in L2 will be serviced from main memory.
Hence, (400, 90, 10) is the answer.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider 512 KB direct mapped cache with 64-byte block size. The hit latency of the cache is 3ns. If a k bit comparator has a latency of k/5 ns, what is the size of the physical address in bits of this memory system if it is a byte addressable memory?
32
30
28
34
Correct Answer
Option 4
Solution
It is given that the hit latency of the cache is 3ns. In a direct mapped cache the comparator delay contributes to the hit latency.
Since the k-bit comparator latency is given as k/5ns, we can write in this case k/5 = 3
So, the size of the comparator k = 3*5 = 15.
The size of the comparator is the same as the number of TAG bits in the physical address.
So, the number of TAG bits = 15.
Cache size = 512 KB
Cache Block size = 64 B
Number of blocks = 512KB / 64B = 8K = 2^13
Number of bits for LINE number = 13.
Block size is 64 B, so OFFSET = 6 bits.
In direct mapped cache the physical address is divided into 3 fields as
Tag(15)
LINE(13)
Offset(6)
The physical address is 15+13+6 = 34 bits.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following program, where R0, R1, R2 are the general purpose CPU registers.
Instruction
Meaning
LOAD R0, 2000H R0 <- M[2000]
2. LOAD R1, @(R2) R1 <- M[M[R2]]
3. ADD R1, R0, R1 R1 <- R0 + R1
4. INC R2 R2 <- R2+1
5. STORE R1, (R2) M[R2 ]<- R1
6. HALT Stop
If the content of memory location 2000 is 10 and the initial value in R2 is 1000. The content of memory locations from 1000 to 1010 have the value 5. What are the final values in registers R0, R1 and R2 respectively at the end of the execution of the given program?
(10, 15, 1001)
(15, 10, 1000)
(10, 10, 1000)
(15, 5, 1001)
Correct Answer
Option 1
Solution
At location 2000 we have value 10. This is stored in R0 in the 1st instruction .
The initial value in R2 is 1000. In the second instruction we use this value of R2, 1000 to get the effective address and from location we get the value 5 and this is put into R1.
In the 3rd instruction, we add the values of R0, R1 (10+5) and this result 15 is stored back into R1.
In the 4th instruction R2 is incremented by 1, now R2 has value 1001.
In the 5th instruction the value of R1 is stored into memory location 1001 .
At the end of the program execution, R0 has 10, R1 has 15 and R2 has 1001.