You are on page 1of 14

GATE – 2 0 1 5

CS : COM PU T ER SCI EN CE
& I N F ORM AT I ON T E CH N OL OGY
Set - 3
N o. of Qu est i on s : 65 M a xi m u m M a r k s : 100

GEN ERAL APT I T U D E (GA)


(Q. 1 – 5) : Car r y On e M ar k Each (a) M r., was, found, on
1. Ext r eme focus on syllabus and st udying for t est s (b) a, was, found, at
has become such a dominant concer n of I ndian (c) t he, was, found, on
st udent s t hat t hey close t heir minds t o anyt hing
(d) a, being, find at
 t o t he r equir ement s of t he exam
4. I f ROAD is writt en as URDG, then SWAN should
(a) r elat ed (b) extr aneous be wr it t en as :
(c) outside (d) useful (a) VXDQ (b) VZDQ
2. A funct ion f(x) is linear and has a value of 29 at x (c) VZDP (d) UXDQ
= – 2 and 39 at x = 3. Find it s value at x = 5.
5. Select t he pair t hat best expr esses a r elat ionship
(a) 59 (b) 45 similar t o t hat expr essed in t he pair :
(c) 43 (d) 35 Childr en : Pediat r ician
3. The Tamil version of  John Abr aham-st arr er (a) Adult : Or t hopaedist
M adr as café  clear ed by t he Censor Boar d
(b) Females : Gynaecologist
wit h no cut s last week but t he film’s dist r ibut or s
 no takers among the exhibit or s for a release (c) K idney : Nephr ologist
in Tamil Nadu t his Fr iday. (d) Skin : Der mat ologist
(Q. 6 – 10) : Car r y Tw o M ar k s Each
6. The expor t s and impor t s (in cr or es of Rs.) of a count ry fr om t he year 2000 t o 2007 are given in t he following
bar char t . I n which year is t he combined per cent age incr ease in impor t s and expor t s t he highest ?

7. The head of a newly for med gover nment desir es Which is t he valid dist r ibut ion of por t folios?
t o appoi n t fi ve of t he si x sel ect ed member s (a) P-H ome, Q-Power, R-Defense, S-Telecom,
P,Q,R,S,T and U t o por t folios of H ome, Power, T-Finance
Defense, Telecom, and Finance. U does not want (b) R-H ome, S-Power, P-Defense, Q-Telecom,
any por t folio if S get s one of t he five. R want s T-Finance
eit her H ome or Finance or no por t folio. Q says (c) P-H ome, Q-Power, T-Defense, S-Tel ecom,
t hat if S get s eit her Power or Telecom, t hen she U-Finance
must get t he ot her one. T insist s on a por t folio if
(d) Q-H ome, U -Power, T-Defense, R-Tel ecom,
P get s one.
P-Finance
2 SOLVED PAPER – 2015 (SET - 3)

8. Choose t he most appr opr iat e equat ion for t he COM PU T ER SCI ENCE & I NF ORM AT I ON
funct ion dr awn as a t hick line, in t he plot below. TECH NOL OGY
(Q. 1 – 25) : Car r y On e M ar k Each
1. I n a r oom t her e ar e only t wo t ypes of people,
namely Type 1 and Type 2. Type 1 people always
t ell t he t r ut h and Type 2 people always lie. You
gi ven ar e fai r coin t o a per son in t hat r oom,
wit hout knowing which t ype he is fr om and t ell
him t o loss it and hide t he r esult fr om you t ill
(a) x  y  y (b) x    y  y  you ask for it . Upon asking, t he per son r eplies
t he following.
(c) x  y  y (d) x    y  y 
“ The r esult of t he t oss is head if and only if I am
9. M ost exper t s feel t hat in spit e of possessing all t elling t he t r ut h.”
t he t echnical skills r equir ed t o be a bat sman of
Which of t he following opt ions ar e cor r ect ?
t he highest or der, he is unlikely t o be so due t o
lack of r equisit e t emper ament . H e was guilt y of (a) The r esult is head
t hr owing away his wick et sever al t imes aft er (b) The r esult is t ail
wor king har d t o l ay a st r ong foundat ion. H is (c) I f t he per son is of Type 2, t hen t he r esult is
cr it ics point ed out t hat unt il he addr essed t his tail
problem success at the highest level will continue
(d) I f t he per son is of Type 1, t hen t he r esult is
t o elude him.
tail
Which of t he st at ement (s) below is/ar e logically
valid and can be infer red from the above passage? 2. Consider t he r elat ion X(P, Q, R, S, T, U) wit h t he
following set of funct ional dependencies
(i ) H e was alr eady a successful bat sman at t he
F={
highest level
{P, R}  {S, T}
(i i ) H e has t o impr ove his t emper ament in or der
{P, S, U} {Q,R}
t o become a gr eat bat sman
Which of t he following is t he t r ivial funct ional
(i i i ) H e failed t o make many of his good st ar t s dependency in F +, wher e F + is closur e of F ?
count
(a) {P, R}  {S, T} (b) {P, R} {R,T}
(iv) I mpr oving his t echnical skills will guar ant ee
success (c) {P, S} {S} (d) {P, S, U} {Q}
(a) (i i i ) and (i v) 3. Given a has t able T with 25 slot s that st ores 2000
element s, t he load fact or for T is .
(b) (i i ) and (i i i )
4. Consider a soft war e pr oject wit h t he following
(c) (i ), (i i ) and (i i i )
information domain characteristics for calculat ion
(d) (i i ) only
of funct ion point met r ic.
10. Alexander t ur ned his at t ent ion t owar ds I ndia,
Number of ext er nal input s (I ) = 30
since he had conquer ed Per sia.
Number of ext er nal out put s (O) = 60
Which one of t he st at ement s below is logically
valid and can infer r ed fr om t he above sent ence? Number of ext er nal inquir ies (E) = 23
(a) A l ex an der w ou l d n ot h av e t u r n ed h i s Number of files (F) = 08
att ention t owar ds I ndia had he not conquered Number of ext er nal int er faces (N) = 02
Per sia. I t is given t hat t he complexit y weight ing fact or s
(b) Alexander was not r eady t o r est on his laurels, for I , O, E, F and N ar e 4, 5, 4, 10 an d 7,
and want ed t o mar ch t o I ndia r espect ively. I t is also given t hat , out of four t een
(c) Alexander was complet ely in cont r ol of his val u e adju st ment fact or s t hat i nfl uence t he
ar my and could command it t o move t owar ds dev el opm en t ef f or t , f ou r f act or s ar e n ot
I ndia applicable, each of t he ot her four fact or s have
(d) Since Alexander’s kingdom extended to I ndian value 3, and each of t he r emaining fact or s have
bor der s aft er t he conquest of Per sia, he was value 4. The comput ed value of funct ion point
keen t o move fur t her metr ic is .
SOLVED PAPER – 2015 (SET - 3) 3

5. Consider t he following st at ement s. 11. Two pr ocesses X and Y need t o access a cr it ical
I . TCP connect ions ar e full duplex sect ion. Consider t he following synchr onizat ion
const r uct used by bot h t he pr ocesses
I I . TCP has no option for selective acknowledgment
Pr ocess X Pr ocess Y
I II . TCP connect ions ar e message st r eams
/* ot her code for pr ocess X*/ /* other code for pr ocess Y* /
(a) Only I is cor r ect
whi le (tr ue) while (tr ue)
(b) Only I and I I I ar e cor r ect
{ {
(c) Only I I and I I I ar e cor r ect var P = tr ue; var Q = t r ue;
(d) All of I , I I and I I I ar e cor r ect while (var Q == tr ue) while (var P == t r ue)
6. Suppose U is t he power set of t he set S = {1, 2, 3, { {
4, 5, 6}. For any T U, let T denot e t he number /* cr it ical sect ion * / /* cr it ical secti on * /
of element in T and T' denot e t he complement of varP = fal se; var Q = false;
T. For any T, R U, let T\ R be t he set of all
} }
element s in T which ar e not in R. Which one of } }
t he following is t r ue ?
/* ot her code for pr ocess X*/ /* other code for pr ocess X* /
(a) X U  X  X  
H er e, var P and var Q ar e shar ed var iables and
(b) X  U Y  U  X  5, Y  5 and X   Y    bot h ar e init ialized t o false. Which one of t he
following st at ement s is t r ue ?
(c) X U Y U  X  2, Y  3 and X/Y   
(a) The pr oposed solut ion pr event s deadlock but
(d) XU Y U  X/Y  Y  / X   fails t o guar ant ee mut ual exclusion
(b) The pr oposed solut i on guar ant ees mut ual
7. Among simple L R (SLR), canonical L R, and look-
exclusion but fails t o pr event deadlock
ahead L R (L AL R), which of t he following pair s
i den t i f y t h e m et h od t h at i s v er y easy t o (c) The pr oposed solut i on guar ant ees mut ual
i mplement and t he met hod t hat i s t he most exclusion and pr event s deadlock
power ful, in t hat or der ? (d) T h e pr oposed sol u t i on f ai l s t o pr even t
(a) SL R, L AL R deadl ock and fai l s t o guar an t ee mu t ual
exclusion
(b) Canonical L R, L AL R
12. L et # be a binar y oper at or defined as
(c) SL R, canonical L R
X#Y = X + Y where X and Y are Boolean variables.
(d) L AL R, canonical L R
Consider t he following t wo st at ement s.
8. Consider t he following ar r ay of element s.
(S1) (P#Q)#R = P#(Q#R)
< 89, 19, 50, 17, 12, 15, 2,5, 7, 11, 6, 9, 100 >
(S2) Q#R = R#Q
The minimum number of int er changes needed
t o conver t it int o a max-heap is Which of t he following is/ar e t r ue for t he Boolean
var iables P, Q and R ?
(a) 4 (b) 5
(a) Only S1 is t r ue
(c) 2 (d) 3
(b) Only S2 is t r ue
9. The maximum number of pr ocesses t hat can be in
Ready stat e for a computer system with n CPUs is (c) Bot h S1 and S2 ar e t r ue
(a) n (d) Neit her S1 nor S2 ar e t r ue
(b) n 2 13. Consider t he following r elat ion
(c) 2n Cinema (t heat er, addr ess, capacit y)
(d) I ndependent of n Which of t he following opt ions will be needed at
t he end of t he SQL quer y
10. While inser t ing t he element s 71, 65, 84, 69, 67,
83 in an empty binary search tree (BST) in the SEL ECT P1. addr ess
sequence shown, the element in the lowest level is FROM Cinema P1
(a) 65 (b) 67 Such that it always finds the addresses of t heat ers
(c) 69 (d) 83 wit h maximum capacity ?
4 SOLVED PAPER – 2015 (SET - 3)

(a) WH ERE P1. Capaci t y> = Al l (sel ect P2. n


3
Capacit y fr om Cinema P2) 19. Consider t he equalit y i
i 0
= X and t he following
(b) WH ERE P1. Capaci t y> = Any (sel ect P2. choices for X
Capacit y fr om Cinema P2)
I. (n 4) I I . (n 5)
(c) WH ERE P1. Capacit y> = All (select max(P2.
I I I . 0(n 5) I V. (n 3)
Capacit y) fr om Cinema P2)
T he equ al i t y above r emai ns cor r ect i f X i s
(d) WH ERE P1. Capacit y> = Any (select max (P2.
Capacit y) fr om Cinema P2) r eplaced by
(a) only I
14. The value of lim 1  x2 e x is
 
x  (b) Only I I
1 (c) I or I I I or I V but not I I
(a) 0 (b)
2 (d) I I or I I I or I V but not I
(c) 1 (d)  20. The r esul t eval uat i ng t he post fix expr essi on
15. Consider t he following C pr ogr am segment . 105 + 60 6 / * 8 – is
#include < st dio.h > (a) 284 (b) 213
int main ( ) (c) 142 (d) 71
{ 21. Consider a CSM A/CD net wor k t hat t r ansmit s
char sl [7] = "1234",* p; dat a at a r at e of 100 M bps (108 bit s second) over
p sl + 2; a 1 km(kilomet er ) cable wit h no r epeat er s. I f t he
* p = ‘0'; minimum frame size r equir ed for t his net work is
1250 byt es, what is t he signal speed (km/sec) in
pr int f ("%s",sl)
t he cable ?
{
(a) 8000 (b) 10000
What will be pr int ed by t he pr ogr am ?
(c) 16000 (d) 20000
(a) 12 (b) 120400
22. Consider a soft war e pr ogr am t hat is ar t ificially
(c) 1204 (d) 1034
seeded w i t h 100 f au l t s. Wh i l e t est i n g t h i s
16. The number of 4 digit number s having their digits pr ogr am, 159 fault s ar e det ected, out of which 75
i n non-decr easi ng or der (fr om l eft t o r i gh t ) fault s ar e fr om t hose ar t ificially seeded fault s.
const r uct ed by using t he digit s belonging t o t he Assuming t hat bot h ar e and seeded fault s ar e of
set {1, 2, 3} is . same nat ur e and have same di st r i but i on, t he
estimat ed number of undetect ed real fault is .
1 1 2 
23. Consider a binar y t r ee T t hat has 200 leaf nodes.
17. I n the mat rix 0 1 0  , one of t he eigen values
Then, t he number of nodes in T t hat have exactly
1 2 1  t wo childr en ar e  .
is 1. The eigenvect or s cor r esponding to t he eigen 24. I n a web ser ver, t en Webpages ar e st or es wit h
value 1 ar e t he URL s of t he for m ht t p:www.your name.com/
var.ht ml; wher e, var is differ ent number fr om 1
(a) (4, 2,1)   0, R
to 10 for each Webpage. Suppose, t he client st or es
(b) (4, 2,1)   0, R t h e Webpage wi t h var = 1(say W1) i n l ocal
mach i n e, edi t s an d t h en t est s. Rest of t h e
(c)   2,0,1   0,   R Webpages r emai n s on t h e w eb ser ver. W1
cont ai ns sever al r el at i ve U RL s of t h e for m
(d)    2,0,1   0,   R “var.html” referr ing to t he other webpages. Which
one of t he following stat ement s needs to be added
18. Consider a machine wit h byt e addr essable main in W1, so t hat all t he r elat ive URL s in W1 r efer s
memor y of 2020 byt es, block size of 16 byt es and a t o t he appr opr iat e Webpages on t he web ser ver ?
dir ect mapped cache having 212 cache lines. L et
t he addr ess of t wo consecut ive byt es i n main (a) < ahr ef : "ht t p : / / www.your name.com / ",
memor y be (E201F)16 and (E2020)16 . What ar e hr ef :"...var.ht ml" >
t he t ag and cache line addr ess (in hex) for main (b) < base hr ef :"htt p : / / www.your name.com /" >
memor y addr ess (E201F)16 ? (c) < a hr ef :"ht t p : / / www.your name.com / " >
(a) E, 201 (b) F, 201 (d) < base hr ef :"ht t p : / / www.your name.com / ",
(c) E, E20 (d) 2, 01F r ange :"...var .ht ml" >
SOLVED PAPER – 2015 (SET - 3) 5

25. L et L be t he language r epr esent ed by t he r egular i = i + 1;


expr ession  * 0011 * wher e  ={0,1}. r esult = r esult + 1;
What is t he minimum number of st at es in a DFA }
t hat r ecognizes L (complement of L ) ? if (r esult < = max int )
(a) 4 (b) 5 {
(c) 6 (d) 8 pr int f(r esult );
(Q. 26 – 55): Car r y Tw o M ar k s Each }
1 1 el se
26. I n for non-zer o x, af ( x)  bf     25 wher e
 x x {
a  b t hen
2
f ( x) dx is pr int f(" l ar g e ");
1
}
1  47b 
pr int f(" end of pr ogr am") '
(a) 2
a  b2  a  ln 2  25   2 
 
}
1  47b  Con t r ol F l ow D i agr am of Pr ogr am – Y :
(b) 2
a  b2  a  2 ln 2  25   2 
 
1  47b 
(c)
a  b2
2  a  2 ln 2  25   2 
 
 1 47b 
(d)  a  ln 2  25   2 
a  b2
2
 
27. Consider t he following gr ammar G
SF H
S p c
S d c
wher e S, F, and H ar e non-t er minal symbols, p,
d, and c ar e t er mi nal symbol s. Which of t he
following st at ement s(s) is/ar e cor r ect ?
S1 : L L(1) can parse all str ings t hat are gener at ed
using gr ammar G
S2 : L R(1) can par se all st r ings t hat ar e gener at e
using gr ammar G Con t r ol F l ow D i agr am of Pr ogr am – Z :
(a) Only S1 (b) Only S2
(c) Bot h S1 and S2 (d) Neit her S1 nor S2
28. Consider t hr ee soft war e i t ems: Pr ogr am – X,
Cont rol Flow Diagr am of Pr ogr am-Y and Cont rol
Flow Diagr am of Pr ogr am – Z as shown below
Pr ogr am – X :
Sumcal(int max int , int value) The values of M cCabe’s Cyclomatic complexit y of
{ Pr ogr am – X, Pr ogr am -Y, an d Pr ogr am-Z
int r esult 0, i = 0; r espect ively ar e
if (value < 0) (a) 4, 4, 7 (b) 3, 4, 7
{ (c) 4, 4, 8 (d) 4, 3, 8
value = – value; 29. Con si der t h e f ol l ow i n g par t i al Sch edu l e S
involving t wo t r ansact ions T1 and T2. Only t he
}
r ead and wr it e oper at ions have been shown. The
while((i < value) AND (result r ead oper at ion on dat a it em P is denot ed by r ead
< = max int )) (P) and t he wr it e oper at ion on dat a it em P is
{ denot ed by wr it e (P).
6 SOLVED PAPER – 2015 (SET - 3)

T im e
34. Consider t he equat ion (43)x = (y3)8 wher e x and
Tr an sac t i on -i d y ar e unknown. The number of possible solut ion
I nst an ce
is .
T1 T2 35. L et f(n) = n and g(n) = n (1 + si n n), + wher e n is a
1 r ead(A ) positive integer. Which of the following statement
is/ar e cor r ect ?
2 wr it e(A)
I . f(n) = 0(g(n)) I I . f(n) = (g(n))
3 r ead(C)
(a) Only I (b) Only I I
4 wr it e(C) (c) Bot h I and I I (d) Neit her I nor I I
5 r ead(B ) 36. Suppose c = c[0], ...., c[k – 1] is an ar ray of length
6 wr it e(B) k, wher e all t he ent r ies ar e fr om t he set {0, 1}.
For any posit ive int eger s a and n, consider t he
7 r ead(A ) following pseudo code.
8 commit DOSOM ETHI NG (c, a, n)
9 read (B) z1
Sch edu l e S for i  0 t o k – 1
Suppose that the tr ansaction T1 fails immediately do z  z2 mod n
aft er t ime inst ance 9. Which one of t he following if c[i ] = 1
st at ement s is cor r ect ? t hen z  (z  a) mod n
(a) T2 must be abor t ed and t hen bot h T1 and T2 r et ur n z
must be r e-st ar t ed t o ensur e t r ansact i on I f k = 4, c = 1.0, 1, 1, a = 2 and n = 8, t hen t he
atomicit y out put of DOSOM ETHI NG (c, a, n) is .
(b) Schedule S is non-r ecover able and cannot 37. Consider t he following r ecur sive C funct ion.
ensur e t r ansact ion atomicit y Void get (int n)
(c) Only T2 must be abor t ed and t hen r e-st ar t ed {
t o ensur e t r ansact ion at omicit y if (n < 1) r et ur n;
(d) Schedule S is r ecover able and can ensur e get (n – 1)
at omicit y and not hing else needs t o be done get (n – 3);
30. Consider a B+ t r ee in which t he sear ch Answer is print f(% d, n);
12 byt es long, block size is 1024 byt es, r ecor d }
point er is 10 byt es long and block point er is 8 I f get (6) funct ion is being called in main () t hen
byt es long. The maximum number of keys t hat how many times will t he get () function be invoked
can be accommodat ed in each non-leaf node of befor e r et ur ning t o t he main ( ) ?
t he t r ee is  .
(a) 15 (b) 25
31. Suppose X i for i = 1, 2, 3 ar e independent and
(c) 35 (d) 45
ident ically dist r ibut ed r andom var iables whose
pr obabi l i t y mass f unct i ons ar e Pr [ X i = 0] = 38. Assume t hat a mer gesor t algor it hm in t he wor st
Pr [X i = 1] = 1/2 for i =1, 2, 3. Define anot her case t akes 30 second for an input of size 64.
r andom var iable Y = X 1X 2  X 3, wher e  denot es Which of t he following most closely appr oximates
XOR. Then Pr [Y = 0| X 3 = 0] =  . t he maximum input size of a pr oblem t hat can be
32. Given t he funct ion F = P + QR, wher e F is a solved in 6 minut es?
funct ion in t hr ee Boolean var iables P, Q and R (a) 256 (b) 512
and P = !P, consider t he following st at ement s (c) 1024 (d) 2048
(S1)F = (4,5,6) 39. Consider t he following t wo C code segment s. Y
(S2)F = (0,1,2,3,7) and X are one and two dimensional ar r ays of size
(S3)F = (4,5,6) n and n  n r espect ively, where 2  n  10. Assume
(S4)F = (0,1,2,37) t hat in bot h code segment s, element s of Y ar e
Which of t he following is t r ue ? init ialized t o 0 and each element X[i ] [j] of ar r ay
X is initialized t o i + j. Furt her assume that when
(a) (S1)-False, (S2)-Tr ue, (S3)-True, (S4)-False st or ed in main memor y all element s of X ar e in
(b) (S1)-Tr ue, (S2)-False, (S3)-False, (S4)-True same memor y page fr ame.
(c) (S1)-False, (S2)-False, (S3)-True, (S4) True Code Segment 1:
(d) (S1)-False-True, (S2) True, (S3)-False, (S4)-False //init ialize element s of y t o 0
33. The t ot al number of pr i me i mpl i cat es of t he //init ialize element s X[i][j] of x t o i + j
function
for (i = 0; i < n; i++)
f(w, x, y, z) = (0, 2, 4, 5, 6, 10) is  .
Y[i] + = X[0][i];
SOLVED PAPER – 2015 (SET - 3) 7

Code Segment 2: Wh en of t he above pol i ci es can be used f or


//init ialize element s of Y t o 0 prevent ing deadlock ?
//init ialize element s X[i][j] of X t o i + j (a) Any one of I and I I I but not I I or I V
for (i = 0; i < n; i++) (b) Any one of I , I I I , and I V but not I I
Y[i] + = X[i][0]; (c) Any one of I I and I I I but not I or I V
Which of t he following st at ement s is/ar e cor r ect ? (d) Any one of I , I I , I I I , and I V
S1 : Final cont ent s of ar r ay Y will be same in 43. L et G be a connect ed undir ect ed gr aph of 100
bot h code segment s ver tices and 300 edges. The weight of a minimum
spanning t r ee of G is 500. When t he weight of
S2 : Element s of ar r ay X accessed inside t he for
each edge of G is incr eased by five, t he weight of
loop shown in code segment 1 ar e contiguous
a minimum spanning t ree becomes .
in main memor y
44. I f t he following syst em has non-t r ivial solut ion.
S3 : Element s of ar r ay X accessed inside t he for
loop shown in code segment 2 ar e contiguous px + qy + r z = 0
in main memor y qx + r y + pz = 0
(a) Only S2 is cor r ect r x + py + qz = 0,
(b) Only S3 is cor r ect Then which one of the following opt ions is TRUE?
(c) Only S1 and S2 ar e cor r ect (a) p – q + r = 0 or p = q = – r
(d) Only S1 and S3 ar e cor r ect (b) p + q – r = 0 or p = – q = r
(c) p + q + r = 0 or p = q = r
40. The velocity v (in kilometer/minute) of a motorbike
which st ar t fr om r est , is given at fixed int er vals (d) p – q + r = 0 or p = – q = – r
of t ime t (in minut es) as follows. 45. Consider a network connected two systems located
8000 ki lomet er s apar t . The bandwi dt h of t he
t 2 4 6 8 10 12 14 16 18 20
n et w or k i s 500  10 6 bi t s per secon d. T h e
v 10 18 25 29 32 20 11 5 2 0 pr opagat ion speed of t he media is 4  106 met er s
The approximate distance (in kilometers) rounded per second. I t is needed t o design a Go-Back-N
t o t wo places of decimals cover ed in 20 minut es sliding window pr ot ocol for t his net wor k. The
using Simpson’s 1/3r d r ule is ________. aver age packet size is 107 bit s. The net wor k is t o
be used t o it s full capacit y.
41. Consider t he following C pr ogr am
Assume t hat pr ocessi ng del ays at nodes ar e
# include < st dio.h > negligible. Then t he minimum size in bit s of t he
int main ( ) sequence number field has t o be .
{ 46. L anguage L 1 is pol ynomi al t i me r educi bl e t o
st at ic int a [ ] = {10, 20, 30, 40, 50}; language L 2. L anguage L 3 i s polynomial t i me
st at ic int * p [ ] = {a, a + 3, a + 4, a + 1, a + 2}; r educible t o L 2, which in t ur n is polynomial t ime
r educible t o language L 4. Which of t he following
int * * pt r = p;
is/ar e t r ue?
pt r ++;
I . if L 4 P, t hen L 2 P
pr int f (%d %d, pt r – p, * * pt r ):
I I . if L 1 P or L 3 P, t hen L 2 P
} I II . L 1 P, if and only if L 3 P
The out put of t he pr ogr am is . IV. if L 4 P, t hen L 1 P and L 3 P
42. Consider t he foll owing polici es for pr event ing (a) I I only
deadlock in a syst em wit h mut ually exclusive
(b) I I I only
r esour ces.
(c) I and I V only
I . Pr ocesses should acquir e all t heir r esour ces
at t he beginning of execution. I f any resources (d) I only
acquir ed so far ar e r eleased. 47. Consider t he foll owing r eser vat ion t able for a
I I . The r esour ces ar e number ed uniquely, and pipeline having t hr ee st ages S1, S2, and S3.
processes are allowed t o r equest for r esour ces Time 
only in incr easing r esour ce number s.
1 2 3 4 5
I II . The r esour ces ar e number ed uniquely, and
processes are allowed t o r equest for r esour ces S1 X X
only in decr easing r esour ce number s. S2 X X
IV. The r esour ces ar e number ed uni quel y. A
pr ocess i s al l ow ed t o r equ est on l y for a S3 X
r esour ce wit h r esour ce number lar ger t han The minimum average latency (MAL) is ________.
it s cur r ent ly held r esour ces.
8 SOLVED PAPER – 2015 (SET - 3)

48. I n t he net wor k 200.20.11.144/27, t he four t h octet int f1 ( ) {int x = 25; x ++; r et ur n x;}
(in decimal) of t he last I P addr ess of t he net wor k int f2 ( ) {st at ic int x = 50; x + +; r et ur n x;}
which can be assigned t o a host is .
int f3 ( ) {x* = 10; r et ur n x};
49. Which of t he following languages ar e cont ext -
fr ee ? The output of pr ogram is .
52. Consider t he following code sequence having five
 
L 1 = am bn a n bm m, n  1
inst r uct ions I 1 t o I 5. Each of t hese inst r uct ions
has t he following for mat .
L2 =  a b a b m, n  1
m n m n

OP Ri, Rj, Rk
L3 =  a b m  2n  1
m n Wher e oper at ion OP is per for med on cont ent s of
r egist er s Rj and Rk and t he r esult s is st or ed in
(a) L 1 and L 2 only (b) L 1 and L 3 only r egist er Ri.
(c) L 2 and L 3 only (d) L 3 only I 1 : ADD R1, R2, R3
50. Consider t he following C pr ogr am
I 2 : M UL R7, R1, R3
#include < st dio.h >
I 3 : SUB R4, R1, R5
int main ( )
I 4 : ADD R3, R 2, R 4
{
I 5 : M UL R7,R8, R9
int i, j, k = 0;
j = 2* 3/4 + 2.0/5 + 8/5; Consider t he following t hr ee st at ement s.
k – = – – j; S1 : T h er e i s an an t i -depen den ce bet w een
inst r uct ions I 2 and I 5
for (i = 0; i < 5; i ++)
{ S2 : T h er e i s an an t i -depen den ce bet w een
inst r uct ions I 2 and I 4
Swit ch (i + k)
S3 : Wi t hi n an i nst r uct i on pi pel i ne an ant i -
{
dependence always cr eat es on or mor e st alls
case1 :
Which one of above st at ement s is/ar e cor r ect ?
case 2 : pr int f (\ n % d, i + k)
(a) Only S1 is t r ue
case 3 : pr int f (\ n % d, i + k);
default : pr int f (\ n%d, i + k) ; (b) Only S2 is t r ue
} (c) Only S1 and S3 ar e t r ue
} (d) Only S2 and S3 ar e t r ue
Ret ur n 0 : 53. Two host s ar e connect ed via a packet swit ch wit h
} 10 7 bi t s per secon d l i n k s. Each l i nk h as a
pr opagat i on. Del ay of 20 mi cr oseconds. The
The number of t imes pr intf statement is executed
is . sw i t ch begi n s f or w ar di n g a pack et 35
micr oseconds aft er it r eceives t he same. I f 1000
51. Consider t he following C pr ogr am.
bit s of dat a ar e t o be t r ansmit t ed bet ween t he
#include < st dio.h > t wo host s using a packet size of 5000 bit s, t he
int f1 (void); time elapsed between t he transmission of the fir st
int f2 (void); bit of dat a and t he r ecept ion of t he last of t he
int x = 10; dat a in micr osecond is .
54. L et R be a r elat ion on t he set of or der ed pair s of
int main ( ) posit ive int eger s such t hat ((p, q), (r , s)) R if
{ and only if p – s = q – r . Which one of t he following
is t r ue about R ?
int x = 1;
x + = f1 ( ) + f2 ( ) + f3 ( ) + f2 ( ); (a) Bot h r eflexive and symmet r ic
pr int f (%d, x); (b) Reflexive but not symmet r ic
r et ur n 0; (c) Not r eflexive but symmet r ic
} (d) Neit her r eflexive nor symmet r ic
SOLVED PAPER – 2015 (SET - 3) 9

55. For t he pr ocesses list ed in t he following t able, (a) Fir st Come Fir st Ser ve
which of t he following scheduling schemes will (b) Non-pr eempt ive Shor t est Job Fir st
t he lowest aver age t ur nar ound t ime ?
(c) Shor t est Remaining Time
Pr ocess Ar r ival Ti me Pr ocessi ng Ti me (d) Round Robin wit h Quant um value t wo
A 0 3
B 1 6
C 4 4
D 6 2

AN SWERS
GENERAL APTI TU DE
1. (b) 2. (c) 3. (c) 4. (b) 5. (b) 6. (2006) 7. (b) 8. (b) 9. (b)
10. (a)
COM PUT ER SCI EN CE & I N FORM AT I ON TECH NOL OGY
1. (a) 2. (c) 3. (80) 4. (612.06) 5. (a) 6. (d) 7. (c) 8. (d)
9. (d) 10. (b) 11. (a) 12. (b) 13. (a) 14. (c) 15. (c) 16. (15) 17. (b)
18. (a) 19. (c) 20. (c) 21. (d) 22. (28) 23. (199) 24. (b) 25. (b) 26. (a)
27. (d) 28. (a) 29. (b) 30. (50) 31. (0.75) 32. (a) 33. (3) 34. (5) 35. (d)
36. (0) 37. (b) 38. (b) 39. (c) 40. (309.33)41. (140) 42. (d) 43. (995)
44. (c) 45. (8) 46. (c) 47. (3) 48. (158) 49. (b) 50. (10) 51. (230) 52. (b)
53. (1575) 54. (c) 55. (c)

EXPL ANAT I ON S

GENERAL APT I TU D E 7. Since U does not want any por t folio, (c) and (d)
ar e r uled out . R want s H ome, or Finance or No
1. Ext raneous -irr elevant or unrelat ed to the subject
por t folio, (a) is not valid.
being dealt wit h.
H ence opt ion (b) is cor r ect .
2. f(x) = 2x + 33
COM PU T ER SCI ENCE & I NF ORM AT I ON
3. John-Abr aham st ar r er M adr as Cafe t alks about
TECH NOL OGY
t he movie not t he per son, so M r. is r uled out .
‘Find no t aker s’ is not t he cor r ect phr ase. At t his 2. {P, S}  {S}
Fr iday is incor r ect . On finding closur e of F +, we can define {P, S} 
So, opt ion (c) is cor r ect . {S} is t r ival funct ional dependency.
4. R + 3 = U, O + 3 = R, no. of element s 2000
3. L oad fact or  = =  80
A + 3 = D, D + 3 = G; no. of slot s 25
S + 3 = V, W + 3 = Z, 5. TCP connect ions ar e full duplex. I t allow t o send
A + 3 = D, N + 3 = Q and r eceive packet s at same t ime.
5. Communit y of people : Doct or TCP allow for selective acknowledgement depend
100  70 upon cen gest i on w i n dow an d t her e ar e n ot
6. I ncr ease in expor t s in 2006 = = 42.8% message st r eam.
70
6. Count er example :
120  90
I ncr ease in impor t s in 2006 = = 33.3% (A) L et X = {1}
90
which is mor e t han any ot her year  X = S – X = {2, 3, 4, 5, 6}
 X = X
10 SOLVED PAPER – 2015 (SET - 3)

(B) Since S =6 I t is clear l y showi ng t hat bot h ar e in cr i t ical


sect i on at a t i me whi ch l eads t o “ fai l i ng t o
and X = 5 Y guar ant ee mat er ial exclusion”
 At least 4 element s common in X and Y To ent er int o t he cr it ical sect ion pr ocess X is not
 X  Y =  is false wait ing for pr ocess Y and vice ver sa. So we can
“Prevent Deadlock” so, overall, option (a) is correct
(C) Count er Example :
(or) TRUE.
L et X = {1, 2} 12. S2 i s Tr u e
and Y = {2, 3, 4} Q  R = Q + R
X or
t hen = {1} = 
Y R + Q = R + Q
X S1 i s n ot Tr u e
(D) = X – Y = X  Y
Y (P  Q)  R = P  (Q  R)
Y (P  Q) + R P + (Q + R)
and = Y – X = Y  (X)
X (P + Q) + R P + QR
= Y  X = X  Y PQ + R
X Y H ence PQ + R  P + QR
 = , V X, Y  U
Y X 13. I nner quer y collects capacit ies of all t he theat r es
7. SL R and CLR are easy to implement . CL R is more and in outer query we ar e filt ering the tuples with
power ful t o any of t he par sac. t he condit ion “ capacit y>=All” . So t he t heat r es
8. 1st swap is : 100 and 15 which are having maximum capacity will be satisfy
2nd swap is : 100 and 50 t he conduct ivity and t hey will.
3r d swap is : 100 and 89 15. 1204
S1 is 1 2 3 4
1 2 3 4
P = S1 + 2
P=0 1 2 0 4
16. 1111, 1112, 1113, 1122, 1123, 1133, 1222, 1223, 1233,
1333, 2222, 2223, 2233, 2333, 3333
Tot al number of 4-digit number s ar e 15.
17. X be an eigen vector corr esponding to eigen value
9. T h e maxi mu m n u mber of pr ocessor i s n ot  = 1, t hen AX= X  (A – I )X = 0
dependent upon number of CPU’s.
10. 71
 0 1 2   X 
0 0 0   Y 
   = 0
65 84 1 2 0   Z 
 – y + 2z = 0 and x + 2y = 0
69 83
x
 y = 2z and =y
2
67
x
L owest level element is 67.  = y = 2z
2
11. Var P = Var Q = FAL SE I nit ially.
Assume t hat , pr ocess X is willing t o ent er int o x y Z
 =    (say)
cr it ical sect ion. So it makes V ar P = Tr ue, t hen if 4 2 1
pr ocessor swit ches t o pr ocess Y, t hen pr ocess Y  4 
can ent er int o cr it ical sect ion.
 X =  2  ;   0
Aft er ent er ing int o t he cr it ical sect ion, t hen if  1
pr ocessor swit ches t o pr ocess X, t hen pr ocess X  
also can ent er int o t he cr it ical sect ion.  Eigen vect or s ar e   4, 2, 1   0,   R 
SOLVED PAPER – 2015 (SET - 3) 11

18. 1  3 
=
a 2  b2  a ln 2  25  b  2  25 
  
1  47 
19. I or I I I or I V but not I I
=
a  b2
2  a ln 2  25  2 b
 
n
n 2 (n  1)2
3
28. Pr ogr am -X :
as
i 0
i 
4
,

t his can be r epr esent by Q(n 4), O(n 5) 4  (n 3) but


not Q(n 5).
20.

Complexity = 9 – 7 + 2 = 4

21. Given L = 1250 Byt es


B = 100 mbps
d = 1 km
V =? Pr ogr am -Y :
I n CSM A/CD, L = 2 d B Cyclomat ic complexit y = 10 – 8 + 2 = 4
v
Pr ogr am Z :
2d B 2  103  108
 V = =
L 10 4
 V = 20,000 km/sec
23. The number of nodes in a binary tr ee have exect ly
t wo childr ens ar e n – 1 if n is number of leaf.
Tot al number of edges = X + Y + 1  20
H ence (200 – 1) = 199 nodes
Tot al number of ver t ices = 15
H ence cyclomat ic complexit y = 20 – 15 + 2 = 7
29. T 2 is r eading t he value wr it t en by T 1 and get t ing
commi t t ed bef or e T 1 commi t s. So i t i s non-
r ecover able schedule.
30. Suppose t hat ‘k’ is or der of t he non-leaf node
number of leaf nodes is 6
k(8) + (k – 1) 12  1024
number of nodes have exect ly t wo childr en is 5
20 k  1036
24. < base hr ef : ‘‘ht t p : //www.your name.com/’’ >
1036 
1 1 k   k  51
26. af ( x)  b. f   =  25 ...(1)  20 
 x x As t he or der is 51, maximum we can st or e 50
1 keys.
 af    b. f ( x) = x – 25 ...(2)
 x 31. Given X 3 = 0
Solving, we get  Y = X 1X 2  X 3 = 0
1  1   gives X1X2 = 0
f(x) =
a 2  b2  a  x  25   b  x  25    X1 = 1, X 2 = 0
   
2 2
or X1 = 0, X 2 = 1
1   x2  
  f ( x)dx = 
a 2  b2 
a  ln x  25 x
2
 b   25 x   or X1 = 0, X 2 = 0
2
1
1
 1 
Pr  Y  0    X 3  0  
 Pr  Y  0 X 3  0  =
Pr  X 3  0 
12 SOLVED PAPER – 2015 (SET - 3)

Pr [ X 1  1, X 2  0, X 3  0]  Pr [ X 1  0, X 2  1, 37. g(6)

X 3  0]  Pr [ X 1  0, X 2  0, X 3  0]
=
Pr  X 3  0 g(5)
g(3)

1 1 1 1 1 1 1 1 1 g(2) g(2) g(0)


        g(4)
= 2 2 2 2 2 2 2 2 2 g(1) g(–1)
1 g(3) g(1)
g(1) g(–1)

2 g(0) g(2) g(0) g(–2)


g(2) g(0)
( X 1, X 2, X 3 ar e independent ) g(0) g(–2)

g(1) g(–1)
3
=  0.75
4 g(0) g(–2)

33. Tot al calls = 25


38. O(n log n) = 30s
n = 64
O (64 log 64) = 30
H ence will get fact or of 12.8 for 6 min
= 6  60 = 360 s
O (256 log 256) = 360
O (512 log 512) = 360
O (1024 log 1024) = 360
O (2048 log 2048) = 360
So for 512 will get 12.8 as a fact or
Ther e ar e t hr ee gr oups, and all t he cont aining 40. Let ‘S’ be the dist ance covered in 20 minutes, then
esent ial-1, so all ar e pr ime implicant s as well as 1
essent ial pr ime implicant s also. by simpson’s r d r ule,
3
34. (43)x = (y3)8 20

 3 + 4x = 3 + 8y S=  V dt  v = velocit y
0
 4x = 8y
2  0  0   4 10  25  32  11  2  
 x = 2y  = 
3  2 18  29  20  5  
 x 5 
and y 7 = 309.33 km
 5 sol ut ions ar e possible whi ch ar e (14, 7), (H er e lengt h of each of t he subint er val is h = 2)
(12, 6), (10, 5), (8, 4) and (6, 3) 41. a 10 20 30 40 50

35. As – 1  sin x  1, neit her of t hem is t r ue


36. C i 0 1 1 p

20 somet hing
ptr after ptr ++  ptr – p = 1 (pointer arithmetic)
{ z1 ptr
for i  0  0.3 k0 * * pt r = 40
do z1  pr int f ( %d%d, p + r – p, p + r ) will pr int 140
42. For deadlock pr evention we need to dissatisfy any
z  z2 mod z1 z4 z0 z0
of t he necessar y condit ion for deadlock
if c[ i ]  1 c[0]  1 c[1]  0 c[1]  1 c[1]  1
z  2  z mod 8 z2 z0 z0
1. For hold and wait if we ar e disat isfy it can be
end
hold or wait for hold … befor e pr ocess st ar t os
r eturn 2 assign all resources. While executing if pr ocess
} making new r esour ce r equest it has to r elease
al l it s assign r esour ces t hat i s wai t i ng for
r elease resour ces.
SOLVED PAPER – 2015 (SET - 3) 13

2. I f we ar e di ssat i sfy cir cul ar wait condit ion 45. Given, L  107 bit s 
suppose t her e ar e fi ve r esour ces uniquel y 6  Tx
number ed r 1 t o r5 and t here five pr ocesses p1 B  500  10 bps
t o p5 suppose p2 hold r1 ,and r equest ing for L 10  106
r 2,and r 2 hold by p3 and wait for r3, r3 hold by  = = 0.02 sec
B 500  106
p4 wait for r4 which is hold by p5 and wait for
r 5 which is held by p1 (t his is happening in d  8000 km 
cir cular manner ) (condit ion t o come out from   Tp
v  4  106 m/s
cir cular wait is a process can hold t he r esource
and request for new resource only when holding d 8  10 6
= = 2 sec
r esource id is lesser then request ing r esource v 4  10 6
id) in above p1 is violating condition.  = 100%
3. I f we dissat isfy pr eempt ion if a pr ocess hold n =?
some r esour ces r equest ing for new r esour ces
Tp 2
and t hat r equest ing r esour ces ar e busy wit h  a= = = 100
som e ot h er pr ocess r equ est i n g pr ocess Tn 0.02
volunt ar ily r elease it s held r esour ces. Given Pr ot ocol, Go back N pr ot ocol.
4. Answer, accor ding to 1 and 3 above stat ements w
fir st opt ion is cor r ect . So =
1  2a
Accor ding t o above second st at ement second wher e w = 2n – 1
opt ion is cor r ect .
Accor ding t o above second st at ement if we 100 w
=
implement t he logic i n r ever se or der t hi r d 100 1  2a
opt ion is also cor r ect .  w = 1 + 2a
Accor di n g t o secon d st at ement con di t i on  2n – 1 = 1 + 2(100)
four t h opt ion is also cor r ect .  2n – 1 = 201
43. G has 100 ver t icl es  spanning t r ee cont ain  2n = 202
99 edges given, weight of a minimum spanning tree  2n = 28
of G is 500 since, each edge of G is increased by five
 n =8
 Weight of a minimum spanning t r ee becomes
500 + 5  99 = 995 46. L 2  pL 4
L 1  pL 2
44. For non-t r ival solut ion, we have A  0
If L4  P
p q r t hen L2  P
i.e., q r p =0 L 1  P,
r p q H ence opt ion (c).
(C1  C1 + C2 + C3) 48. Given I P addr ess 200.20.11.144/27,
1 q r To find out t he loss addr ess in a block, we have t o
set (32 – n) no. of r ight most bit s t o 1.
pqr 1 r p =0
n = 27
1 p q
32 – n = 32 – 27 = 5
 R 2  R 2  R1 ; R 3  R 3  R1  200.20.11.10010000
p+q+r =0 200.20.11.10011111
1 q r 200.20.11.159
 CI DR Addr ess r ange i s 200.20.11.128/27-
or 0 r q pr = 0
200.20.11.159/27
0 pq qr
But w.r.t . t he quest ion, t he value of the last oct et
 (r – q)2 – (p – q) (p – r ) = 0 of last host in t his net wor k is 200.10.11.158.
 p2 + q2 + r 2 – pq – qr – pr = 0 49. ambn an bm  This one is CFL
 (p – q)2 + (q – r )2 + (r – p)2 = 0 ambn ambn  by pumping lemma t his one is not
 p– q = 0; q – r = 0, r – p = 0 CFL.
 p = q = r ...(2) a m
bn m  2n  1 This is CFL .

14 SOLVED PAPER – 2015 (SET - 3)

50. j and k will be evaluat ed t o 2 and -1 r espect ively. (ii) SJF


I n for loop : Process AT BT LT TAT
When i = 0; 1 t ime pr int ed (– 1) A 0 3 3 3
When i = 1; 1 t ime pr int ed (0) B 1 6 9 8
When i = 2; 3 t imes pr int ed (1, 1, 1)
C 4 4 15 11
When i = 3; 3 t imes pr int ed (2, 2, 2)
D 6 2 11 5
When i = 4; 2 t imes pr int ed (3, 3)
27
 on t he whole pr int f is execut ed 10 t imes  6.75
4
51. I n funct ion main x will be updat ed as follows
Gant t char t A B D C
x = x + f1 ( ) + f2 ( ) + f3 ( ) + f2 ( ) x
0 3 9 11 15
 B– 6 C– 9
1 26 51 100 52 D– 2
N ot e : st at ic var iable in f 2 ( ) will be init ialized
(iii) SRTF
only once & it r et ains value in bet ween funct ion
calls. Process AT BT CT TAT
54. Since p– q q– p A 0 3 3 3
 (p, q) R (p, q) B 1 6 15 14
 R is not r eflect ive C 4 4 8 4
L et (p, q) R (r , s) D 6 2 10 4
t hen p– s=q– r 25
 r – q =s– p  6.25
4
 (r, s) R (p, q) Gantt char t
 R is symmet r ic
55. Process AT BT 

A 0 3  A– 2 B– 5 C– 2 B– 5 B– 5
 B– 6 C– 4 B– 5 D– 2
B 1 6  Given Snapshot D– 2
C 4 4  (iv) R.Q (Q = 2)

D 6 2  Process AT BT CT TAT
(i) FcFs A 0 3 5 5
Process AT BT LT TAT B 1 6 15 14
A 0 3 3 3 C 4 4 13 9
B 1 6 9 8 D 6 2 11 5
C 4 4 13 9 33
 8.25
D 6 2 15 9 4
29 Gant t Chart
 7.25 R. Q
4
Gant t char t A B C D
0 3 9 13 15



You might also like