Sail E0 Webinar

MCQs

Total Questions : 65 | Page 3 of 7 pages
Question 21.

Consider the following sequence of micro-operations 

MBR `leftarrow` PC

MAR `leftarrow` X 

PC `leftarrow` Y 

Memory `leftarrow` MBR

Which one of the following is a possible operation performed by this sequence?  


  1.    Instruction fetch
  2.    Operand fetch
  3.    Conditional branch
  4.    Initiation of interrupt service
 Discuss Question
Answer: Option D. -> Initiation of interrupt service

PC content is stored in memory via MBR and PC gets new address from Y. It represents

 a
function call (routine), which is matching with interrupt service initiation  


Question 22.

The number of elements that can be sorted in `Theta`(log n) time using heap sort is 


  1.    `Theta`( 1 )
  2.    `Theta`(`sqrt(log n)`)
  3.    `Theta`(`(log n)/(log log n)`)
  4.    `Theta`(log n)
 Discuss Question
Answer: Option A. -> `Theta`( 1 )

After constructing a max-heap in the heap sort , the time to extract maximum element 

and then heapifying the heap takes `Theta`(log n) time by which we could say that `Theta`(log n) 

time is
required to correctly place an element in sorted array. If `Theta`(log n) 
 time is taken to sort using

 heap sort, then number of elements that can be sorted is constant which is `Theta`(1)


Question 23.

Consider a hard disk with 16 recording surfaces (0 - 15) having 16384 cylinders (0 - 16383 ) 

and each cylinder contains 64 sectors (0 - 63) . Data storage capacity in each sector is 512 

bytes. Data are organized cylinder - wise and the addressing format is . A file of size 42797 

KB is  stored  in the  disk  and  the  starting  disk location of the file is  <1200,  9,  40>.What  

is the cylinder number of the last sector of the file, if it is stored in a
contiguous 
manner?  


  1.    1281
  2.    1282
  3.    1283
  4.    1284
 Discuss Question
Answer: Option D. -> 1284

42797 KB `equiv` `(42797 xx 1024)/(512)` = 85594 sectors

Starting is `langle`1200,9,40`rangle`  contains total  24 + (6 x 64) = 408 sectors

Next, 1201, --------, 1283 cylinders contains total 1024 x 83  = 84992 sectors 

(`:.`  each cylinder contains 16 x 64 = 1024 sectors)

`:.`  Total = 408 + 84992 = 85400 sectors

`:.`  The required cylinder number is `langle`1284`rangle` which will contain the last sector of the file 



Question 24.

Consider the following languages  

`L_1` = {`0^p``1^q``0^r` l p,q,r `ge` 0}

`L_2` = {`0^p``1^q``0^r` l p,q,r `ge` 0,p `ne` r}

Which one of the following statements is FALSE? 


  1.    `L_2` is context - free
  2.    `L_1``cap``L_2` is context - free
  3.    Complement of `L_2` is recursive
  4.    Complement of `L_1` is context - free but not regular
 Discuss Question
Answer: Option D. -> Complement of `L_1` is context - free but not regular

`L_1` = {`0^p``1^q``0^r` l p,q,r `ge` 0} is regular

`L_2` = {`0^p``1^q``0^r` l p,q,r `ge` 0,p `ne` r} is CFL

(A) `L_2` is CFL (True) 

(B) `L_1` `cap` `L_2` = CFL (True)

(C) `L_2` complement is recursive (True) 

(D) `L_1` complement is CFL but not regular (False) as `L_1` is regular `overline(L_1)` is regular



Question 25.

Consider the following function  

int unknown ( int n ) {

                int i, j, k = 0;

                for ( i = n / 2; i <= n; i + + )

                      for ( j = 2; j <= n; j = j*2)

                       k = k + n / 2;

                  return (k );

}

The return value of the function is


  1.    `Theta` ( `n^2`)
  2.    `Theta` ( `n^2` log n)
  3.    `Theta` ( `n^3`)
  4.    `Theta` ( `n^3` log n)
 Discuss Question
Answer: Option B. -> `Theta` ( `n^2` log n)

i = (`n/2`, `n/2` +1, `n/2` + 2, ----------n )

Repeats                                      j = ( 2, `2^2`, `2^3`, `2^4`, -----------n )

`n/2` to n = (`n/2` + 1 ) times                                                                      k = `Theta` ( n log n )

                                                        k = k + `n/2`

                                                                                           k = `n/2` + `n/2` + --------log n times = `n/2` log n

= `n/2`log n + `n/2`log n + `n/2` log n ------- ( `n/2` + 1) times

= (`n/2` + 1 ) . `n/2`log n

= `Theta` ( `n^2` log n )


Question 26.

Consider the DFA given below.

                                                                      1

                                                        1

                                           `rightarrow`         `rightarrow`   

                                  

                                                       0.1

Which of the following are FALSE? 

1. Complement of L(A) is context - free 

2. L (A) = L((11* 0 + 0) (0 + 1)* 0*1* ) 

3. For the language accepted by A, A is the minimal DFA 

4. A accepts all strings over {0, 1} of length at least 2 


  1.    1 and 3 only
  2.    2 and 4 only
  3.    2 and 3 only
  4.    3 and 4 only
 Discuss Question
Answer: Option D. -> 3 and 4 only

                                                                         1

                                                        1

                                          `rightarrow`         `rightarrow`  

               A :                  

                                                       0.1

(1) L(A) is regular, its complement is also regular and if it is regular it is also context free.  

(2) L (A) = (11*0 + 0) (0 + 1)* 0*1* = 1*0 (0 + 1)* 

Language has all strings where each string contains '0'. 

 (3) A is not minimal, it can be constructed with 2 states 

 (4) Language has all strings, where each string contains '0'. (atleast length one)  



Question 27.

Consider the following relational schema.  

Students(rollno: integer, sname: string) 

 Courses(courseno: integer, cname: string) 

Registration(rollno: integer, courseno; integer, percent: real) 

Which of the following queries are equivalent to this query in English? 

 "Find the distinct names of all students who score more than 90% in the course numbered
107"

 (I) SELECT DISTINCT S.sname 

FROM Students as S, Registration as R 

WHERE R.rollno=S.rollno AND R.Courseno=107 AND R.percent>90

(II) `pi_(sname)` `(sigma_(courseno)` = 107 ^ Percent > 90 ( Registration    students))

(III) {Tl `exists` S `in` Students, `exists` R `in` Registration (S.roll no = R. roll no ^

        r.courseno = 107 ^ R.percent > 90 ^ T.sname = S. name)}

(iv)  {<`S_n` >l `exists` `S_R` `exists` `R_P` (<`S_R` , `S_N` > `in` Students ^ < `S_R` ,107 , `R_P`> `in`  Registration ^ `R_P` >90)}


  1.    I, II, III and IV
  2.    I, II and III only
  3.    I, II and IV only
  4.    II, III and IV only
 Discuss Question
Answer: Option A. -> I, II, III and IV

Four queries given in SQL, RA, TRC and DRC in four statements respectively retrieve the 

required information


Question 28.

A shared  variable x,  initialized to zero,  is  operated  on  by   four concurrent  processes 

W, X, Y, Z as
follows. Each of the processes W and X reads x from memory, increments

 by one, stores it to
memory, and then terminates. Each of the processes Y and Z reads

 x from memory, decrements by
two, stores it  to  memory,  and  then  terminates.  Each 

process  before reading  x  invokes  the P  operation (i.e., wait) on  a counting semaphore 

S and invokes the  V operation (i.e., signal) on the
semaphore S after storing x to memory. 

Semaphore S is initialized to two. What is the maximum
possible value of x after all processes 

complete execution?  


  1.    -2
  2.    -1
  3.    1
  4.    2
 Discuss Question
Answer: Option D. -> 2

            W              X             Y            Z 

1        R (x)          R(x)       R(x)         R(x)

2       x++             x++        x=x-2;      x=x-2;

3      W(x)            W(x)      W(x)         W(x)

R(x) is to read x from memory, w(x) is to store x in memory

(I)  `W_1` (x o )  [ W is Preempted]

(II)  `Y_1`, `Y_2`, `Y_3` (x -2)  [Y is completed]

(III)  `Z_1`, `Z_2`, `Z_3` (x  -4) [Z is completed]

(IV)  `W_2`, `W_3`  ( x  1) [It  increments local copy of x and stores & W is completed]

(V)  `X_1`, `X_2`, `X_3` (x  2) [X is completed]

Maximum value of x = 2



Question 29.

Determine the maximum length of cable (in km) for transmitting data at a rate of 500 Mbps 

in an Ethernet LAN with frames of size 10,000 bits. Assume the signal speed in the cable 

to be 2,00,000 km/s


  1.    1
  2.    2
  3.    2.5
  4.    5
 Discuss Question
Answer: Option B. -> 2

500 x `10^6` bits-------1 sec

`:.`  `10^4`     bits ----------`(5 xx 10^8)/(10^4)` = `(10^4)/(5 xx 10^8)` sec = `1/(5 xx 10^4)` sec

1 sec--------2 x `10^5` km

`:.`  `1/(5 xx 10^4)` sec--------- `(2 xx 10^5)/(5 xx 10^4)` = 4 km

`:.`  Maximum length of cable = `4/2` = 2 km



Question 30.

In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400
and the fragment offset value is 300. The position of the datagram, the sequence numbers of
the first and the last bytes of the payload, respectively are 

 (A) Last fragment, 2400 and 2789 

(B) First fragment, 2400 and 2759 

 (C) Last fragment, 2400 and 2759 

(D) Middle fragment, 300 and 689  


  1.    Last fragment, 2400 and 2789
  2.    First fragment, 2400 and 2759
  3.    Last fragment, 2400 and 2759
  4.    Middle fragment, 300 and 689
 Discuss Question
Answer: Option C. -> Last fragment, 2400 and 2759

M= 0 - Means there is no fragment after this, i.e. Last fragment 

 HLEN=10 - So header length is 4 x10=40, as 4 is constant scale factor 

 Total Length = 400(40 Byte Header + 360 Byte Payload) 

 Fragment Offset = 300, that means 300 x 8 Byte = 2400 bytes are before this last fragment 

 So the position of datagram is last fragment 

 Sequence number of First Byte of Payload = 2400 (as 0 to 2399 Sequence no are used) 

 Sequence number of Last Byte of Payload = 2400+360-1=2759



Latest Videos

Latest Test Papers