Information Technology - Online Test

Q1. The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is
Answer : Option D
Explaination / Solution:

Let the three pegs be A,B and C, the goal is to move n pegs from A to C using peg B The following sequence of steps are executed recursively 1.move n−1 discs from A to B. This leaves disc n alone on peg A --- T(n-1) 2.move disc n from A to C---------1 3.move n−1 discs from B to C so they sit on disc n----- T(n-1) So, T(n) = 2T(n-1) +1

Q2. The decimal value 0.5 in IEEE single precision floating point representation has
Answer : Option B
Explaination / Solution:

(0.5)10 =  (1.0)2 × 2-1
So, exponent = -1 and fraction is 000 - - - 000

Q3. Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D.


Answer : Option C
Explaination / Solution:


From above given diagram, its early visible that packet will visit network layer 4 times, once at each node [S, R, R, D] and packet will visit Data Link layer 6 times. One time at S and one time at D, then two times for each intermediate router R as data link layer is used for link to link communication. 
Once at packet reaches R and goes up from physical –DL-Network and second time when packet coming out of router in order Network – DL- Physical 

Q4. K4 and Q3 are graphs with the following structures

Which one of the following statements is TRUE in relation to these graphs?
Answer : Option B
Explaination / Solution:


Both K4 and Q3 are planar

Q5.  Let the page fault service time be 10ms in a computer with average memory access time being 20ns. If one page fault is generated for every 106 memory accesses, what is the effective access time for the memory?
Answer : Option B
Explaination / Solution:

 P = page fault rate 
EA = p × page fault service time 
+(1 - p) × Memory access time


Q6.  Definition of a language L with alphabet {a} is given as following
L = {ank | k > 0, and n is a positive integer constant}
What is the minimum number of states needed in a DFA to recognize L?
Answer : Option B
Explaination / Solution:

 Let n = 3 and k=1 

(n + 1) states

Q7. Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has GROUP BY clause R : All attributes used in the GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
Answer : Option B
Explaination / Solution:

If we use a HAVING clause without a GROUP BY clause, the HAVING condition applies to all rows that satisfy the search condition. In other words, all rows that satisfy the search condition make up a single group. So, option P is true and Q is false. 
S is also true as an example consider the following table and query. 


Q8.  The truth table

represents the Boolean function
Answer : Option A
Explaination / Solution:

XY'+ XY = X(Y'+ Y) = X

Q9.
What will be the output of the following C program segment?
Char inChar = ‘A’ ;
switch (inChar ) {
case ‘A’ : printf (“Choice A\ n”);
case ‘B’ :
case ‘C’ : print f(“Choice B”);
case ‘D’ :
case ‘E’ :
default : printf (“No Choice”) ; }
Answer : Option C
Explaination / Solution:

Since there is no ‘break’ statement , the program executes all the subsequent case statements after printing “choice A”

Q10. A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The number of bits in the tag field of an address is
Answer : Option C
Explaination / Solution: