Beruflich Dokumente
Kultur Dokumente
125CarryOneMarkEach
1.
Considerthefollowingstatements:
P:
Goodmobilephonesarenotcheap
Q:
Cheapmobilephonesarenotgood
L: PimpliesQ
M: QimpliesP
N: PisequivalenttoQ
WhichoneofthefollowingaboutL,M,andNisCORRECT?
(A)OnlyLisTRUE.
(B)OnlyMisTRUE.
(C)OnlyNisTRUE.
(D)L,MandNareTRUE.
2. Youhaveanarrayofnelements.Supposeyouimplementquicksortbyalwayschoosingthecentral
elementofthearrayasthepivot.Thenthetightestupperboundfortheworstcaseperformanceis
A0n2
3.
B0nlogn
Cnlogn
D0n2
Oneofthepurposesofusingintermediatecodeincompilersisto
P:
makeparsingandsemanticanalysissimpler.
Q:
improveerrorrecoveryanderrorreporting
R:
4. WhichofthefollowingstatementsareCORRECT?
P: Staticallocationofalldataareasbyacompilermakesitimpossibletoimplementrecursion.
Q: Automaticgarbagecollectionisessentialtoimplementrecursion.
R: Dynamicallocationofactivationrecordsisessentialtoimplementrecursion.
S: Bothheapandstackareessentialtoimplementrecursion.
(A)1and2only
(B)2and3only
(C)3and4only
(D)1and3only
5. InthefollowingpairsofOSIprotocollayer/sublayeranditsfunctionality,the
INCORRECTpairis
(A) NetworklayerandRouting
(B) DataLinkLayerandBitsynchronization
(C) TransportlayerandEndtoendprocesscommunication
(D) MediumAccessControlsublayerandChannelsharing
6. Abitstuffingbasedframingprotocolusesan8bitdelimiterpatternof01111110.Iftheoutputbit
stringafterstuffingis01111100101,thentheinputbitstringis
(A)0111110100
(B)0111110101
(C)0111111101
(D)0111111111
7. HostA(onTCP/IPv4networkA)sendsanIPdatagramDtohostB(alsoonTCP/IPV4networkB).
AssumethatnoerroroccurredduringthetransmissionofD.WhenDreachesB,whichofthe
followingIPheaderfield(s)maybedifferentfromthatoftheoriginaldatagramD?
(i)TTL
(ii)Checksum
(iii)FragmentOffset
(A)(i)only
(B)(i)and(ii)only
(C)(ii)and(iii)only
(D)(i),(ii)and(iii)
8. EveryhostinanIPv4networkhasa1secondresolutionrealtimeclockwithbatterybackup.Each
hostneedstogenerateupto1000uniqueidentifierspersecond.Assumethateachhosthasa
globallyuniqueIPv4address.Designa50bitgloballyuniqueIDforthispurpose.Afterwhat
period(inseconds)willtheidentifiersgeneratedbyahostwraparound?
9. An operating system uses shortest remaining time first scheduling algorithm for preemptive
schedulingofprocesses.ConsiderthefollowingsetofprocesseswiththeirarrivaltimesandCPU
bursttimes(inmilliseconds):
Process
P1
P2
P3
ArrivalTime
0
2
3
BurstTime
12
4
6
P4
8
5
Theaveragewaitingtime(inmilliseconds)oftheprocessesis_________.
10. ConsidertheCfunctiongivenbelow.AssumethatthearraylistAcontainsn(>0)elements,soredin
ascendingorder.
intProcessArray(int*listA,intx,intn)
{
Int1,j,k;
i=0;
j=n1;do
{
k=(i+j)/2;
if(x<=listA[k])j=
k1;
If(listA[k]<=x)i=
k+1;
}while(1<=j);If
(listA[k]==x)
return(k);
else
return1;
}
WhichoneofthefollowingstatementsaboutthefunctionProcessArrayisCORRECT?
(A) ItwillrunintoaninfiniteloopwhenxisnotinlistA.
(B) Itisanimplementationofbinarysearch
(C) ItwillalwaysfindthemaximumelementinlistA.
(D) Itwillreturn1evenwhenxispresentinlistA.
11. The memory access time is 1 nanosecond for a read operation with a hit in cache, 5
nanosecondsforareadoperationwithamissincache,2nanosecondsforawriteoperation
withahitincacheand10nanosecondsforawriteoperationwithamissincache.Execution
ofasequenceofinstructionsinvolves100instructionfetchoperations,60memoryoperand
readoperationsand40memoryoperandwriteoperations.Thecachehitratiois0.9.The
averagememoryaccesstime(innanoseconds)inexecutingthesequenceofinstructionsis
__________.
12. IfGisaforestwithnverticesandkconnectedcomponents,howmanyedgesdoesGhave?
(A)
An
sw
er:
n/k
(B)n/k
(C)nk
(D)nk1
13. Considerthefollowingrelationalschema:Employee
empId,empName,empDeptCustomer
custId,custName,salesRepId,rating
SalesRepIdisaforeignkeyreferringtoempIdoftheemployeerelation.Assumethateach
employeemakesasaletoatleastonecustomer.Whatdoesthefollowingqueryreturn?
SELECTempName
FROMemployeeE
WHERENOTEXISTS(SELECTcustId
FROMcustomerC
WHEREC.salesRepId=E.empId
ANDC.rating<>GOOD)
(A) NamesofalltheemployeeswithatleastoneoftheircustomershavingaGOODrating.
(B) NamesofalltheemployeeswithatmostoneoftheircustomershavingaGOODrating.
(C) NamesofalltheemployeeswithnoneoftheircustomershavingaGOODrating.
(D) NamesofalltheemployeeswithalltheircustomershavingaGOODrating.
14. Whichofthefollowingstatementsis/areTRUEforundirectedgraphs?
P: Numberofodddegreeverticesiseven.
Q: Sumofdegreesofallverticesiseven.
(A)Ponly
(B)Qonly
(C)BothPandQ
(D)NeitherPnorQ
15.
A) n
(B) n logn
(C) n
(D) n logn
16. WhichofthefollowingstatementsareTRUE?
P: TheproblemofdeterminingwhetherthereexistsacycleinanundirectedgraphisinP.
Q: TheproblemofdeterminingwhetherthereexistsacycleinanundirectedgraphisinNP.
R: IfaproblemAisNPComplete,thereexistsanondeterministicpolynomialtimealgorithmto
solveA.
17. AssumethatsourceSanddestinationDareconnectedthroughtwointermediaterouterslabeledR.
Determinehowmanytimeseachpackethastovisitthenetworklayerandthedatalinklayer
duringatransmissionfromStoD.
S
(A) Networklayer4timesandDatalinklayer4times
(B) Networklayer4timesandDatalinklayer3times
(C) Networklayer4timesandDatalinklayer6times
(D) Networklayer2timesandDatalinklayer6times
18. Thetransportlayerprotocolsusedforrealtimemultimedia,filetransfer,DNSand
email,respectivelyare
(A)TCP,UDP,UDPandTCP
(B)UDP,TCP,TCPandUDP
(C)UDP,TCP,UDPandTCP
(D)TCP,UDP,TCPandUDP
19. Aschedulingalgorithmassignspriorityproportionaltothewaitingtimeofaprocess.Every
process starts with priority zero(the lowest priority). The scheduler reevaluates the process
prioritieseveryTtimeunitsanddecidesthenextprocesstoschedule.Whichoneofthefollowing
isTRUEiftheprocesseshavenoI/Ooperationsandallarriveattimezero?
P: Thisalgorithmisequivalenttothefirstcomefirstservealgorithm
Q: Thisalgorithmisequivalenttotheroundrobinalgorithm
R: Thisalgorithmisequivalenttotheshortestjobfirstalgorithm
S: Thisalgorithmisequivalenttotheshortestremainingtimefirstalgorithm
20.
Whichoneofthefollowingisthetightestupperboundthatrepresentsthenumberofswaps
requiredtosortnnumbersusingselectionsort?
(A)O(logn)
21.
(B)O(n)
(C)O(nlogn)
(D)O(n2)
Thesmallestintegerthancanberepresentedbyan8bitnumberin2scomplementformis
(A)256
22.
(B)128
(C)127
(D)0
Consideraninstructionpipelinewithfivestageswithoutanybranchprediction:FetchInstruction
(FI),DecodeInstruction(DI),FetchOperand(FO),ExecuteInstruction(EI)andWriteOperand
(WO).ThestagedelaysforFI,DI,FO,EIandWOare5ns,7ns,10ns,8ns
and6ns,respectively.Thereareintermediatestoragebuffersaftereachstageandthedelayof
eachbufferis1ns.Aprogramconsistingof12instructions I1 ,I 2 ,I 3 ,......I12isexecutedinthis
pipelinedprocessor.Instruction I4istheonlybranchinstructionanditsbranchtargetis I9.Ifthe
branchistakenduringtheexecutionofthisprogram,thetime(inns)neededtocompletethe
programis
(A)132
(B)165
(C)176
(D)328
23. ConsiderthefollowingoperationalongwithEnqueueandDequeueoperationsonqueues,where
kisaglobalparameter
MultiDequeueQ{mk
whileQisnotemptyandm0{Dequeue
24. Q
25. mm1
}
26.
}
Whatistheworstcasetimecomplexityofasequenceofnqueueoperationsonaninitiallyempty
queue?
(A)n
(B)nk
(C)nk
(D) n
24. Thepreordertraversalsequenceofabinarysearchtreeis30,20,10,15,25,23,39,35,42.Which
oneofthefollowingisthepostordertraversalsequenceofthesametree?
(A)10,20,15,23,25,35,42,39,30
(B)15,10,25,23,20,42,35,39,30
(C)15,20,10,23,25,42,35,39,30
(D)15,10,23,25,20,35,42,39,30
25. Considerthefollowingrelationalschema.
Students(rollno:integer,sname:string)
Courses(courseno:integer,cname:string)
Registration(rollno:integer,courseno;integer,percent:real)
WhichofthefollowingqueriesareequivalenttothisqueryinEnglish?
Findthedistinctnamesofallstudentswhoscoremorethan90%inthecoursenumbered107
(A) SELECTDISTINCTS.sname
FROMStudentsasS,RegistrationasR
WHERER.rollno=S.rollnoANDR.Courseno=107ANDR.percent>90
(II) snamecourseno107percent90RegistrationStudents
(III){T|SStudents,RRegistration(S.rollnoR.rollno
R.courseno107R.percent90T.snameS.name)}
(IV)SN|SRRPSR,SNStudentsSR,107,RPRegistrationRP90
(A)I,II,IIIandIV
(C)I,IIandIVonly
(B)I,IIandIIIonly
(D)II,IIIandIVonly
26. Thenumberofelementsthatcanbesortedinlogntimeusingheapsortis
(A)1
(B)logn
(C)
logn
(D)logn
loglogn
27. What is the minimum number of registers needed in the instruction set architecture of the
processor to compile this code segment without any spill to memory? Do not apply any
optimizationotherthanoptimizingregisterallocation
(A)3
(B)4
(C)5
(D)6
28. Completethesentence:
Universalismistoparticularismasdiffusenessisto________
(A)specificity
(B)neutrality
(C)generality
(D)adaptation
29. Wereyouabird,you___________inthesky.
(A)wouldfly
(B)shallfly
(C)shouldfly
(D)shallhaveflown
30 .Whichoneofthefollowingoptionsistheclosestinmeaningtothewordgivenbelow?
Nadir
(A)Highest
(B)Lowest
(C)Medium
(D)Integration