Top Banner
Continue
10

Daily paragraph editing terminal velocity answers

May 03, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 2: Daily paragraph editing terminal velocity answers

Dailyparagrapheditingterminalvelocityanswers

Postedbybrambletonininterview,interviews,managementinterview,techicalinterview.1commentsofarIdeabehindthispostingistohaveahugecollectionofallinterviewquestionsasasinglepage(mostofushavehighspeedconnections,thusloadingthispageisnotanissue).NOTEthatitisalmostimpossibleeitherverifysourceofthesequestionsorevenvaliditythatthesearegenuineones.Idonotintendtoinfringeuponanycopyrightedmaterial(sinceitisnotpossibletoverifythesequestions,itisequallyimpossibletoverifyifanycopyrighthasbeenviolated).Pleasepostcomment(s)andIwillcertainlymakeeveryattempttoremovethem,ifclaimsaredeemedcorrect.IalsoincludedGREwordlist.Onemoresalientfeatureofthislisting:Allquestionshaveanswers!![Letmeknowifanyanswerismissing]NOneedtowaittillbrowserloadsentirepage.Also,itisnoteasytoformatallquestions.Thislistingisforgettingknowledge,hopefullyhelpsyoutoincreaseinterviewpreparedness.ANYsuggestionsarewelcome.YoumayneedtouseCTRL+Ftofindakeywordorsubjectarea.Infosys1.Thereisaescalatorand2personsmovedownit.Atakes50stepsandBtakes75stepswhiletheescalatorismovingdown.GiventhatthetimetakenbyAtotake1stepisequaltotimetakenbyBtotake3steps.Findtheno.ofstepsintheescalatorwhileitisstaionary.Solution(notsure):IfAtakes1stepinonesecond,thenBtakes3stepsinonesecond.IfAtakest1secondstotake50steps,thenBtakes150stepsint1seconds.ForB,totake150stepsherequirest1seconds,thentotake75stepsherequirest1/2seconds.Sonow,s1=50,t1=t1&s2=75,t2=t1/2ans=(s1*t2~s2*t1)/(t1~t2)whichgives100.so100stepsistheanswer2.If5/2artistsmake5/2paintingsusing5/2canvasesin5/2daysthenhowmanyartistsrrequiredtomake25paintingsusing25canvasesin25days?3.Ifthedigitsofmypresentagearereversedthenigettheageofmyson.If1yearagomyagewastwiceasthatofmyson.Findmypresentage.ans.father-73,son-374.Thereare6561ballsoutofthem1isheavy.Findthemin.no.oftimestheballshavetobeweighedforfindingoutthehaevyball.ans.85.Ifiwalkwith30miles/hrireach1hourbeforeandifiwalkwith20miles/hrireach1hourlate.Findthedistancebetween2pointsandtheexacttimeofreachingdestinationis11amthenfindthespeedwithwhichitwalks.ans.120milesand24miles/hr6.Thererfourfacecards(J,Q,K,A)allofdifferenttypes(diamond,club,spade,heart)andsomeconditionsrgiven.findtheorderofcardsans.king->jack->queen->aceheartdiamondspadeclub7.IfA,B,C,D,Er5membersofafamily.4ofthemgivetruestatements:1.Eismymotherinlaw2.Cismysoninlaw’sbrother3.Bismyfather’sbrother4.Aismybrother’swifeWhomadethestmt.andwhatrtherealtionsamongthemans.E|AB–C|Ddenoteshusband-wife—denotesbrothers8.Theproductof5differenttemperaturesis12.Ifallofthenrintegersthenfindallthetemperaturesans.-2,-1,1,2,39.Therer9citiesnumbered1to9.Fromhowmanycitiestheflightcanstartsoastoreachthecity8eitherdirectlyorindirectlysuchthepathformedisdivisibleby3.eg.1368-Flightsgoesthrough1-3-6-8.10.Ifidothispuzzleifindittobehardthanthelastpuzzlethatididbeforethatafterthat…………..verycomplexstmt.Isthatpuzzledifficult,easy,can’tsayordependsontheno.ofpuzzles11.Replaceeachletterbyadigit.Eachlettermustberepresentedbythesamedigitandnobeginningletterofawordcanbe0.ONEONEONEONE——-TEN——-Ans:0=1,N=8,E=2,T=7.12.Ann,Boobie,CathyandDaveareattheirmonthlybusinessmeeting.Theiroccupationsareauthor,biologist,chemistanddoctor,butnotnecessarilyinthatorder.DavejusttoldthebiologistthatCathywasonherwaywithdoughnuts.Annissittingacrossfromthedoctorandnexttothechemist.ThedoctorwasthinkingthatBoobiewasagoofynameforparent’stochoose,butdidn’tsayanything.Whatiseachperson’soccupation?Ans:SinceDavespoketothebiologistandAnnsatnexttothechemistandacrossthedoctor,CathymustbetheauthorandAnnthebiologist.Thedoctordidn’tspeak,butDaviddid,soBobbieisthedoctorandDavethechemist.13.Sometimeafter10:00PMamurdertookplace.Awitnessclaimedthattheclockmusthavestoppedatthetimeoftheshooting.Itwaslaterfoundthatthepostionofboththehandswerethesamebuttheirpositionshadinterchanged.Tellthetimeoftheshooting(bothactualandclaimed).Ans:Timeofshooting=11:54PMClaimedTime=10:59PM.14.Nextnumberintheseriesis1,2,4,13,31,112,?Ans:224.Nonumberhasdigitsmorethan4.Allofthemare1,2,4,8,16,32,64convertedtonumbersinbase5.15.Shahrukhspeakstruthonlyinthemorningandliesintheafternoon,whereasSalmanspeakstruthonlyintheafternoon.AsaysthatBisShahrukh.IsitmorningorafternoonandwhoisA–ShahrukhorSalman?Ans:Afternoon.AisSalman.16.Twotrainsstartingatsametime,onefromBangaloretoMysoreandotherinoppositedirectionarriveattheirdestination1hrand4hoursrespectivelyafterpassingeachother.Hownuchfasterisonetrainfromother?Ans:Twice.17.Thereare6volumesofbooksonarackkeptinorder(ievol.1,vol.2andsoon).Givethepositionafterthefollowingchangeswerenoticed.AllbookshavebeenchangedVol.5wasdirectlytotherightofVol.2Vol.4hasVol.6toitsleftandbothweren’tatVol.3’splace.Vol.1hasVol.3onrightandVol.5onleft.AnevennumberedvolumeisatVol.5’splaceFindtheorderinwhichthebooksarekeptnow.Ans:2,5,1,3,6,4.18.Iboughtacarwithapeculiar5digitnumberedlicenceplatewhichonreversingcouldstillberead.Onreversingvalueisincreasedby78633.Whatstheoriginalnumberifalldigitsweredifferent?Ans:Only0168and9canbereadupsidedown.Soonrearrangingthesedigits,wegettheansweras10968.19.Theshapeinthesketchbelowisthatofasquareattachedtohalfofasimilarsquare.Divideitintofourequalpieces.Ans:Hint:Thefigurecanbedividedinto12equaltriangles.======STARTHERE=================20)Therearetwoballstouchingeachothercircumferencically.Theradiusofthebigballis4timesthediameterofthesmallall.Theoutersmallballrotatesinanticlockwisedirectioncircumferencicallyoverthebiggeroneattherateof16rev/sec.ThebiggerwheelalsorotatesanticlockwiseatNrev/sec.Whatis‘N’forthehorizontallinefromthecentreofsmallwheelalwaysishorizontal.21)1234+3455———-4689–2345———-2344+1254————3698————Q)Strikeoffanydigitfromeachnumberinsevenrows(neednotbeatsameplace)andcombinethesameoperationswith3digitnumberstogetthesameaddition.AfterthisstrikeoffanotherdigitfromallandaddalltheNo.stogetthesame2digitNo.performthesameprocessagainwith1digitNo.s.Givethe‘no.sin7rowsateachstage.22)Thereisasafewitha5digitNo.The4thdigitis4greaterthanseconddigit,while3rddigitis3lessthan2nddigit.The1stdigitisthricethelastdigit.Thereare3pairswhosesumis11.Findthenumber.Ans:65292.23)thereare2guardsBalandPalwalkingonthesideofawallofawearhouse(12mX11m)inoppositedirections.TheymeetatapointandBalsaystoPal“Seeyouagainintheotherside”.AfterafewmomentsofwalkingBaldecidestogobackforasmokebuthechangeshisdirectionagaintohispreviousoneafter10minutesofwalkingintheother(opposite)directionrememberingthatPalwillbewaitingfortomeet.IfBalandPalwalk8and11feetrespectively,howmuchdistancetheywouldhavetravelledbeforemeetingagain.24.13kigsand6libscanproduce510torsin10hrs,8kigsand14libscanproduce484torsin12hrs.Findtherateofproductionoftorsforkigsandlibs.Expresstheanswerintors/hr.25)xxx)xxxxx(xxx3xx——-xxxx3x——-xxx3xx——-Q)Findthe5digitNo.Hint:5isusedatleastonceinthecalculation.26)Aflyisthere1feetbelowtheceilingrightacrossawalllengthis30matequaldistancefromboththeends.Thereisaspider1feetabovefloorrightacrossthelongwalleqidistantfromboththeends.Ifthewidthoftheroomis12mand12m,whatdistanceistobetravelledbythespidertocatchthefly,ifittakestheshortestpath.27)Rameshsitaroundaroundtablewithsomeothermen.Hehasonerupeemorethanhisrightpersonandthispersoninturnhas1rupeemorethanthepersontohisrightandsoon,Rameshdecidedtogive1rupeetohisright&heinturn2rupeestohisrightand3rupeestohisright&soon.Thisprocesswentontillapersonhas‘nomoney’togivetohisright.Atthistimehehas4timesthemoneytohisrightperson.HowmanymenaretherealongwithRameshandwhatisthemoneywithpoorestfellow.28)Questionrelatedtoprobabilitiesofremovingtheredballfromabasket,giventhattwoballsareremovedfromthebasketandtheotherballisred.Thebasketcontainsblue,red,yellowballs.29)Venkathas1boy&2daughters.Theproductofthesechildrenageis72.ThesumoftheiragesgivethedoornumberofVenkat.Boyiselderofthree.Canyoutelltheagesofallthethree.30)L:saysallofmyother4friendshavemoneyM:saysthatPsaidthatexactonehasmoneyN:saysthatLsaidthatpreciselytwohavemoneyO:saysthatMsaidthat3ofothershavemoney.P:LandNsaidthattheyhavemoney.Allareliers.Whohasmoney&whodoesn’thave?31)Postmanhasadataofnamesurnamedoornumber,petnameof4families.Butonlyoneiscorrectforeachfamily.Thereareasetofstatements&questions.33)4coupleshaveaparty.Dependingonthesetofstatements,findwhoinsultedwhomandwhoisthehostoftheparty.34)5womengivensomeoftheirheights(tall,medium,short)Hair(long,plainted),stards(BlackorBrown),sari,2medium,2-short.Tall->nosari.Plainted->medium.Answerthecombinations.35)ApersonhastogobothNorthwards&Southwardsinsearchofajob.Hedecidestogobythefirsttrainheencounters.Therearetrainsforevery15minbothsouthwardsandnorthwards.Firsttraintowardssouthisat6:00A.M.andthattowardsNorthisat6:10.Ifthepersonarrivesatanyrandomtime,whatistheprobabilitythathegetsintoatraintowardsNorth.36)Apersonhashisowncoach&.Wheneverhegoestorailwaystationhetakeshiscoach.Onedayhewassupposedtoreachtherailwaystationat5O’clock.Buthefinishedhisworkearlyandreachedat3O’clock.Thenherunguphisresidenceandaskedtosendthecoachimmediately.Hecametoknowthatthecoachhasleftjustnowtotherailwaystation.Hethoughtthatthecoachhasleftjustnowtotherailwaystation.Hethoughtthatheshouldnotwastehistimeandstartedmovingtowardshisresidenceatthespeedof3miles/hr.Ontheway,hegetsthecoachandreacheshomeat6o’clock.Howfarishisresidencefromrailwaystation.37)Radha,Geeta&Revathiwentforapicnic.Afterafewdaystheyforgotthedate,dayandmonthonwhichtheywenttopicnic.RadhasaidthatitwasonThursday,May8andGeetasaidthatitwasThursdayMay10.RevathisaidFridayJun8.Nowoneofthemtoldallthingswrongly,othersonethingwrongandthelasttwothingswrongly.IfApril1stistuesday,whatistherightday,dateandmonth?38.Thereis66x33mrectangulararea.Ramis11/8timesfasterthanKrishna.Bothofthemstartedwalkingatoppositeendsandtheymetatsomepointthen,Ramsaid“Seeyouintheotherend”Thentheycontinuedwalking.AftersometimeRamthoughthewillhaveteasoheturnedbackwalkedback15metersthenhechangedhismindagainandcontinuedwalking.HowmuchKrishnahastraveledbythetimetheymeet?39.Thereare5burglarsandoncewenttoabakerytorobitobviouslyThefirstguyate1/2ofthetotalbreadand1/2ofthebread.Thesecondguyate1/2oftheremainingand1/2ofthebread.Thethirdguy,fourthguyandfifthguydidthesame.Afterfifthguythereisnobreadleftout.Howmanybreadarethere?40.AllmembersbelongingtoDaremembersofA.AllmembersbelongingtoEaremembersofD.AllmembersbelongingtoCaremembersofbothA&D.SomemembersofAdoesnotbelongtoD.AllmembersbelongingtoDaremembersofE.5questionsarethere.41.Writeeachstatementstrueorfalse:-1.Thesumofthe1stthreestatementsandthe2ndfalsestatementgivesthetruestatement.2.Theno.oftruestatementsfalsestatement.3.Thesumof2ndtruestatementand1stfalsestatementgivesthefirsttruestatement.4.Thereareatmost3falsestatements.5.Thereisnotwoconsecutivetruestatements.42.Therearetwelveconsecutiveflagsatanequalintervalofdistance.Amanpassesthe8thflagin8seconds.Howmanymoresecondswillhetaketopasstheremaining4flags?43.Apersonhastocoverthefixeddistancethroughhishorses.Therearefivehorsesinthecart.Theyranatthefullpotentialforthe24hourscontinuouslyatconstantspeedandthentwoofthehorsesranawaytosomeotherdirection.Sohereachedthedestination48hoursbehindtheschedule.Ifthefivehorseswouldhaverun50milesmore,thenthepersonwouldhavebeenonly24hourslate.Findthedistanceofthedestination.44.AboatMleavesshoreAandatthesametimeboatBleavesshoreB.Theymoveacrosstheriver.Theymetat500yardsawayfromAandafterthattheymet300yardsawayfromshoreBwithouthaltingatshores.FindthedistancebetweentheshoreA&B.45.ApersonwasgoingthroughtrainfromBombaytoPune.Aftereveryfiveminuteshefindsatraincomingfromoppositedirection.Velocityoftrainsareequalofeitherdirection.IfthepersonreachedPuneinonehourthenhowmanytrainshesawinthejourney?46.Foodgrainsaretobesenttocityfromgodown.Ownerwantstoreachthefoodgrainsat11O’Clockinthecity.Ifatrucktravelsataspeedof30km/hrthenhewillreachthecityonehourearlier.Ifthetrucktravelsataspeedof20km/hthenhewillreachthecityonehourlate.Findthedistancebetweenthegodowntocity.Alsowithwhichspeedthetruckshouldtravelinordertoreachatexactly11‘Oclock.47.TherearefivepersonsA,B,C,D,Ewhosebirthdaysoccurattheconsecutivedays.BirthdayofAissomedaysordaybeforeC&birthdayofBisexactlythesamedaysordayafterE.DistwodaysolderthanE.IfbirthdayofCisonWednesdaythenfindoutthebirthdaysofother.48.Personssaythesestatements.AsayseitherDemocraticorliberalwinstheelections.BsaysDemocraticwins.Csaysneitherdemocraticnorliberalwinstheelection.Oftheseonlyoneiswrong.Whowinstheelection?49.SixpersonsA,B,C,D,E&Fwenttosoldiercinema.Therearesixconsecutiveseats.AsitsinthefirstseatfollowedbyB,followedbyCandsoon.IfAtakenonofthesixseats,thenBshouldsitadjacenttoA.CshouldsitadjacenttoAorB.DshouldsitadjacenttoA,BorCandsoon.Howmanypossibilitiesarethere?50.SupposetherearefourgradesA,B,C,D.(AisthebestandDistheworst)4personsJack,Jean,PoulandLucywrotethefinalexamandmadethestatementslikethis:-1.Jack:IfIwillgetAthenLucywillgetD.2.Lucy:IfIwillgetCthenJackwillgetD.JackgradeisbetterthanPoulgrade.3.Jean:IfJeandoesn’tgetAthenJackwillnotgetA.4.Poul:IfJackgetA,thenJeanwillnotgetB,LucywillgetC,Iwon’teitherAorB.Ifalltheabovestatementsaretrue,thenwhichpersonwillgetwhichgrade?51.Eachmandanceswith3women,Eachwomendanceswith3men.Amongeachpairofmentheyhaveexactlytwowomenincommon.Findtheno.ofmenandwomen.52.Asurveywastakenamong100peopletofindtheirpreferenceofwatchingt.v.programmes.Thereare3channels.Givennoofpeoplewhowatchatleastchannel1,atleastchannel2,atleastchannel3,nochannelsatall,atleastchannels1and3,atleastchannels1and2,atleastchannels2and3.Findthenoofpeoplewhowatchedallthree.53.AbirdkeeperhasgotPpigeon,MmynasandSsparrows.Thekeepergoesforlunchleavinghisassistanttowatchthebirds.Supposep=10,m=5,s=8.a.)Whenthebirdkeepercomesback,theassistantinformsthatxbirdshaveescaped.Thebirdkeeperexclaimsohno!allmysparrowsaregone.Howmanybirdsflewaway.b.)whenthebirdkeepercomeback,theassistanttoldhimthatxbirdshaveescaped.Thekeeperrealisedthatatleast2sparrowshaveescaped.Whatisminimumnoofbirdsthatcanescape.54.SelectfromthefivealternativesA,B,C,D,E.Attheendofeachquestion,twoconditionswillbegiven.Thechoicesaretofilledasfollows.A:Ifadefiniteconclusioncanbedrawnfromcondition1.B:Ifadefiniteconclusioncanbedrawnfromcondition2.C:Ifadefiniteconclusioncanbedrawnfromcondition1and2.D:Ifadefiniteconclusioncanbedrawnfromcondition1or2.E:Noconclusioncanbedrawnusingbothconditions.1.Person1saysN5.Person3says3N>20Person4says3n>10Person5saysNXisaBtype.Zsays–>XisofBtype.Whoisofwhichtype?58.PersonsAandB.PersonApicksarandomno.from1to1000.ThenpersonBpicksarandomno.from1to1000.WhatistheprobabilityofBgettingno.greaterthenwhatAhaspicked?59.Threeboysandthreegirlsbroughtuptogether.Jim,Jane,Tom,Virgina,Dorthy,XXX.Theymarryamongthemselvestoformthreecouples.Conditionsare:-i)Sumoftheirageswouldbethesame.ii)Virginawastheoldest.iii)Jimwasdorthy’sbrother.iv)SumofagesJane+JimandTom+dorthyissame.Givethethreecouples.60.X^(1/3)–X^(1/9)=60.SolveforX.61.XZY+XYZ=YZX.Findthethreedigits.62.Twoboatsstartfromoppositebanksofriverperpendiculartotheshore.Oneisfasterthentheother.Theymeetat720yardsfromoneoftheends.Afterreachingoppositeendstheyrestfor10minseach.Afterthattheystartback.Thistimeonthereturnjourneytheymeetat400yardsfromtheotherendoftheriver.Calculatethewidthoftheriver.63.BasketballTournamentorganizersdecidedthattwoconsecutivedefeatswillknockouttheteam.Thereare51teamsparticipating.Whatisthemaximumno.ofmatchesthatcanbeplayed.64.TheMastersaystohisgrandmasterthatmeandmythreecousinshaveagesinprimenos.only.Summationofouragesis50.Grandmasterwhoknowstheageofthemasterinstantlytellstheagesofthethreecousins.Telltheagesofthreecousins.(1isnotconsideredasprimeno.)65.TherearetwofamiliesAlensandsmiths.Theyhavetwochildreneach.TherenamesareA,B,C,Dwhoseagesaredifferentandagesarelessthenorequalto11.Thefollowingconditionsaregiven:-i)A’sageisthreeyearslessthenhisbrother’sage.ii)Biseldestamongthefour.iii)CishalftheageoftheeldestinAlensfamily.iv)ThedifferenceinsumoftheagesofAlenschildrenandsmithschildrenissameasthatoffiveyearsago.Findtheagesofallthechildren.66.a,b,c,d,earehavingnumericalvalues.Therearesomeconditionsgiven:-a)a=cProblemnumber25to28pageno.4.90.A,B,Care3girlsandthereare770Apples.Forevery4Apples,Atakes,Btakes3.Forever6Apples,Ctakes7Apples?Ans:261:145:303.91)T,U,Vare3friendsdigginggroupsinfields.IfT&Ucancompleteigroovein4days&,U&Vcancomplete1groovein3days&V&Tcancompletein2days.Findhowmanydayseachtakestocomplete1grooveindividually.Ans:24days.92)4mathematicianhasxapples.Ifhearrangestheminrowsof3onewillbeleft.Thesameisthecasewith5,7,9apples.Butwhenhearrangedtheminrowsof11,nonwillbeleft.Findtheno.ofapples.Ans:946.(Hint:11*611*1111*1611*21=2E……11*76=3D946).93)HstartsrunningafterTreaches1/5ththeymustwhenHreach1/6th,ifHwantswinatwhatspeedHshouldberun?Note:Onecircleisthere,youshowthistypeofproblem.94)Thereare4mothers,4daughtersandthecolouroftheirdresses,andtheyareaged1,2,3&4.Detailsofthedressesaregiven&thenitaskedabouttheremainingdresses.95)Thereare5levelsofdollsandeachofdifferentcolors&conditionaregiven.Note:Thistypeofproblemalsorefer.96)5studentA,B,C,D,E.Onestudentknows5languages.Likethatuptoonelangauge.Conditions:-*)Spanishismostpopularlangauge.*)3personsknowsPorchigese.*)B&CnormallyspeakEnglish,butwhenDgathered,theyswitchedtoSpanishbecausethatisonlycommonbetweenthethree.*)OnlylangaugecommonbetweenA,B,EisFrench.*)OnlylangaugecommonbetweenC&EisItalian.97.Anescalatorisdescendingatconstantspeed.Awalksdownandtakes50stepstoreachthebottom.Brunsdownandtakes90stepsinthesametimeasAtakes10steps.Howmanystepsarevisiblewhentheescalatorisnotoperating.ANS.150.98.Everydayacyclistmeetsatrainataparticularcrossing.Theroadisstraigntbeforethecrossingandbotharetravellinginthesamedirection.Cyclisttravelswithaspeedof10Kmph.Onedaythecyclistcomeslateby25min.andmeetsthetrain5kmbeforethecrossing.Whatisthespeedofthetrain.60kmph.99.Fivepersonsmuckerjee,misra,iyer,patilandsharma,alltakethenfirstormiddlenamesinthefullnames.Thereare4personshavingfirstormiddlenameofkumar,3personswithmohan,2personswithdevand1anil.—Eithermukherjeeandpatilhaveafirstormiddlenameofdevormisraandiyerhavetheirfirstormiddlenameofdev.—Ofmukherkjeeandmisre,eitherbothofthemhaveafirstormiddlenameofmohanorneitherhaveafirstormiddlenameofmohan.—Eitheriyerofsharmahasafirstormiddlenameofkumarbutnotboth.Whohasthefirstormiddlenameofanil?TodayisMukherjee.101.Twoturnshavevertainpeculiarcharacteristics.OneofthemalwaysliesonMonday,Wednesday,Friday.TheotheralwaysliesonTuesdays,thursdaysandsaturdays.Ontheotherdaystheytellthetruth.Youaregivenaconversation.PersonA—Todayissundayandmynameisanil.PersonB—TodayistuesdayandmynameisBill.Whatistoday?Todayistuesday.102)Whichofthefollowingstatementscanbededucedfromtheinformationpresented?i)IfitisSunday,thetwinswillbothsayso.ii)IfitisnotSunday,onetwinwillgivethecorrectdayandtheotherwilllieabouteverything.iii)Onanygivenday,onlyonetwinwillgivehiscorrectname.a)ionly.b)iandiionly.c)iandiiionly.d)iiandiiionly.e)i,iiandiii.103)Ifthetwinsareheardsayingthefollowingonthesameday,whichchoicepresentsacorrectstatement?TwinA:“ItisSundayToday”.TwinB:“YesterdaywasSunday”.TwinA:“itissummerseasonnow”.a)Itisasummersunday.b)Itisasummermonday.c)ItisMondaybutnotsummer.d)ItisSundaybutnotsummer.e)ItisimpossibletodeterminewhetheritisSundayorMonday.104.Logicalreasoningtacticspracticepuzzlepoetry.1)Henny,Axie,Amiearefriends.Conditions:-a)HerryorAxiesistheoldest.b)IfAxieistheoldest,Amieistheyoungest.Whoistheyoungest&whoistheoldest?Ans:Amieistheyoungest,Axieisoldest.105.Thereisaroberyandfourpersonsaresuspectedoutofthemoneisactualthief,thesearethesentencessaidbyeachoneofthem!AsaysDhaddoneBsaysAhaddoneCsaysidddntdoneDBliedwhenhesaidthatiamthiefOutoftheseonlyonemanistrueremainingarefalseansCisthef,Distrue!106Howmanyfourdigitnumbersdivisiblebyfourcanbeformedusing1,2,3,4;repetitionsarenotallowed!ans6107Avendersoldstwothingsatsamecost12RSwithoneitemat25%profitandotherat20%loss,bythistransactionhemadeprofitorlossbyhowmuch?Ansloss,60paise108.Conversationbetweentwoemployeesisasfollows:-EMPLOYEE-1:Hello!Nowyourexperienceistwicethemyexperience.EMPLOYEE-2:Exactlytwotimes.EMPLOYEE-1:Butatthelastmeet,yousaidthatyourexperienceisthriceofmyexperience.EMPLOYEE-2:Thatiswhenwemetat2yearsback,yourexperienceisthricethatofyours.Whatistheexperienceoftwoemployesswiththecompany?Ans:EMPLOYEE-1:4yearsEMPLOYEE-2:8years.109therarefourpersonsA,B,C,Dandforlanguagesenglish,french,german,italian.conditions1onlyonelanguageisspokenbymorethantwomen2Adontknowenglish3amancanspeakeitherfrenchorgermanbutnotboth4allmancannotspekinagroup(nocommonlanguage)5AcanmediatewhenBandCwanttospeakwitheachother6eachmencanspeaktwolanguagesansAfrenchitalianBenglishfrenchCgermanitalianDgermanitalian110.Thereare3women,theyhavingthreejewells,nameddiamondemerald,ruby3womenA,B,C3thiefsD,E,FeachtheyhadtakenonejewelfromeachofthewomenfollowingconditionsonewhohadtakendiamondisthebachelorandmostdangerousD‘sbrotherinlawEwhoislessdangerousthanthethiefwhohadstolenemerald(thisisthekeyfromthisehadstolenruby)DdidntstolenfromBonemoreconditionisthere111.therewerethreesuspectsforarobberythathappendinabank,tommy,joyandbruceEachofthemweresayingthatIhaven’tdoneanythingandtheothertwohasdoneit.policefoundthattommywaslying.whoisthethief.3M(MARKS).112.Joestartedfrombombaytowardspuneandherfriendjulieinoppositedirection.theymeetatapoint.distancetravelledbyjoewas1.8milesmorethanthatofjulie.afterspendingsomebothstartedthereway.joereachesin2hourswhilejuliein3.5hours.Assumingbothweretravellingwithconstantspeed.Wathisthedistancebetweenthetwocities.113.therewerefivehuntersA,B,C,D,EandfiveanimalsA,B,C,D,E.Hunterhavingthesamenamewiththeanimaldidn’tkillit.Eachhunterhasmissedsomeanimal.AanimalwashuntbythehunterwhosenamematcheswithanimalhuntbyhunterB.CanimalwashuntbythehunterwhosenamematcheswithanimalhuntbyhunterD.EhashuntCandmissedD.findoutanimalshuntedbyA,B,C.6m.114.Aboypicksupthephoneandasks“Whoareyou?”.Thevoicefromtheothersideanswers“Iamyourmother’smother-in-law”.Whatistherelationoftheboywiththefellowspeakingattheotherend.115.Imaginearectangle.Itslength=2*width.Asquareof1inchiscutonallcornerssothattheremainingportionformsaboxwhenfolded.Thevolumeoftheboxis_____cubicinches.Findtheoriginaldimensionsofthebox.116.2personsaredoingparttimejobinacompanysayAandB.THecompanyisopenforallthe7daysoftheweek.‘A’workseverysecondday.‘B’worksevery3rdday.If‘A’worksonfirstjuneand‘B’worksonsecondjune.Findoutthedateonwhichboth‘A’and‘B’willworktogether.117.ConsiderapileofDiamondsonatable.Athiefentersandsteals1/2ofthetotalquanityandthenagain2extrafromtheremaining.Aftersometimeasecondthiefentersandsteals1/2oftheremaining+2.Then3rdthiefentersandsteals1/2oftheremaining+2.Then4ththiefentersandsteals1/2oftheremaining+2.Whenthe5thoneentershefinds1diamondonthetable.Findoutthetotalno.ofdiamondsoriginallyonthetablebeforethe1stthiefentered.118.Imagine4personsA,B,C,D.(Itisastrengthdetermininggame).Afoundithard,butcouldpull‘C’and‘D’tohisside.ACandBDpairsonoppositesidesfoundthemselvesequallybalanced.WhenAandBexchangedthierpositionstoformpairsADandBC,BCpaircouldwinandpullADtothierside.Orderthe4personsinAscendingorderaccordingtothierstrengths.119.Considerabeautycontest.3personsparticipate.TheirnamesareAttractive,Delectable,Fascinating.Theyarefrom3tribesPukkas,Wottas,Summas.Pukkas–Alwaysspeaktruth.Wottas–Alwaysspeaklies.Summas–Speaktruthandliesalternatively.Eachofthe3personsmake2statements.Thepersonwhospeakstruthistheleastbeautiful.Fromthestatementstheygiveandthecharacterofthe3tribaltypes,findoutwhichpersonbelongstowhichtribe.AlsofindoutthepersonsintheAscendingorderoftheirbeauty.120.Thereare5positions-Clerk,Buyer,Cashier,Manager,Floorwalker.Thereare5persons-Mrs.Allen,Mrs.CLark,Twain,Ewing,Bernett.Conditions:1.Clerkandcashierlunchtime11.30.to12.30.2.Others12.30to1.30.3.Mrs.AllenandBernettplaydurindlunchtime.4.ClerkandcashiershareBachlorrooms.5.EwingandTwainarenotingoodtermsbecauseonedaywhenTwainretunedearlyfromlunchhesawEwingalreadysittingforlunchandreportedabouthimtothemanager.Findoutwhichpersonholdswhichpost.121.Thereare8coursestobehandledbyfacultyin2semesters.4in1stsemesterand4in2ndsemester.Thecandiadateshiredforthepostarek,l,m,n,o.ThecoursesareMalvino,Shakespeare,Joyce,Chauncer………..Someconditionswillbegivenlike,1.LandNhandleShakespeareandMalvino.2.MandOhandleMalvinoandJoyce.122.AfamilyIknowhasseveralchildren.Eachboyinthisfamilyhasasmanysistersasbrothersbuteachgirlhastwiceasmanybrothersassisters.Howmanybrothersandsistersarethere?ans:4boysand3girls.123.No.ofanimalsis11morethantheno.ofbirds.Iftheno.ofbirdsweretheno.ofanimalsandno.ofanimalsweretheno.ofbirds(ie.,interchangingno.sofanimalsandbirds.),thetotalno.oflegsgetreducedbyonefifth(1/5).Howmanyno.ofbirdsandanimalswerethere?ans:birds:11,animals:22124.Inasoapcompanyasoapismanufacturedwith11parts.Formakingonesoapyouwillget1partasscrap.Attheendofthedayuhave251suchscraps.Fromthathowmanysoapscanbemanufactured?ans:22+2+1=25.125.2**|3**|No.7doesnotoccurinthis—————-|5**|multiplication.*4*|**3|Findtheproduct.—————-|*****|————-|————————————————–ans281322—–562562084300———90482———126.Thereisa5digitno.3pairsofsumiseleveneach.Lastdigitis3timesthefirstone.3rddigitis3lessthanthesecond.4thdigitis4morethanthesecondone.Findthedigit.ans:25296.127.Therearefivethieves,eachlootabakeryoneaftertheothersuchthatthefirstonetakes1/2ofthetotalno.ofthebreadsplus1/2ofabread.Similarly2nd,3rd,4thand5fthalsodidthesame.Afterthefifthoneno.ofbreadsremainedare3.Initiallyhowmanybreadswerethere?ans:31.128.Therearesomechickeninapoultry.TheyarefedwithcornOnesackofcornwillcomefor9days.Thefarmerdecidestosellsomechickenandwantedtohold12chickenwithhim.Hecutsthefeedby10%andsackofcorncomesfor30days.Soinitiallyhowmanychickenarethere?129.TwopeopleX&Ywalkonthewallofagodowninoppositedirection.Theymeetatapointononesideandthengoahead.Xafterwalkingforsometime,walksinoppositedirectionfor15mtrs.Thenagainheturnsbackandwalksintheoriginaldirection.WhatdistancedidYwalkbeforetheymetagain,ifXwalks11mtrsbythetimeYwalks8mtrs.130.ProblemfromSAKUNTALADEVI‘PUZZLESTOPUZZLEU’.Problemno:23(Walkingbacktohappiness.)131.Findafivedigitnumbersubjecttofollowingconditions:-a.Itcontains2primenodigits.b.3rddigitisthelagest.c.1stdigit=(3rddigit–1).c.Sumof4thdigitand5thdigitislessthan1stdigit.d.Valueofthe5thdigitliesbetweenthevalueof1stdigitand2nddigit,5thdigitisonehalfofthe4thdigit.Ans:71842132.1,2,3,4digitsareavailable.Howmanynumberof4digitednumberswhicharedivisibleby4.(Thereshouldbenorepetitionofdigitsinthenumbers)canbeformed?Ans:6numbers.133.Ahillof440yardsisthere.TwocompetitorsJACKandJILLgoupthehill,firstJACKreachesthetopmostandimmediatlystartsbackandmeetJILL20yardsfromthetopmostpoint.FinallyJACKreachesthestartingpoint0.5minutesearlerthanJILL.Speedwhilecomingdownis1.5timesthespeedofgoingup.FindthetimetakenbyJACKforwholejourney(880yards)?Ans:6.3minutes.134.Amerchantinthelastdaysells2lampsforRs.12price.Hefindsthathehasgot25%gainononeand20%lostontheother.Didhelooseorgainoverall?Ifsohowmuch?Ans:60paiseLoss.135.4personsaretherecaleddJOHN,JACOB,PITER,andWILLIAMS.4laungagesaretherenamedENGLISH,ITALIAN,GERMAN,FRENCH.Conditions:-a.Thereisnocommonlanguageforall.b.Exceptonelanguage,nolanguageisspokenbymorethantwo.c.OnecanknoweitherGermanorFRENCHbutnotboth.d.Johncan’tspeakENGLISHButJohncanactasinterpreterbetweenJACOBandPITER.JacobknowsGERMANbuthecantailkwithWILLIAMwhodoesn’tknowawordofGERMAN.e.NocommonlanguagebetweenJOHN,PITER,andWILLIAMS.Whichtwolanguagesdoeseachpersonspeaks?Hint:ITALIANISSPOKENBYTHREEPERSONS(ThishintisgiveninQuestionpaper)136.5couplesarethere.MEN:L,M,N,O,P.WOMEN:S,T,U,V,W.10seatsareinonerow.OddnumberdseatsarereservedforMENonlyLikethatmanyconditionsarethere.ThisproblemisfromGRE-BARRONSBOOK.137.Iparticipatedinarace.1/5thofthosewhoarebeforemeareequalto5/6thofthosebehindme.Whatwerethetotalnumberofcontestantsintherace?138.Findthe3digitnumber.Thirddigitissquarerootoffirstdigit.Seconddigitissumoffirstandthirddigits.Findthenumber.139.Thisproblemisoftimeandworktype.SomeAandsomeBareabletoproducesomanytorsinsomanyhours.(forexample10Aand20Bareabletoproduce30torsperhour).Likethisonemoresentencewasgiven.WehavetofindouttherateofworkingofAandBintors/hour.140.AandBplayagameofdicebetweenthem.Thediceconsistsofcolorsontheirfacesinsteadofnumbers.Awinsifbothdiceshowsamecolor.Bwinsifbothdiceshowdifferentcolors.Onediceconsistsof1redand5blue.Whatmustbethecolorinthefacesofotherdice.(i.ehowmanyblueandhowmanyred?).ChancesofwinningforAandBareeven.141.Agirlhas55marbles.Shearrangestheminnrows.Thenthrowconsistsofnmarbles,the(n-1)throwconsistsof(n-1)marblesandsoon.Whatarethenumberofmarblesinnthrow?142.Thisquestionisofanalogytype.SomesentencesregardingtastesofpeopletopoetryaregivenlikeallwholikeA’sPoem,likethepoemsofB.Likethis7or8sentencesweregiven.Questionswerebasedonthis.143.Thisquestionisalsoofanalogytype.FourpersonsarethereA,B,C,D.EachofthefourpersonsowneitherP,Q,R,S.10sentencesusingifclauseweregiven.Wehavetofindoutwhichbelongstowhom.144)EverystationinNrailroadissueseveryotherstation’sticket.Somestationsareadded.Nowtheyhavetoissue46moretickets.GivetheNo.ofstationsafterandbeforeadded.145)Therewasaracebetween3people.Me,DougandAnne.WhenItake21stepsthedistancecoveredisequaltoDoug’s24stepsandAnne’s28steps.Itake6stepstoevery7stepsofDougand8stepsofAnne.Whowontherace?146)Howmanybearerswillanexplorerneedfora6daymarchifeachmancancarrythefoodstuffofonemanfor4days.147)Considerthefollowingstatements:Albert:Davedidit.Dave:Tonydidit.Gug:Ididnotdoit.Tony:Daveliedwhenhesaidthatididit.(a)Ifonlyoneoutofallabovestatementsistrue,whodidit?(b)Ifonlyoneoutofallabovestatementsisfalse,whodidit?148)AcontributionofRs.500wasraisedfrom500people.Thefeewasasfollows:Men:Rs.3.00eachWomen:Rs.2.00eachChildern:0.48eachIfnumberofwomenismorethannumberofmen,howmanychildernarethere?149)AliceandLiuhadsomeberries.ThetotalofAlice’sberriesandsquareofnumberofberrieswithLiuis62.ThetotalofLiu’sberriesandsquareofnumberofberrieswithAliceis176.Howmanyberriesdoeseachofthemhave?150)Aropeladderwasleftdownfromaship.12stepsoftheladderwereexposedat10:00am.Thequeenwhowasgoingtovisittheship,saidshewouldvisitat1:00pmasshewouldhavetoclimblessernumberofstepsthen.Thetideintheseaincreasesfrommorningtoafternoonattherateof1.2metersperhour.Thedistancebetweenany2stepsoftheladderis0.4mts.Howmanystepswillthequeenhavetoclimb?151)5huntersDoe,Deer,Hare,BoarandRowkill5animals.Eachhunterkillsananimalthatdoesnotcorrespondtohisname.Alsoeachhuntermissesadifferentanimalwhichagaindoesnotcorrespondtohisname.a)TheDeeriskilledbythehunter,knownbythenameoftheanimalkilledbyBoar.b)Doeiskilledbythehunter,knownbynameofanimalmissedbyHare.c)TheDeerwasdisappointedtokillonlyaHareandmissedtheRoe.152)Alocalforecastservicehasaccuracyof2/3saysNorain,andMeteriologicalservicehavingaccuracyof4/3saysRain.ifPreferenceisasnorainwhatisthechanceofrain?153)a)101928374655647382__b)2416512_Writethenextelementsintheseries.154)AManissittinginthelastcoachoftraincouldnotfindaseat,sohestartswalkingtothefrontcoach,hewalksfor5minandreachesfrontcoach.Notfindingaseathewalksbacktolastcoachandwhenhereachesthere,trainhadcompleted5miles.Whatisthespeedofthetrain.155)TheOldcarofMaryrequirestyrestobechangedaftereach24000km.Ifshewantstogofor42000kmjourneythenhowmanyminimumnumberoftyresshewillneed.156)Acoinissounbalancedthatitmaycomebothheadsin2tossesasitmaycometailsinasingletoss.Whatistheprobabalityofgettingaheadinasingletoss.157)Apen,pencilanderasertogethercost$1.00.if2E2P,and3P>4Ethenwhatasinglepenwillcost?158)Alocalforecastservicehasaccuracyof2/3saysNorain,andMeteriologicalservicehavingaccuracyof4/3saysRain.ifPreferenceisasnorainwhatisthechanceofrain?159)SherlockholmesthrwatedtheplantokidnappMrsmarywhentheywerequestionedMercyandhistwoassociatedshipyandrany.whentheyweretellingthestoryoneofthemtoldonethingwrongandothertrue,theothertoldbothtrue,andthelasttoldbothfalse.examiningthefollowingtelltherolesplayedbyeachMercy::1)iwrotetheransomenote2)shipybrokeintothewindowrany1)shipywrotetheransomenote2)mercyranawaywiththeladyshipy1)ibrokeintothewindow2)ranywrotetheransomenote.160)Tomaskedkimdidyoulikethestamps?Shesaidyes,meandrobtoolikedthem.Kimagainsaidthatrobgot3morethanhewouldhavegot,ifiwouldhavekept2morethan,whathegot.TomaskedhowmanyugaveRob?Shereplied2morethanwhatIgot.Tell,howmanystampseachrobandkimgot?161)Thevirgoclubmembersusedtomeeteveryweektoplaycards.Eachtimetheyusedtoseataroundaroundtableandfortheirmemorytheyusedallthepossiblecombinationsofpostionseachforasingletimeonly.Canyoutellforhowmanytimestheymet?EssaysAskedIfyouaregivenachancetochangeathinginyouhometown,whatwouldyouchange?Giveexampleswhyyouwanttodoso.Televisioniscreatingacommunicationgapamongyounggeneration.162.Apersonneeds6stepstocoveradistanceofoneslab.Ifheincreaseshisfootlength(steplength)by3inchesheneedsonly5stepstocovertheslabslength.Whatisthelengthoftheeachslab.Ans:31inches.163.Thereare19redballsandoneblackball.Tenballsareputinonejarandtheremaining10areputinanotherjar.Whatisthepossibilitythattheblackisintherightjar.Ans:1/2.164.Thereisonelilyinthepondon1stjune.Therearetwointhepondon2ndjune.Therearefouron3rdjuneandsoon.Thepondisfullwithliliesbytheendofthejune.(i)Onwhichdatethepondishalffull?Ans:29th.–thejunehas30days).(ii)Ifwestartwith2lilieson1stjunewhenwillbethepondbefullwithlilies.Ans:29thJune.165.AlorrystartsfromBangloretoMysoreat6.00A.M,7.00A.M,8.00am…..10pm.SimilarlyoneanotherstartsfromMysoretoBangloreat6.00am,7.00am,8.00am…..10.00pm.Alorrytakes9hourstotravelfromBangloretoMysoreandviceversa.(i)Alorrywhichhasstartedat6.00amwillcrosshowmanylorries.Ans:10.(ii)Alorrywhichhadstartedat6.00pmwillcrosshowmanylorries.Ans:14.166.Apersonmeetsatrainatarailwaystationcomingdailyataparticulartime.Onedayheislateby25minutes,andhemeetsthetrain5k.m.beforethestation.Ifhisspeedis12kmph,whatisthespeedofthetrain.Ans:60kmph.Refer–ShakuntalaDeviBook.167.Atheifstealshalfthetotalnoofloavesofbreadplus1/2loaffromabackery.Asecondtheifstealshalftheremaingnoofloavesplus1/2loafandsoon.Afterthe5ththeifhasstolentherearenomoreloavesleftinthebackery.Whatwasthetotalnoofloavesdidthebackeryhaveatthebiggining.Ans:31.168.Agardenerplants100meterstowardseast,next100meterstowardsnorth,next100meterstowardswest.98meterstowardseast,96meterstowardsnorthand96meterstowardswest,94meterstowardssouth.and94meterstowardseastandsoon.Ifapersonwalksbetweenthetreeswhatisthetotaldistancetravelledbyhimbeforehereachesthecenter.Ans:|—————||||||||——–|-|———————|-.169.Therearefourwomenand3men.Theyplaybridgeonenight.Findwidowamongthem.Rules:(i)wifeandhusbandareneverpartners.(ii)Wifeandhusandneverplaymorethanonegame.Onenighttheyplayedfourgamesasfollows:-1.——+——vs——-+———2.——+——vs——-+———3.——+–*—vs——-+———4.—*–+——vs——-+———thewomanaremarked*above.Ans:ReferProblem21.MindTeasersbySummers.170.Fromavessel,1/3rdoftheliquidevaporatesonthefirstday.Onthesecondday3/4thoftheremainingliquidevaporates.Whatfractionofthevolumeispresentattheendofthesecondday.Ans:50%.171.Thereisa4inchcubepaintedonallsides.Thisiscutdownintoof1inchcubes.Whatisthenoofcubeswhichhavenopointedsides?Ans:8.172.SamandMalahaveaconversation.SamsaysIamcertainlynotover40.MalasaysIam38andyouareatleast5yearsolderthanme.Now,Samsaysyouareatleast39.Allthestatementsbythetwoarefalse.Howoldaretheyreally?Ans:Mala=38yrs;Sam=41yrs.173.RamSinghgoestohisofficeinthecity,everydayfromhissuburbanhouse.HisdriverGangaramdropshimattherailwaystationinthemorningandpickshimupintheevening.EveryeveningRamSinghreachesthestationat5O’Clock.Gangaramalsoreachesatthesametime.OnedayRamSinghstartedearlyfromhisofficeandcametothestationat4O’Clock.Notwantingtowaitforthecarhestartswalkinghome.Mangaramstartsatnormaltime,pickshimuponthewayandtakeshimbackhouse,halfanhourearly.HowmuchtimedidRamSinghwalk?174.Inarailwaystation,therearetwotrainsgoing.Oneintheharbourlineandoneinthemainline,eachhavingafrequencyof10minutes.Themainlineservicestartsat5o’clockandtheharbourlinestartsat5.02A.M.Amangoestothestationeverydaytocatchthefirsttrainthatcomes.Whatistheprobabilityofthemancatchingthefirsttrain?Ans:0.8.175.AfamilyXwentforavacation.Unfortunatelyitrainedfor13dayswhentheywerethere.Butwheneveritrainedinthemornings,theyhadclearafternoonsandviceversa.Inalltheyenjoyed11morningsand12afternoons.Howmanydaysdidtheystaytheretotally?Ans:18.176.AlbertandFernandeshavetwolegswimmingrace.Bothstartfromoppositeendsofthepool.Onthefirstleg,theboyspasseachotherat18mfromthedeependofthepool.Duringthesecondlegtheypassat10mfromtheshallowendofthepool.Bothgoatconstantspeedbutoneofthemisfaster.Eachboyrestsfor4secondsattheendofthefirstleg.Whatisthelengthofthepool?177.Eachalphabetstandsforonedigitinthefollowingmultiplication.THISxIS———XFXXXXUX————XXNXX————WhatisthemaximumvalueTcantake?178.If1/4ofthetimefrommidnightplus1/2ofthetimefromnowtomidnightisthepresenttime,thenWhatisthepresenttime?2.Ina10digitnumber,ifthe1stdigitnumberisthenumberofones,2nddigitnumberisthenumberoftwos,and…soon.10thdigitisthenumberofzeroes,thenfindthenumber.179.Atrainblowsasirenonehourafterstartingfromthestation.Afterthatittravelsat3/5thofitsspeeditreachesthenextstation2hoursbehindschedule.Ifithadaproblem50milesfartherfromthepreviouscase,itwouldhavereached40minutessooner.Findthedistancebetweenthetwostations.180.Anarmy50mileslongmarchesataconstantrate.Acourierstandingattherearmovesforwardanddeliversthemessagetothefirstpersonandthenturnsbackandreachestherearofthearmyasthearmycompletes50miles.Findthedistancetravelledbythecourier.181.Olympicrace:4contestants:Alan,charlie,Darren,Brain.Therearetworacesandaverageistakentodecidethewinner.Onepersoncomesatthesamepositioninboththerace.CharliealwayscomebeforeDarren.Briancomesfirstonce.Alancomesthirdatleastonce.Findthepositions.Alannevercomeslast.Charlie&Darrencomes2ndatleastonce.182)Thereare6561numberofballsinabag.Outofwhichoneisheavyball.Inhowmanyminimumnumberofweighingyoucanfindtheheavyball.Ans:8.183)Theprofitmadebyacompanyinoneyearisenoughtogive6%returnonallshares.Butastheprefferedsharesgetonreturnof7.5%,sotheordinarysharesgotonreturnof5%.IfthevalueofpreferdsharesisRs4,000000,thenwhatisthevalueofordinaryshares?Ans:Rs.6,000000.184)Therewere50playersplayingagameamongthemselves.Eachplayerisoutofthegamewhenlose3matches.Whatisthenumberofmatchesshouldbeplayedinordertogetthewinner.185)A&Btwoplaces.C&Daretwopeople.CstartedfromAandDstartedfromB.WhentheymeeteachotherinthewayCtraveled18mmorethanD.ThenCtakes13andhalfaminuteandDtakes24minutestoreachtheotherend.WhatwasthedistancebetweenA&B.Ans:126.186)Ihavebeenhearingagirlsingingasongforlasttwoscore.Song:Ifseventimesfiveandthreetimessevenisaddedtomyageitwouldbeasfarabovesixninesandfourasthedifferencebetweentwiceofmyageandascore.Given-Ascoreis20yrs.187)AtouristwantstogofromAtoB.Therearefourwaystodothis:-1.Totakeawagon.Thewagonstopsforhalfanhouratastationinbetweena&bandthengoestob.2.TowalktoB.IfheleavsAatthesametimethewagonleaves,hewillbebetweenbythewagonby1miletoreachB.3.TowalkfromAatthesametimethewagonleavesfromA.Hewillarriveatthemidstationatthetimewhenthewagonispreparedtoleave.Hecantakethewagonfromthere.Thiswilltakeshortesttime.4.Togoonuptothemidstation&towalkfromthere.HewillreachatB15minutesbeforethewagon.WhatisthedistancebetweenA&B?.188)Inatrainthereisonebrakeman,conductor,engineer&fireman.TheirnamesareArt,John,Tom&Petegiveninthisorderorinreverseorder.Youhavetotelltheoccupationofthefour,w.r.t.theseconditions:-1.Brakemanhasnorelatives.2.Johnisolderthanart.3.Engineer&firemanarebrothers.4.Johnispete’snephew.5.Firemanisnotconductor’suncle.6.Conductorisnotengineer’suncle.Ans:Pete&Tomarebrothers.Tom–FatherandJohnishisson.Art–Brakeman.John–Conductor.Tom–Engineer.Pete–Fireman.189)Thereisa18strongbuildingand4peopleliveinit.Theyaredentist,lawyer,accountant,architect.Dentistflooris5timesthelawyer’sfloor.Accountisbelowdentist.Ifarchetectmovestwofloorsuphewillbemidwaybetweendentistandaccount.Ifarchitectmovestomidwayofthebuilding(9thfloor)thenhewillbemiddleofdentist&lawyer.Groundfloorcanbeignoredi.e.floor0.Ans:Dentist15.Accountant13.Archetect12.Lawyer3.190)4ladis,MrsMargarat,MrsPrice,MrsWinter&MrsEllenwentformarketing.Eachwentfor2shopsonly.Theirsurnamesarelorret,torrey,dorisandmarshall.Onewenttoahardwaresshop.Twowenttobank.Twowenttobuchers.Allbutdorriswenttogroceryetc.Whowentwhere?191).Asoftwareengineerstartsfromhomeat3pmforeveningwalk.Hewalksataspeedof4kmphonlevelgroundandthenataspeedof3kmphontheuphillandthendownthehillataspeedof6kmphtothelevelgroundandthenataspeedof4kmphtothehomeat9pm.Whatisthedistanceononeway?192).Abagcontainscertainnumberoffiles.Eachfileisnumberedwithonedigitof0to9.Supposethepersonwanttogetthenumberbetween1to2000(or7000check).Howmanyminimumnumberoffilesshouldbepresentinthebag..193).a+b+c+d=d+e+f+g=g+h+i=17.Ifa=4,whatarethevaluesofdandg.Eachlettertakenonlyoneofthedigitfrom1to9.Ans:a=4,b=2,c=6,d=5,e=3,f=8,g=1,h=7,i=9.194.Afrogjumps3ftcomesback2ftinaday.Inhowmanydayitwillcomeoutof30ftdeepwell?Ans:28day.195.A-B=CD/E=FG+H=IC.F=IAns:A=9,B=5,C=4,F=2.196.Whentheactualtimepass1hr,wallclockis10minbehindit.When1hrisshownbywallclock,tableclockshows10minaheadof1hr.Whentableclockshows1hr,thealarmclockgoes5minbehindit.Whenalarmclockgoes1hr,wristwatchis5minaheadofit.Assumingthatallclocksarecorrectwithactualtimeat12noon,whatwillbetimeshownbywristwatchafter6hr?Ans:5:47:32.5(nX60)50/60X70/60X55/60X65/60.197.AsoftwareengineerjustreturnedfromUS,haseatentoomuchfat&putalotofweight.Everysundayhestartswalking4km/hronlevelground,thenupat3km\hr,thenbackdownhillat6km\hr,thenagainonlevelgroundat4km\hrtillhereacheshisdestination.Ifhereturnedhomeat9p.m.,whatdistancedidhecovered?Ans:24km.198.Answerthequestionsfromfacts:-Themembersofcertaintribearedividedinto3castsabhor,dravidamp;magar.1.Anabhorwomancan’tmarrydravidman.2.Amagarwomancan’tmarryadravidman.3.Asontakesthecasteofhisfatherandadaughtertakescasteofhermother.5.Allmarriagesexceptthosementioned,arenotpermitted.6.Therearenochildrenbornoutofawedlock.199Thereare2scalesoftempA&B.ItwasgivenAvariesfrom14to133andBvariesfrom36to87.Findthetemperature,whentemperatureofAisequaltotempofB.Ans:52.5.Lett=mx+c,c=-70=>m=51/119a=a.51/119-70=>a=52.5.201.Thereare4marriedcouples,outofwhich,3poepleinagroupisneeded.Butthereshouldnotbehisorherspouseinthegroup.Howmanygroupsarepossible?Ans:32.202.Inthe4digits1,2,3,4,howmany4digitednumbersarepossiblewhicharedivisibleby4?Repeatationsareallowed.Ans:64.203.Twomenaregoingalongatrackofrailintheoppositedirection.Onegoodstraincrossedthefirstpersonin20sec.After10minthetraincrossedtheotherpersonwhoiscomminginoppositedirectionin18sec.Afterthetrainhaspassed,whenthetwopersonswillmeet?Ans:Approx.72min,checkitonce.204.Theno.ofchildren,adults.Theno.ofadultstheno.ofboys.Theno.ofboysno.ofgirls.Theno.ofgirlsno.offamily.Conditions:-1.Nofamilyiswithoutachild.2.Everygirlhasatleastonebrotherandsister.Ans:c>a>b>g>f;96543.205.Thereare4boys–Anand,Anandya,MadanandMuraliwithnic-namesperich,zomie,drummyandmadeenanotinthesameorder.Someconditions.Ans:Anand:PerichAnandya:DrummyMadan:ZombieMurali:Madeena206.Thereare2diamonds,1spadeand1cluband1aceandalso1king,1jackand1acearearrangedinastraightline.1.Thekingisatthirdplace.2.Theleftofjackisaheartanditsrightisking.3.Notworedcoloursareinconsecutive.4.Thequeensareseparatedbytwocards.Writetheorderofwhichsuits(hearts,clubs)andnames(jacksqueensetc.)arearanged?207.Writeeachstatementastrueorfalse.8Marks1.Thesumofthefirstthreestatementsandthesecondfalsestatementgivesthetruestatement.2.Theno.oftruestatements>No.offalsestatements.3.Thesumofsecondtruestatementandfirstfalsestatementgivesthefirsttruestatement.4.Thereareatmost3falsestatements.5.Therearenotwoconsequtivetruestatements.208.Thereare3pileseachcontains10,15,&20stones.ThereareA,B,C,D,F,GandHpersons.Onemancancatchuptofourstonesfromanypile.Thelastmanwhotakeswillwin.IffirstAstartsnextBandsoon,whowillwin?Ans:MaybeF.209.InacertaindepartmentstorethepositionofBuyer,Cashier,Clerk,Floorwalkar&Managerareheld,thoughnotnecessarilyrespectively,byEvans,Ames,Conroy,Davisamp;Buyer.Thecashier&themanagerwereroommatesincollege.TheBuyerisbachelor,Evans&MissAmeshaveonlybusinesscontactswitheachother.Mrs.Conroywasgreatlydosappointedwhenherhusbandtoldherthatthemanagerhadrefugedtogivehimaraise.Davisisgoingtobethebestmanwhentheclerk&thecashieraremarried.Whatpositiondoeseachpersonheld?210.Inafourteamfoot-balltournament,alltheteamsplayedeachOtherinthreeroundsofmatchesasshownintheTable–A.SomeofTheresultsofthetournamentareshownintheTable–B.UsingtheCluesgivenbelow,pleasefillintheblankcolumnsintheresultTable–B(Goalsfor&GoalsAgainst?).Note:Twopointsforwin,onepointfordraw&zeropointsfordefeatareawarded.Clues:1.Eastzonewonthetournamentdespitescoringonelessgoalthantherunners-up.2.NorthzonescoredanoddnumberofgoalsintheirfirstroundGame.3.Southzone,whofailedtoscoreintheirfinalmatch,werebeatenbyatwo-goalmargininthefirstround.4.Eastzonelosttheirmatchaginstwestzone.5.Allfourteamsscoredgoalsinthesecondroundmatches.6.WestzonescoredthesamenumberofgoalsagainsteastzoneasNorthzonescoredaginstthem.211.Eastzonescoredfourgoalsinroundtwomatch.Table–A(MatchesPlayed)Round1NorthzonevsSouthzoneWestzonevseastzone.Round2SouthzonevsWestzoneEastzonevsNorthzoneRound3SouthzonevsEastzoneWestzonevsNorthzone.Table–B(Results)PlayedWonDrawLostGolasForGoalsAgainstPointsEastZone3–––?34NorthZone3–––??4WestZone3–––433SouthZone3–––251212.Incertaincommunity,therearethousandmarriedcouples.Twothirdsofthehusbandswhoaretallerthantheirwivesarealsoheavierandthreequartersofthehusbandswhoareheavierthantheirwivesarealsotaller.Ifthereare120wiveswhoaretallerandheavierthantheirhusbands,howmanyhusbandsaretallerandheavierthantheirwives?213.BoththeGuptasandSinhashavetwoyoungsons,whoseagesareunderEleven.Thenamesoftheboys,whoseagesroundedofftothenearestyeararealldifferent,areRajesh,Praveen,LalithandPrathap.Takingtheagesoftheboysonlytothenearestyear,thefollowingstatementsaretrue:-Rajeshisthreeyearsyoungerthanhisbrotheris.Praveenistheoldest.Prathapis5yearsolderthantheyoungerSinha’sboy.LalithishalfasoldasoneoftheGuptha’sboys.Thetotalagesoftheboysineachfamilydifferbythesameamounttodayastheydidfiveyearsago.214.AlongDivisionProblem:-xx)xxxxxxxxx(xxxxxxxxx——xxxxx——xxxxx——-xxxx——-xxxxxx——-——-Inthecompletesolution,therearefour5’s.Findthemissingdigits.215.FollowingservicesareoperatedbyAsianairlinesbetweenthetwoarelocatedindifferentcountrieswithdifferenttimezones.Asitisnormallydone,thetimeshownisthelocaltime–vizIST&TST.RegularFlightSupersonicFlightArriveAlexandria17:10TST15:40TSTDepartAlexandria20:50TST22:50TSTArrivedRampur23:40ISTIsthearrivaltimeofsupersonicflightintoRampurfromAlexandriasameastheArrivaltimeoftheRegularflight,assumingeachService–RegularandSupersonicmaintainsitsownconstantspeedofflight.216)A,B,C,D,Erelated.Fourofthemmadethesestatementseach:-i)Cismyson-in-law’sbrother.ii)Bismyfather’sbrother.iii)Eismymother-in-law.iv)Aismybrother’swife.Whomadethesestatements?217)Ashipisawayfromtheshoreby180miles.Aplaneistravellingat10timesspeedoftheship.Howlongfromtheshorewilltheymeet?218)Aclockshowing6o’clocktakes30secstostrike6times.Howlongwillittaketostrike12atmidnight?Ans:66seconds.219)Onlyboysaged>16wearcoats.Boysaged>15gotowatchfootball.Somemorestatementsaregiven.Whatcanbesaidaboutthosewhoarewatchingfootball?220)Thereare3societiesA,Bamp;Chavingsometractorseach.AGivesBandCasmanytractorsastheyalreadyhave.AftersomedaysBgivesAandCasmanytractorsastheyhave.AftersomedaysCgivesAandBasmanytractorsastheyhave.Finallyeachhas24tractors.WhatistheoriginalNo.oftractorseachhadinthebeginning?Ans:A–39.B–21.C–12.221.BE*BE=ACB.A,B,C,Earenonzeronumbers.FindB,E.Ans:B=1E=9.222.A,B,C,D,Earehavingnumericalvalues.Therearesomeconditionsgiven:-a)A=CB!=Eb)DifferencebetweenAandCassameasdifferencebetweenCandBassameasdifferencebetweenAandD.c)C<AandC>D,ThenFindA,B,C,D,E.223.Therearesixcards,inwhich,ithastwokingcards.Allcardsareturneddownandtwocardsareopened.a)Whatisthepossibilitytogetatleastoneking?b)Whatisthepossibilitytogettwokings?224.Apersonwenttoashopandaskedforchangefor1.15paise,buthesaidthathecouldnotonlygivechangeforonerupeebutalsofor50p,25p,10pand5p.Whatwerethecoinshehad?Ans:1–>50p4—>10p1—>25p.225.Thereare3nursesandtheyworkaltogetheronlyonceinaweek.Nonurseiscalledtoworkfor3consecutivedays.Nurse1isoffontueseday,thursdayandsunday.Nurse2isoffonsaturday.Nurse3isoffonthursday,sunday.Notwonursesareoffmorethanonceaweek.Findthedayonwhichallthe3nurseswereonwork.226.Thereare5personsA,B,C,D,Eandeachiswearingablockorwhitecaponhishead.Apersoncanseethecapsoftheremaining4butcan’tseehisowncap.Apersonwearingwhitesaystrueandwhowearsblacksaysfalse.i)AsaysIsee3whitesand1black.ii)BsaysIsee4blacks.iii)EsaysIsee4whites.iv)CsaysIsee3blacksand1white.NowFindthecapswearedbyA,B,C,DandE.227.Therearetwowomen,KavithaandShamiliandtwomalesShyamandAravind,whoaremusicians.OutofthesefouroneisaPianist,oneFlutist,ViolinistandDrummer.i)AcrossAravindbeatsPianist.ii)AcrossShyamisnotaFlutist.iii)Kavitha’sleftisaPianist.iv)Shamili’sleftisnotaDrummer.v>FlutistandDrummeraremarried.228.1/3rdofthecontentsofacontainerevaporatedonthe1stday.3/4thoftheremainingcontentsofthecontainerevaporatedthesecondday.Whatpartofthecontentsofthecontainerareleftattheendofthesecondday?229.Amancovered28stepsin30secondsbuthedecidedtomovefastandcovered34stepsin18seconds.Howmanystepsarethereontheescalatorwhenstationary?1.Person1:MostofusaresatchJ.Person2:MostofusarejuteS.Person3:TwoofusaresatchJ.Person4:ThreeofusarejuteJ.Person5:IamsatchJwehavetofindwhoissatchandwhoisjute.Ans:S:SatchJ:Jute.2.Fourpersonsaretheretocrossabridgetheyhaveonetorchlight.PersonAcancrossin1min.PersonBcancrossin2min.PersonCcancrossin5min.PersonDcancrossin10min.Theyhavetocrossbridgewithin17min.Atatimeonlytwopersonscancross.I.A&B—->2.II.A10.IV.B2______________Total17.230.Whatisthemaximumnumberofslicescanyouobtainbycuttingacakewithonly4cuts?Ans:16.231.Threearethreeboxes.Infirstbox,twowhiteballs.Insecondbox,2blackballs.Inthirdbox,1white&1blackball.Thelablesontheboxesarenotcorrect.Thenyouhavetoopenoneboxandtofindthecolouroftheballsinallboxes.Ans:Opentheboxlabledblack&white.Ifwhiteballsaretherethentheboxlabledwithwhiteballscontainblackballsandlabledwithblackballscontainoneblackandonewhiteballandviceversa,iftwoblackballsarethere.232.Thereisa4inchcubepaintedonallsides.Thisiscutintonumberof1inchcubes.Whatisthenumberofcubeswhichhavenopaintedsides?233.SamandMalahaveaconversation.SamsaysIamcertainlynotover40.MalasaysIam38andyouareatleast5yearsolderthanme.NowSamsaysyouareatleast39.Allthestatementsbythetwoarefalse.Howoldaretheyrealy?234.Ramsinghgoestohisofficeinthecityeverydayfromhissuburbanhouse.HisdriverMangaramdropshimattherailwaystationinthemorningandpickshimupintheevening.EveryeveningRamsinghreachesthestationat5o’clock.Mangaramalsoreachesatthesametime.OnedayRamsinghstartedearlyfromhisofficeandcametothestationat4o’clock.Notwantingtowaitforthecarhestartswalkinghome.Mangaramstartsatnormaltime,pickshimuponthewayandtakeshimbackhouse,halfanhourearly.HowmuchtimedidRamsinghwalked?235.Somepeoplewentforvaction.Unfortunatelyitrainedfor13dayswhentheywerethere.Butwheneveritrainedinthemorning,theyhadcleanafternoodandviceversa.Inalltheyenjoyed11morningand12afternoons.Howmanydaysdidtheystaytheretotally?236.Geoffrey,HallmannandMollyattendandinterviewandgivethreedifferentstatementseach.Tomakeitalittlecomplex.Outofthethreestatementsmadebyeachone,oneisfalse.Geoffreysays:Iam22–falseHallmanniselderthanmebyoneyear.Mollyis25Hallmannsays:Iamnottheyoungest–Geoffreyis2yearsyoungerthanmeMollyisyoungerthanmebyoneyear–falseMollysays:Geoffreyis23IamayearyoungerthanGeoffrey(Idon’trememberthisstatementbutitisfalse.)Answer:Goeffreyis22asGoefstates,AndGoef==23asMollystates.Bothcannotbetrue.Eitheronehastobetrueoreitheronehastobefalse.Startderivingfromthispointanduget,GeoffreyHallmannMollyAge:232522237.Thereisacube,whichhastobeinscribedwiththefollowingpairofnumbersonoppositesides.1and6,2and4,3and5.Howmanydifferentwayscanitbedone?238.There’sanelectricwirerunning1kmfromthesideofabuilding.Thenumberofpolesinbetweenthemisplacedinanintervalofdistancebetweeneachother.Ifonepoleisremovedthenthedistancebetweeneachpolebecomes12/3meters.Findouthowmanypoleswerekept.239.ThetimetakentotravelintrainfromTownAtoTownBis5hours.Therearetrainsstartingfrombothtownsatanintervalof1hour.Howmanytrainsmeetin1trip?Ans:10trainscheckitastrainscomefrombothsideseveryhour.240.ShadowwenttoanIslewherethenativeslieandthevisitorsspeaktruth.Shadowsawasalesmanandwantedtoknowwhetherhewasanativeoravisitor.Hedidnotposeaquestiondirectlybutaskedhimindirectinstead.Shadowsawawomanandaskedthesalesman,”IsthataNATIVEorVISITOR?”.Forwhichthesalesmanreplied,”Sheisavisitor”.IsthesalesmanaNativeoraVisitor?Ans:SinceShadowhimselfsawhim/herasawomanandaskedthesalesman.TheSalesmanreplied,”SHE”bywhichhespeakstruthandisaVisitor.SalesmanisaVisitor.241.Threefriendsdividedsomebulletsequally.Afterallofthemshot4bulletsthetotalnumberofbulletsremainingisequaltothebulletseachhadafterdivision.Findtheoriginalnumberdivided.Ans:18(2marks)Initially.xxxNowx-4x-4x-4Equationis3x-12=x242.Thereare3societiesA,B,C.AlentcarstoBandCasmanyastheyhadalready.AftersometimeBgaveasmanytractorstoAandCasmanyastheyhave.Aftersometimecdidthesamething.Attheendofthistransactioneachoneofthemhad24.Findthecarseachorginallyhad.Ans:Ahad39cars,Bhad21cars&Chad12cars243.TheBulls,Pacers,LakersandJazzranforacontest.Anup,Sujit,Johnmadethefollowingstatementsregardingresults.AnupsaideitherBullsorJazzwilldefinitelywinSujitsaidheisconfidentthatBullswillnotwinJohnsaidheisconfidentthatneitherJazznorLakerswillwinWhentheresultcameitwasfoundthatonlyoneoftheabovethreehadmadeacorrectstatement.Whohasmadethecorrectstatementandwhohaswonthecontest.Ans:Sujith;Lakers244.FivepeopleA,B,C,D,Earerelatedtoeachother.Fourofthemmakeonetruestatementeachasfollows.(i)Bismyfather’sbrother.(ii)Eismymother-in-law.(iii)Cismyson-in-law’sbrother(iv)Aismybrother’swife.Ans:(i)D(ii)B(iii)E(iv)C245.Somestatementsaregivenbelow:LsaysallofmyotherfourfriendshavemoneyMsaysthatPsaidthatexactlyoneamongthemhasmoneyNsaysthatLsaidthatpreciselytwoamongthemhavemoneyOsaysthatMsaidthatthreeoftheothershavemoneyP,LandNsaidthattheyhavemoneyAlltheabovestatementarefalse..Whohasmoney&whodoesn’thaveanymoney?246.Fiftyminutesagoifitwasfourtimesasmanyminutespastthreeo’clock,howmanyminutesisittosixo’clock?Ans:Twentysixminutes.247.Ahotelhas10storeys.Whichfloorisabovethefloorbelowthefloor,belowthefloorabovethefloor,belowthefloorabovethefifth.Ans:Thesixthfloor.248.Sevenmemberssataroundatableforthreedaysforaconference.Themember’snameswereAbhishek,Amol,Ankur,Anurag,Bhuwan,VasuandVikram.ThemeetingswerechairedbyVikram.Onthefirsteveningmemberssataroundthetablealphabetically.Onthefollowingtwonights,VikramarrangedtheseatingssothathecouldhaveAbhishekasneartohimaspossibleandabesentmindedVasuasfarawayashecould.Onnoeveningdidanypersonhavesittingnexttohimapersonwhohadpreviouslybeenhisneighbour.HowdidVikrammanagetoseateverybodytothebestadvantageonthesecondandthirdevenings?Ans:Secondevening:Vikram,Ankur,Abhishek,Amol,Vasu,AnuragandBhuwan.Thirdevening:Vikram,Anurag,Abhishek,Vasu,Bhuwan,Ankur,Amol.249.TwotrainsstartfromstationsAandBspaced50kmsapartatthesametimeandspeed.Asthetrainsstart,abirdfliesfromonetraintowardstheotherandonreachingthesecondtrain,itfliesbacktothefirsttrain.Thisisrepeatedtillthetrainscollide.Ifthespeedofthetrainsis25km/handthatofthebirdis100km/h.Howmuchdidthebirdtraveltillthecollision.Ans:100kms.250.Fourprisonersescapefromaprison.Theprisoners,MrEast,MrWest,MrSouth,MrNorthheadtowardsdifferentdirectionsafterescaping.Thefollowinginformationoftheirescapewassupplied:TheescaperouteswereTheNorthRoad,SouthRoad,EastRoadandWestRoad.Noneoftheprisonerstooktheroadwhichwastheirnamesake.Mr.EastdidnottaketheSouthRoadMr.WestdidnottheSouthRoad.TheWestRoadwasnottakenbyMr.EastWhatroaddideachoftheprisonerstaketomaketheirescape?Ans:Mr.EasttooktheNorthRoadMr.WesttooktheEastRoadMr.NorthtooktheSouthRoadMr.SouthtooktheWestRoad.251.Completetheseries:5,20,24,6,2,8,?Ans:12(as5*4=20,20+4=24,24/4=6,6-4=2,2*4=8,8+4=12).252)Asoldierlooseshiswayinathickjungle.Atrandomhewalksfromhiscampbutmathematicallyinaninterestingfashion.FirsthewalksonemileEastthenhalfmiletoNorth.Then1/4miletoWest,then1/8miletoSouthandsoonmakingaloop.Finallyhowfarheisfromhiscampandinwhichdirection.Ans:Distancetravelledinnorthandsouthdirections1/2–1/8+1/32–1/128+1/512–andsoon=1/2/((1-(-1/4))Similarlyineastandwestdirections1-1/4+1/16–1/64+1/256–andsoon=1/((1-(–1/4))Addboththeanswers253)Howcan1000000000bewrittenasaproductoftwofactorsneitherofthemcontainingzerosAns:2power9x5power9254)Conversationbetweentwomathematcians:First:Ihavethreechildern.Theproductoftheiragesis36.Ifyousumtheirages,itisexactlysameasmyneighbour’sdoornumberonmyleft.Thesecondmathematicianverfiesthedoornumberandsaysthatitisnotsufficient.Thenthefirstsays”Okonemoreclueisthatmyyoungestisreallytheyoungest”.Immmediatelythesecondmathematiciananswers.Canyouanswerthequestionaskedbythefirstmathematician?Whatarethechilderenages?Ans1,6and6255)Lightglowsforevery13seconds.Howmanytimesdiditglowbetween1:57:58and3:20:47am.Ans:383+1=384256)500menarearrangedinanarrayof10rowsand50columnsaccordingtotheirheights.Tallestamongeachrowofallareaskedtofallout.AndtheshortestamongthemisA.Similarlyafterresumingthattotheiroriginalpodsitionsthattheshortestamongeachcolumnareaskedtofallout.AndthetallestamongthemisB.NowwhoistalleramongAandB?AnsA257)Apersonwithsomemoneyspends1/3forcloths,1/5oftheremainingforfoodand1/4oftheremainingfortravel.HeisleftwithRs100/-.Howmuchdidhehavewithhiminthebegining?Ans:Rs250/-258)Therearesixboxescontaining5,7,14,16,18,29ballsofeitherredorblueincolour.Someboxescontainonlyredballsandotherscontainonlyblue.Onesalesmansoldoneboxoutofthemandthenhesays”Ihavethesamenumberofredballsleftoutasthatofblue“.Whichboxistheonehesoldsout?Ans:Totalnoofballs=89and(89-29/2)=60/2=30andalso14+16=5+7+18=30260)Grassinlawngrowsequallythickandinauniformrate.Ittakes24daysfor70cowsand60daysfor30cowstoeatthewholeofthegrass.Howmanycowsareneededtoeatthegrassin96days.?Ans:20g–grassatthebeginningr–rateatwhichgrassgrows,perdayy–rateatwhichonecoweatsgrass,perdayn–noofcowstoeatthegrassin96daysg+24*r=70*24*yg+60*r=30*60*yg+96*r=n*96*ySolving,n=20.261)Therersomebeesinagarden..1/5thofthemwenttoaparticularflower,1/3rdwenttoanotherflower,3timesthedifferenceoftheabovetwowenttothirdflower..nonewasremainingnitwasroamingaround..howmanybeeswerethere?(3marks)Ans:15262)therewasacommunityinwhichtherewere1000couples.Inthat2/3rdofmenwhortallerralsoheaviern3/4thofthemenwhorheavierralsotallerntherewere120womenwhowerebothheavierntallerthanmen.Sohowmanymenrbothtallernheavierthanmen?263)Amandriveswithconstantspeed..nheaftersometimeheseesamilestonewith2-digits..thenhetravelsforanhrnseesthesame2digitsinreverseorder..nthenafteranhrheseesthatthemilestonehasthesame2digitswitha0betweenthem..sowhatsthemanspeed?Ans:45km/hr264)Therewere2systemsAnB.14degreesinAisequivalentto36insystemB.and133inAisequivalentto87inB.nowwhatisthetemperaturewheretheybothrequal?Ans:51.25(conversionA=(7/3)B-70)265)XYZXYZAB+AB–————————-CDEFBGAfindX,Y,Z,G266)Awomenbuyssomeshoestripsnthen4timesofthatshebuyspacketpinsnthen8timesofshoestripsshebuyshandkerchiefs..nshehasabillofRs3.24..nshepaysforeacharticleasmanypaiseasthererarticles(ofthtparticularitem).Nowwhatsthenumberofhandkerchiefs?Ans:16267)Ms.Anithagothersalarynshespenthalfofitinshoppingngave1RStoabeggar.Afterthat1/2oftheremainingmoneyshespendsinahotelnshegivesRs.2/-asatiptowaiter.nthen1/2oftheremainingshespendsagainnshegives3RSascharity..nafterthatfinallysheisleftwithRs1/-whenshecomesout.Whatstheactualmoneyshehad?Rs42/-(3marks)268.A

Page 3: Daily paragraph editing terminal velocity answers

personiscyclinginacirculartrack.Atsomepointhenoticesthat1/5ofpeopleinfrontofhimand5/6ofpeopletogethercondtitutethetotalno.ofcyclists.Findthetotalno.ofcyclists.Ans:31269.TrainsleavefromNewYorktoWashingtoneveryhouronthehour(1:00,2:00….).TrainsleavefromWashingtontoNewYorkeveryhouronthehourandhalfhour(1:00,1:30,2:0,2:30….).Ittakesatrain5hrstocompleteitsjourneyfromWashingtontoNewYorkaswellasfromnewyorktowashington.Atrainleavesfromnewyorktowashington.Findouthowmanytrainsitwillmeetbeforeitreacheswashington.Ans:19or21(notsure).270)Apen,pencilanderasertogethercost$1.00.if2E2P,andP>4Ethenwhatasinglepenwillcost?271.Inaclasstherearelessthan500students.whenitisdividedby3itgivesawholenumber.similarlywhenitisdividedby4,5or7givesawholenumber.findtheno.ofstudentsintheclass.ans:420272.Unclereubenandauntcynthiacametotowntoshopreubenboughtasuitandhatfor$15cynthiapaidasmuchasforherhatasreubendidforhissuitthenshespenttherestoftheirmoneyforanewdressonthewayhomecynthiacalledreuben’sattentiontothefactthathishatcost$1morethanherdressthensheaddedifwehaddividedourhatmoneydifferentlysothatweboughtdifferenthatsminecosting1and1/2timecostifyoursthenweeachwouldhavespentthesameamountofmoneyinthatcasesaidunclereuben“howmuchwouldmyhathavecost”Ans:Uncleshatcosts$6.4(totalmoneywas$29)273.Fourfamilynamesaregivenandtheirfrendsnamearegivenbutnotinorder.(uhavtofindwhichfrendbelongstowhichfamily)Eachfrendpreparessaladusing3differentfruits.theyaregivenapple,cherry,grape,banana.,notwofrensusesthesamecombination.Variousconditionsaregivenand4quesasked.Whichfruitdidmandydidn’tuse?Whoisfluresfriend?NamethefruitscommonbtwnEricaandstacy?274.HereisasimplemathematicalpuzzlesetbyLongfellowinhisownflowery,poeticallanguage.If1/5thofahiveofbeesflewtothebadambaflower,1/3rdflewtotheslandbara,3timesthedifferenceofthesetwonumbersflewtoanarbour,adonebeecontinuedtoflyabout,attractedoneachsidebythefragrantketakiandmalati,whatwasthetotalnumberofbees?Ans:15275.(don’tremembertheexactquestion)amanwhilesortingfilespicksupfilenumberone,missesone,picksupfileno.2,misestwofiles,andsoon…afterthathefoundthathepickedup5%ofthefiles.Howmanyfileswerethere?Ans:39276.Amanwalksat4km/hronplain,thenat3km/hruphillandthenreturnsthroughthesameroadat6km/hrdownhillandat4km/hrontheplain.Ittakesaltogether6hours.Sowhatdistancehecoveredinoneway?Ans:12kmSolution:Letplainroad=xkmAndhillroad=ykm?x/4+y/3+y/6+x/4=6?x/2+y/2=6?x+y=12277.Therearesomemenandsomelodgesforwhichthefollowingconditionsholdtrue–i)Eachlodgeisrepresentedbyexactly3men.ii)Eachmanisassociatedwithexactly2lodges.iii)Anypairoflodgehasonlyonemanincommon.Howmanymenandhowmanylodgeswerethere?Ans:6menand4lodges.Solution:i)L1isrepresentedbyM1,M2,M3.L2isrepresentedbyM3,M4,M5.L3isrepresentedbyM1,M4,M6.L4isrepresentedbyM2,M5,M6.ii)M1isassociatedwithL1,L3.M2isassociatedwithL1,L4.M3isassociatedwithL1,L2.M4isassociatedwithL2,L3.M5isassociatedwithL2,L4.M6isassociatedwithL3,L4.iii)CommonbetweenL1andL2isonlyM3.CommonbetweenL1andL3isonlyM1.CommonbetweenL1andL4isonlyM2.CommonbetweenL2andL3isonlyM4.CommonbetweenL2andL4isonlyM5.CommonbetweenL3andL4isonlyM6.i.eallthegivenconditionsaresatisfied.278.Apersonsells2itemsforRs.12each.Foroneheprofits25%andfortheotherhelosses20%.Altogetherdidhelossorgain?Andbyhowmuch?Ans:Helossesby60paise.Solution:Costpriceoftheitemforwhichhelosses=Rs.12*100/80=Rs.15.CostpriceoftheitemforwhichheGains=Rs.12*100/125=Rs9.6.?TotalcostpriceisRs.24.6andtotalsellpriceisRs.24.SoaltogetherhelossesbyRs.0.6.279.Myfather’sagewasxintheyearx².Iamobviouslytalkingabout20thcentury.Inwhichyearwasmyfatherborn?Ans:Intheyear1892.Solution:x=44as44²=1936andthesquareofanyotherintegerwillnotfallinbetween1900and2000.i.emyfatherwas44intheyear1936.?myfatherwasbornintheyear1892.280.Amanwasgoingbycycle.Aftergoing2/3rdoftotaldistancethecyclebrokedownandhehadtocompletethejourneyonfoot.Attheendhefoundthathewalkedtwiceaslongashewasoncycle.Howmanytimesthespeedofthecycleisasthespeedofwalking?Ans:4times.Solution:Letthedistancebezkm,speedofcyclebexkm/hrandwalkingspeedbeykm/hr.Thenhecovered2z/3kmbycyclein2z/3xhrandcoveredz/3kmonfootinz/3yhr.?accordingtothequestion2*2z/3x=z/3y?x/y=4.281.Inabadmintontournamentateamiseliminatedfromthetournamentifitlosses2games.Ifthereare51teamsthenwhatisthemaximumnumberofgamesrequiredtoselectthechampion?Ans:101Solution:Toeliminatethe50teams50*2=100gamesarerequired.Andthechampionteammayloseinatmost1game.?Max.no.ofgamesrequired=101.282.Thereare3tribesinaIsland.Sororeanwhoalwaysspeaktruth,NororeanwhoalwaysspeakfalseandMidoreanwhospeaktruthandfalsealternatelyineitherorder.FromthestatementsgivenbyA,BandC(whobelongto3differenttribes),threepersonsfromtheisland,identifywhobelongstowhichtribe.A:CisSororean.BisMidorean.B:AisNororean.CisMidorean.C:AisMidorean.IamSororean.Ans:ABCMidoreanNororeanSororeanSolution:Thinklogically.283.Thereare5personsA,B,C,D,E.Allofthemhavedifferentoccupationsandnoneofthemareofsameage.ThereprofessionsareConsultant,Planner,Engineer,NutritionistandTechniciandefinitelynotinthesameorder.Fromthefollowingconditionsdeterminewhoseprofessioniswhat?i)Theconsultantistheoldestamongthem.ii)TheTechnicianisnotyoungerthanthePlannerandthePlannerisnotyoungerthantheNutritionist.iii)DisnotasoldasAandalsonotasyoungasB,whoisnotasoldastheEngineerandalsonotasyoungasC.iv)Cisnottheyoungestamongthem.Ans:Namesaregivenindescendingorderoftheirages.ConsultantEngineerTechnicianPlannerNutritionistADBCESolution:Thinklogically.284.4persons,Watts,Roger,O’neilandSmith,wereeatinginarestaurantwhileSmithwaskilledbypoisoning.Duringinvestigationtheother3personsgavethefollowingstatements.Theygaveonefalsestatementeach.Watts:i)Ididn’tdoit.ii)O’neilsatbesideme.iii)Wehadourusualwaiter.Roger:i)Smithwasacrossthetablefromme.ii)Wehadanewwaiter.iii)Thewaiterdidn’tdoit.O’neil:i)Rogerdidn’tdoit.ii)ThewaiterhaspoisonedSmith.iii)Wattsliedwhenhesaidthatwehadourusualwaiter.OneamongthesethreepersonsandthewaitermurderedSmith.Whoisthemurderer?Ans:O’neilisthemurderer.Solution:Thinklogically.Ihavegiventhefalsestatementsinredanditalics.285Thereisa4inchcubepaintedonallsides.Thisiscutdownintoof1inchcubes.Whatisthenoofcubeswhichhavenopointedsides.Ans:8[(n-2)*(n-2)*(n-2)]wherenissidelengthofthecube286.Findthevaluesofeachofthealphabets.NOONSOON+MOONJUNEAns:9326287.Ifaclocktakes7secondstostrike7,howlongwillthesameclocktaketostrike10?Ans:Theclockstrikesforthefirsttimeatthestartandtakes7secondsfor6intervals-thusforoneintervaltimetaken=7/6.Therefore,for10secondsthereare9intervalsandtimetakenis9*7/6=10and1/2seconds.288.Fiftyminutesagoifitwasfourtimesasmanyminutespastthreeo’clock,howmanyminutesisittosixo’clock?Ans:Twentysixminutes.289.Everydayinhisbusinessamerchanthadtoweighamountsfrom1kgto121kgs,tothenearestkg.Whataretheminimumnumberofweightrequiredandhowheavyshouldtheybe?Ans:.Theminimumnumberis5andtheyshouldweigh1,3,9,27and81kgs.290.Ram,ShyamandGumnaamarefriends.Ramisawidowerandlivesaloneandhissistertakescareofhim.Shyamisabachelorandhisniececookshisfoodandlooksafterhishouse.GumnaamismarriedtoGitaandlivesinlargehouseinthesametown.Gitagivestheideathatallofthemcouldstaytogetherinthehouseandsharemonthlyexpensesequally.Duringtheirfirstmonthoflivingtogether,eachpersoncontributedRs.25.Attheendofthemonth,itwasfoundthatRs92wastheexpensesotheremainingamountwasdistributedequallyamongeveryone.ThedistributionwassuchthateveryonereceivedawholenumberofRupees.Howmuchdideachpersonreceive?Ans.Rs2(Hint:Ram’ssister,Shyam’snieceandGumnaam’swifearethesameperson)291.SamandMalahaveaconversation.•SamsaysIamcertainlynotover40•MalasaysIam38andyouareatleast5yearsolderthanme•NowSamsaysyouareatleast39Allthestatementsbythetwoarefalse.Howoldaretheyreally?Ans:Mala=38yrs,Sam=41yrs.292.Grassinlawngrowsequallythickandinauniformrate.Ittakes24daysfor70cowsand60daysfor30cowstoeatthewholeofthegrass.Howmanycowsareneededtoeatthegrassin96days.?Ans:20[Hint:g–grassatthebeginningr-rateatwhichgrassgrows,perdayy–rateatwhichonecoweatsgrass,perdayn–noofcowstoeatthegrassin96daysg+24*r=70*24*yg+60*r=30*60*yg+96*r=n*96*y,Solving,n=20.]293.Threecriminalswerearrestedforshoplifting.However,wheninterrogatedonlyonetoldthetruthinbothhisstatements,whiletheothertwoeachtoldonetruestatementandonelie.Thestatementswere:•ALBERT:(a)Chanderpassedthemerchandise.(b)Brucecreatedthediversion.•BRUCE:(a)Albertpassedthemerchandise.(b)Icreatedthediversion.•CLIVE:(a)Itookthegoodsoutoftheshop.(b)Brucepassedthemover.Ans:Albertpassedthegoods.Brucecreatedthediversion.Clivetookthegoodsoutoftheshop.294.ThereNstationsonarailroad.AfteraddingXstationsontherailroute46additionalticketshavetobeprinted.FindNandX.Ans.x=2andN=11(Letinitially,N(N-1)=t;Afteradding,(N+X)(N+X-1)=t+46;Trailanderrormethod)295.CompletetheTablegivenbelow:Threefootballteamsarethere.Givenbelowisthegrouptable.Fillinthex’sPlayedWonLostDrawGoalsForGoalsAgainstA22xxx1B2xx124C2xxx37Ans:ThefilledtableisgivenbelowPlayedWonLostDrawGoalsForGoalsAgainstA220071B201124C201137297.Fourprisonersescapefromaprison.Theprisoners,Mr.East,Mr.West,Mr.South,Mr.Northheadtowardsdifferentdirectionsafterescaping.Thefollowinginformationoftheirescapewassupplied:•TheescaperouteswereTheNorthRoad,SouthRoad,EastRoadandWestRoad.•Noneoftheprisonerstooktheroadwhichwastheirnamesake.•Mr.EastdidnottaketheSouthRoad•Mr.WestdidnottheSouthRoad.•TheWestRoadwasnottakenbyMr.EastWhatroaddideachoftheprisonerstaketomaketheirescape?Ans:Mr.EasttooktheNorthRoadMr.WesttooktheEastRoadMr.NorthtooktheSouthRoadMr.SouthtooktheWestRoad.298.Ahotelhastwowings,theeastwingandthewestwing.Someeastwingroomsbutnotallhaveanoceanview.Allwestwingroomshaveaharborview.Thechargeforallroomsisidentical,exceptasfollows:•Extrachargeforallharborviewroomsonorabovethe3rdfloor•Extrachargeforalloceanviewroomsexceptthosewithoutbalcony•Extrachargeforsomeharborroomsonthefirsttwofloor&someeastwingroomswithoutoceanviewbuthavingkitchenfacilities.Whichofthefollowingcannotbedeterminedonthebasisoftheinformationgiven:I.Whetherthereareanyroomswithoutabalconyforwhichanextrachargeisimposed.II.Whetheranyroomwithoutakitchenoraviewinvolvesanextracharge.III.Whethertwoextrachargesareimposedforanyroom.(A)Ionly(B)IIonly(C)IIIonly(D)IIandIIIonly(E)I,IIandIIIAns:(A)299.Ashipwentonavoyage.Afterithadtraveled180milesaplanestartedwith10timesthespeedoftheship.Findthedistancewhentheymeetfromstartingpoint.Ans:200miles.(Distancetraveledbyplane=1/10distancetraveledbyship+180)301.Father’sageisthreeyearsmorethanthreetimestheson’sage.Afterthreeyears,father’sagewillbetenyearsmorethantwicetheson’sage.Whatisthefather’spresentage?Ans:33years.302.Lightglowsforevery13seconds.Howmanytimesdiditglowbetween1:57:58and3:20:47am.Ans:383+1=384303.Thereare20poleswithaconstantdistancebetweeneachpole.Acartakes24secondtoreachthe12thpole.Howmuchwillittaketoreachthelastpole.Ans:41.45seconds(Letthedistancebetweentwopoles=x,Hence11x:24::19x:?)304.Amancollectscigarettestubsandmakesonefullcigarettewithevery8stubs.Ifhegets64stubshowmanyfullcigarettescanhesmoke.Ans:8+1=9305.Theminuteandthehourhandofawatchmeetevery65minutes.Howmuchdoesthewatchloseorgaintimeandbyhowmuch?Ans:Gains;5/11minutes306.Asurveywastakenamong100peopletofindtheirpreferenceofwatchingT.V.programs.Thereare3channels.Giventhenoofpeoplewhowatch•atleastchannel1•atleastchannel2•atleastchannel3•nochannelsatall•atleastchannels1and3•atleastchannels1and2•atleastchannels2and3Findthenoofpeoplewhowatchedallthree.307.Somestatementsaregivenbelow:•Lsaysallofmyotherfourfriendshavemoney•MsaysthatPsaidthatexactlyoneamongthemhasmoney•NsaysthatLsaidthatpreciselytwoamongthemhavemoney•OsaysthatMsaidthatthreeoftheothershavemoney•P,LandNsaidthattheyhavemoneyAlltheabovestatementarefalse.Whohasmoney&whodoesn’thaveanymoney?308.500menarearrangedinanarrayof10rowsand50columnsaccordingtotheirheights.Tallestamongeachrowofallareaskedtofallout.AndtheshortestamongthemisA.Similarlyafterresumingthattotheiroriginalpositionsthattheshortestamongeachcolumnareaskedtofallout.AndthetallestamongthemisB.NowwhoistalleramongAandB?Ans.A309.Mr.Mathursjewelshavebeenstolenfromhisbanklocker.Thebankhaslockersof12peoplewhicharearrangedinanarrayof3rowsand4columnslike:123456789101112•ThelockerbelongingtoJONESwastotherightofBLACK’SlockeranddirectlyaboveMILLAR’S.•BOOTH’SlockerwasdirectlyaboveMILLAR’S.•SMITH’SlockerwasalsoaboveGRAY’s(thoughnotdirectly).•GREEN’SlockerwasdirectlybelowSMITH’S.•WILSON’SlockerwasbetweenthatofDAVISandBOOTH.•MILLAR’SlockerwasonthebottomrowdirectlytotherightofHERD’S.•WHITE’SlockerwasonthebottomrighthandcornerinthesamecolumnasBOOTH’S.WhichboxbelongedtoMr.Mathurs?Ans:Boxnumber9belongstoMr.Mathurs.310.Problembasedonsets.100ppl.85aremarried,70havephone,75havehouse,60havecar.findpplhavinghouse,car,phoneandrmarried??easysetproblem.iamnotsureabtfiguresbutfindtotalpplwhodonothavethesethingsandsubtractfrom100togetpplhavingallthese.ans.10311.villageandtown.inbetweenahill.apersontravelsoncycle8kmuphilland24downhilltoreachtowncontinuouslyin2hrs50min.thenhecomestovillagein4hrsand30min.findhisspeeduphillanddownhill.ans.uphill6downhill16312.findwizard’sage.hisageis3timesson’sage,hisfather’sageis40morethantwicehisage.totaloftheiragesis1240.ans.360313.therersomesteps.icomedown7stepsthenseeamanatbottom.thenhecomesupandigodownatsamespeed(myspeed).when4stepsrremainingformeifindthtmanhasreachedthetop.formysinglestepdownwardshetook2stepsup.findtotalsteps.ans.22steps.314)Onepersonwenttomarkettopurchasethreevarietiesofchocolates.Hehadpurchased20itemswith20cents.Fudgesareavailableat4centseach,chacobarsareavailableat4forapennyandgumpintsareavailableat2apenny.Howmanyofeachitemhehadpurchased.315)Thereisafivedigitnumber,wherethethirdnumberisonehigherthanthesumoffirstandseconddigits.Fourthdigitistwiceoffifthandthirddigitistwicethefourth.Seconddigitisfivemorethanthefirstdigit.Whatisthenumber316)Acube,whichispaintedredonallitssides,iscutinto27cubeswiththreestraightcuts.Nowhowmanycubeshavei)Noredfaceii)Oneredfaceiii)Tworedfacesiv)Threeredfaces317)ItisatypicalTapproblem.Therearetwotaps,whichareusedtofillthetankandonetaptoemptythetank.Firsttapfillthetankin10min.,whilethesecondtakesquarterofanhourtofillthetankifbothareoperatedindependently.Thirdtapiscapableofemptyingthetankinsevenandahalfminutes.Ifallthetapsareopenedsimultaneously(whenthetankisempty)howlong(ifever)willittakeforthetanktogetfilledcompletely?318)Tenyearsbefore,oneissevenyearsmorethanthe“halftheage”ofother.Nowthebride’sageis30years.Andalsooneisnine-tenthstheageofother.Whatisgroom’spresentage.319)Twoguysaretossingcoinwithabetof$1foreachgame.Aftersometosses.,oneguyearned$3whiletheotherwonthreetimes.Howmanygamesdotheyplay.320)Thereisone8marksanalyticalquestion.WhichistheeasiestpuzzleIhadeverseen.Thereareintotaleightmembersinthegroup.Fivemembersaretobeselectedfromthatgroup.Theyhadgiventhreeconditions.Wehavetoanswerfourmultiple-choicequestionswhichareframedbasedontheabovethreeconditions.Inalmostallthequestions,answercanbefoundoutbyeliminatingtheanswersfromthechoices.GoingthrutheGREBarronsanalyticalsectionwillhelp.Getthegistofit.,ratherthantryingtosolvemoreandmore.321)Therearefourfriends,whoarespeakingaboutthepizza,whichoneofthematebefore.Eachonewillsayonestatementandweweregiventhatoneofthemislying.Wehavetofindoutwhoatethepizza.Easyone..,noneedtoworryabt.this.322)Alltheaboveninepuzzlesareveryeasywhencomparedtothisone.Thisisdifficultnotbecauseoflogicbutbecauseofitsgrammer.Thesentencestructureistoocomplicate.Thisquestionremindedmeofpuzzle127ofsakunthaladevi’sPuzzlestoPuzzleU.323.thereisa1kmlongwireplcesonxpoles.ifthenoofpolesisreducedby1thenhedistanceofwirebetweeneachpolesincreases12/3.howmanypolesarethereintially.\324.clark,jones,mason,smithare4ppl.thereare4professionsdruggists,grocer,butcher,policeman.findoutwhoiswho?1)clarkandjonesareneighboursandtheydriveeachothertowork.2)jonesearnsmorethanmason3)thepolicemanearnsmorethanthedruggistsandi“think”thegrocer.4)thepolicemandoesnothaveadruggistsasaneighbour.5)thebutcherwalkstowork6)policemandoesnotmeetthegroceruntilhearrestshimforcommitinganoffence.325.AandBwriteatestAsays”igotathirdoftheques.wrong”Bsays”igot5wrong”togethertheygotthreequartersofthequestionscorrect.howmanydidagetcorrect.(5m)326.Ifadiehas1,6and3,4and2,5oppositeeachotherhowmanysuchdiescanbemade.327.Therearethreeboxes,InoneboxTwowhiteballs,Intwobox2blackballsInthreebox1white&1blackThelablesontheboxesarenotcorrect.Thenyouhavetoopenoneboxandtofindthecolouroftheballsinallboxes.Solution:Opentheboxlabledblack&whiteIfwhiteballsaretherethentheboxlabledwithwhiteballscontainblackballsandlabledwithblackballscontainoneblackandonewhiteballandviceversaiftwoblackballsarethere.328).therearecontaining5,7,14,16,18,29ballsofeitherredorblueincolour.Someboxescontainonlyredballsandotherscontainonlyblue.Onesalesmansoldoneboxoutofthemandthenhesays”Ihavethesamenumberofredballsleftoutasthatofblue“.Whichboxistheonehesoldsout?Ans:totalnoofballs=89and(89-29/2=60/2=30andalso14+16=5+7+18=30329).Achainisbrokenintothreepiecesofequallenthscontaining3linkseach.Itistakentoabacksmithtojoinintoasinglecontinuousone.Howmanylinksaretotobeopenedtomakeit?Ans:2.330)whentheactualtimepass1hrwallclockis10minbehinditwhen1hrisshownbywallclock,tableclockshows10minaheadofitwhentableclockshows1hrthealarmclockgoes5minbehindit,whenalarmclockgoes1hrwristwatchis5minaheadofitassumingthatallclocksarecorrectwithactualtimeat12noonwhatwillbetimeshownbywristwatchafter6hrans—5:47:32.5(nX60)50/60X70/60X55/60X65/60331.completethefollowinga.$**$@*??#@@##$??somewhatsimillarlikethis…butnotclear.b.1,3,7,13,21,__,43Ans:31c.1,3,9,__,16900332.Agirltookpartina(some)gamewithmanyothersinacircularclosedcircuit.Afterpedalingforseveralminutes,hefoundthat1/3thofthecyclistsaheadofherand3/4thofthecyclistsbehindhimtogetherformedthetotalno.ofparticipants.Howmanywereparticipatingintherace?333.OFallpetsihave,except2allarerabbitsOFallpetsihave,except2allarefishOFallpetsihave,except2allarecatsHowmanyrabbits,fishandcatsarethere?334.givencarpenter+painter=1100painter+electrician=3200electrician+plumber=5100plumber+mason=2200mason+labour=3000labour+painter=1100findeveryperson’scash?(idontknowtheexactamountmentionedabove.)335.outof30questions,thethreepersonsA,B&Canswered45correctanswers,Banswered55%ofA,BandCtogetheranswered25%moreofwhatAanswered.Findhowmanyanswerseachanswered?336.Jim,Budandsamwereroundedupbythepoliceyesterday.becauseoneofthemwassuspectedofhavingrobbedthelocalbank.Thethreesuspectsmadethefollowingstatementsunderintensivequestioning.Jim:I’minnocentBud:I’minnocentSam:Budistheguiltyone.Ifonlyoneofthestatementsturnedouttobetrue,whorobbedthebank?337)Therearetwocontainersonatable.AandB.Aishalffullofwine,whileB,whichistwiceA’ssize,isonequarterfullofwine.BothcontainersarefilledwithwaterandthecontentsarepouredintoathirdcontainerC.WhatportionofcontainerC’smixtureiswine?338)Awallclockloses10minutesevery1hour.In1hourbythewallclock,atableclockgets10minutesaheadofit.In1hourbythetableclockanalarmclockfalls5minutesbehindit.In1hourofthealarmclock,awristwatchgets5minutesaheadit.Atnoon,all4timepiecesweresetcorrectly.Tothenearestminutes,whattimewillthewristshowwhenthecorrecttimeis6p.m.onthesameday?339)“Yousee,”saidMrs.Murphy,”Paddyisnowoneandone-thirdtimesasoldashewaswhenhetooktodrink,andlittleJimmy,whowasfortymonthsoldwhenpaddytooktodrinkisnowtwoyearsmorethanhalfasoldasIwaswhenPaddytooktodrink,sowhenlittleJimmyisasoldasPaddywaswhenhetooktodrink.ourthreeagescombinedwillamounttojustonehundredyears”HowoldislittleJimmy?340)BoththeAllensandtheSmithshavetwoyoungsonsundereleven.ThenameoftheboyswhoseagesroundedofftothenearestyeararealldifferentareArthur,Bert,CarlandDavid.Takingtheagesoftheboysonlytothenearestyear,thefollowingstaementsaretrue*Arthuristhreeyearsyoungerthanhisbrother*Bertistheoldest*Carlishalfasoldasoneoftheallenboys*Davidisfiveyearsolderthantheyoungersmithboy*thetotalagesoftheboysineachfamilydifferbythesameamounttodayastheydidfiveyearsagoHowoldiseachboyandwhatiseachboysfamilyname.341)Inacertainorganizationthereareeithermeneligibletoserveonaeligibletoserveonanewlyestablishedcommiteeoffour.Theselectionofthemembersisnotaneasymatter,howeverfortherearejealousiesandattachementsamongthecandidateswhichpreventsafreechoiceoffourcommitteemen,ifyouwerethepresidentoftheorganizationcouldyouselectacommitteeoffoursatisfyingallthesewhims?*Ameswillservewithanybody*Brownwon’tserveunlessClaytonserves*ClaytonwontservewithEvans*Daviswontservewithouthughes*evanswillservewithanybody*FrenchwontservewithDavisunlessGrantservestoo,andwontservewithClaytonunlessDavisalsoserves*GrantwontservewithbothBrownandClaytonandwontservewitheitherAmesorEvens*HugheswontserveunlesseitherBrownorFrenchservesandwontservewithClaytonunlessGrantservestooandwontservewithbothAmesandEvans342)Anartisthasexactlysevenpaintings—,T,U,V,W,X,Y,andZ—fromwhichshemustchooseexactlyfivetobeinanexhibit.Anycombinationisacceptableprovideditmeetsthefollowingconditions:*IfTischosen,Xcannotbechosen*IfUischosen,Ymustalsobechosen*IfVischosen,Xmustalsobechosen1)Whichoneofhtefollowingisanaceptablecombinationofpaintingsforinclusionintheexhibit?A.T,U,V,X,YB.T,U,V,Y,ZC.T,W,X,Y,ZD.U,V,W,Y,ZE.U,V,W,Z,Y2)IfpaintingTischosentobeamongthepaintingsincludedintheexhibitwhichoneofthefollowingcannotbechosentobeamongthepaintingsincludedintheexhibit?A.UB.VC.WD.YE.Z3)Whichoneofthefollowingsubstitutionscantheartistalwaysmakewithoutviolatingrestrictionsaffectingthecombinationofpaintingsgiventhatthepaintingmentionedfirstwasnot,andthepaintingmentionedfirstwasnot,andthepaintingmentionedsecondwas,originallygoingtobechosen?A.TreplacesVB.UreplacesYC.VreplacesXD.WreplacesYE.ZreplacesW4)IftheartistchoosespaintingVtobeincludedamongthepaintingsintheexhibit,whichoneofthefollowingmustbetrueofthatcombinationofpaintings?A.TisnotchosenB.YisnotchosenC.UischosenD.WischosenE.Zischosen343)Yesterdaymymotheraskedmetobuysomestamps.Stampsareavailablein2paise,7paise,10paise,15paiseand20paisedenominations.ForthreetypesofstampsIwasaskedtobuyfiveofeach.Fortheothertwotypesofstamps.Iwasaskedtobuysixofeach.UnfortunatelyIforgotwhichIwassupposedtobuyfiveofandwhichtobuysixofLucklymymotherhadgivenmetheexactmoneyrequiredtobuythestamps,Rs.3.00andtheshopkeeperwasabletogivemethecorrectstamps.WhichstampsdidIbuy?344)FarmerJonessoldapairofcowsforRs.210,Ononehemadeaprofitoftenpercentandontheotherhelosttenpercent.Altogetherhemadeaprofitoffivepercent.Howmanydideachcoworiginallycosthim?345.Meerawasplayingwithherbrotherusing55blocks.Shegetsboredplayingandstartsarrangingtheblockssuchthattheno.ofblocksineachrowisonelessthanthatinthelowerrow.Findhowmanywerethereinthebottommostrow?346.Rahultookpartinacyclinggamewithmanyothersinacircularclosedcircuit.Afterpedalingforseveralminutes,hefoundthat1/5thofthecyclistsaheadofhimand5/6thofthecyclistsbehindhimtogetherformedthetotalno.ofparticipants.Howmanywereparticipatingintherace?347.Tomwantstocatchahare.Heisstanding250yardssouthfromthehare.Theharestartsmovingdueeast.Tom,insteadofmovinginthenortheastdirection,movesinsuchawaythatateveryinstant,heisgoingtowardsthehare.Ifspeedoftomisoneandone-thirdtimesthatofthehare,findthedistanceeachtraveledbeforehecaughtthehare.348.Twopeopleareplayingwithapairofdies.Insteadofnumbers,thedieshavedifferentcolorsontheirsides.Thefirstpersonwinsifthesamecolorappearsonboththediesandthesecondpersonwinsifthecolorsaredifferent.Theoddsoftheirwinningareequal.Ifthefirstdicehas5redsidesand1blueside,findthecolor(s)onthesecondone.349.Acompany’sdirectorsaidduringtheboardmeeting:”Thecompany’sincomefromroadswillbesufficienttopay6%oftheentirestockissue,butsincewearepaying7.5%interestonthepreferredstockofRs.4,000,000weareabletopayonly5%ofthecommonstock”.Findthevalueofthecommonstock.350.Mr.ANYMANleftANYTOWNbycartoattendaweddingatANYCITY.Hehadbeendrivingforexactlytwohourswhenthecargotpunctured.Ittookhisdriverexactlytenminutestochangethewheel.Inordertoplaysafetheycoveredtheremainingdistanceataspeedof30mph.consequently,Mr.ANYMANwasatweddinghalfan-hourbehindschedule.Hadthecargotthepunctureonly30mileslater,IwouldhavebeenonlyFIFTEENminuteslatehetoldthedriver.HowFarisANYCITYfromANYTOWN.Ans:120miles351.Alpha,Beta,gamma,deltaandepsilonarefriendsandhavebirthdaysonconsecutivedaysthoughmaynotbeinorder.GammaisasmanydaysoldtoAlphaasBetaisyoungertoEpsilon.DeltaistwodaysolderthenEpsilon.Gamma’sBirthdayisonWednesday.Tellwhosebirthdayiswhen.Ans:Alpha:FridayBeta:SaturdayGamma:WednesdayDelta:TuesdayEpsilon:Thursday352.Thequarterofthetimefrommidnighttopresenttimeaddedtothehalfofthetimefromthepresenttomidnightgivesthepresenttime.Whatisthepresenttime?Ans:9hrspast36minutesAM353.Amanisgoingtoaweddingparty.Hetravelsfor2hrswhenhegetsapuncture.Changingtyrestakes10mins.Therestofthejourneyhetravelsat30miles/hr.Hereaches30minsbehindschedule.Hethinkstohimselfthatifthepuncturehadoccurred30mileslater,hewouldhavebeenonly15minslate.Findthetotaldistancetraveledbytheman354.AfterworldwarIIthreedepartmentsdidasfollowsFirstdepartmentgavesometanksto2nd&3rddepartmentsequaltothenumbertheyarehaving.Then2nddepartmentgavesometanksto1st&3rddepartmentsequaltothenumbertheyarehaving.Then3rddepartmentgavesometanksto2nd&1stdepartmentsequaltothenumbertheyarehaving.Theneachdepartmenthas24tanks.Findtheinitialnumberoftanksofeachdepartment?Ans;A-39B-21C-12355.Agirl‘A’toldtoherfriendaboutthesizeandcolorofasnakeshehasseeninthebeach.Itisoneofthecolorsbrown/black/greenandoneofthesizes35/45/55.Ifitwerenotgreenorifitwerenotoflength35itis55.Ifitwerenotblackorifitwerenotoflength45itis55.Ifitwerenotblackorifitwerenotoflength35itis55.a)Whatisthecolorofthesnake?b)Whatisthelengthofthesnake?Ans:a)brownb)55356.Amanwasonhiswaytoamarriageinacarwithaconstantspeed.After2hoursoneofthetierispuncturedandittook10minutestoreplaceit.Afterthattheytraveledwithaspeedof30miles/hrandreachedthemarriage30minuteslatetothescheduledtime.Thedrivertoldthattheywouldbelateby15minutesonlyifthe10minuteswasnotwaste.Findthedistancebetweenthetwotowns?357.Threeclockswheresettotruetime.Firstrunwiththeexacttime.Secondslowsoneminute/day.Thirdgainsoneminute/day.Afterhowmanydaystheywillshowtruetime.358.Thereweresomecontainersofquantity1,3,4,5,6,12,15,22,24,38liters.Eachwasfilledwithsomeliquidexceptone.Theliquidsaremilk,waterandoil.Quantityofeachwaslikethis.Water=2*milkoil=2*water.Findoutwhichcontainerwasemptyandcontainersfilledwithmilkandoil.359.Twotravelers,onewith64barrelsofwine,otherwith20barrelsofwine.Theydon’thaveenoughmoneytopaydutyforthesame.Firsttravelerpays40francsandgiveshis5barrels,Secondtravelergiveshis2barrelsbutgets40francsinexchange.What’svalueofeachbarrel,anddutyforeachbarrel?Ans:Valueofeachbarrel-120francs,Dutyoneach-10francs360.WhatisAnn’srelationwithherhusband’smother’sonlydaughter-in-law’ssister’shusband?Ans:Brother-in-law361.Someguyholdingaglassofwineinhishandlookingaroundintheroomsays,“Thisissameasitwasfouryearsago,howoldareyourtwokidsnow?”Otherguysays“Threenow,Pamhadonemoreinthemeanwhile.”Pamsays,“Ifyoumultiplytheirages,answeris96andifyouaddtheagesoffirsttwokids,additionissameasourhousenumber.”Thefirstguysays,“Youareverysmartbutthatdoesn’ttellmetheirages.”Pamsays,“It’sverysimple,justthink.”Whataretheagesofthreekids?Ans:8,6,2362.Amotorcyclistparticipantofaracesays“Wedrovewiththespeedof10milesanhouroneway,butwhilereturningbecauseoflesstrafficwedroveonthesameroutewith15milesperhour.”Whatwastheiraveragespeedinthewholejourney?Ans:12milesperhour363.Givenfollowingsequence,findthenexttermintheseries:(i)0,2,4,6,8,12,12,20,16,____Ans:12(ii)3,6,13,26,33,66,___Ans:53364.Threecustomerswanthaircutandashave.Inasaloon,twobarbersoperateatsamespeed.Theytakequarterofanhourforthehaircutand5minsfortheshave.Howquicklycantheyfinishthehaircutandshaveofthesethreecustomers?Ans:30minutes365.Ashopkeeperlikestoarrangeandrearrangehiscollectionofstamps.Hearrangesthemsometimesinpair,sometimesinbundleofthree,sometimesinbundleoffours,occasionallyinbundleoffivesandsixes.Everytimehe’sleftwithonestampinhandafterarrangementinbundles.Butifhearrangesinthebundleofseven,he’snotleftwithanystamp.Howmanystampsdoesashopkeeperhave?Ans:301366.Threedifferenttypesofobjectsinabucket.Howmanytimesdoesoneneedtoselectobjectfromthebuckettogetatleast3objectsofthesametype?Ans:7367).Astampcollectorhasthehabittoarrangeorrearrangethestampsaccordingly.whiledoingthishesometimeskeepsthestampsinpairs,oringroupof3orin4orinorin6andrealisesthatinanycaseheisleftwith1stampandwhenhearrangesthemingroupsof7nostampsremain.whatisthenumberofstampshehas?368).amywhilewalkindownthestreetwithherdaughter,meetsherhusband’smother’sonlyduaghterinlaw’ssister’shusband.howistherelatedtoher?369).thereare3custonerswhowantstotakeahaircutandshave.thereare2barberswhotakesonequarterofanhourforahaircut,and5minutesforashave.boththebarberswanttofinishoffandgoquicklytotheirhomes.inwhattimecandoit.370).wetravelledtoaplaceattherateof10milesperhourandoffcoursereturnedthesameway,butowingtolesstrafficattherateof15milesperhour.whatwasourrelativespeed.371).thereare3typesofapplesinabox.whatisthenumberofapplesweshouldtakesothatweendupwith3applesofonekind.372).a).3,6,13,26,33,66,_b).0,1,2,13,6,33,12,63,20,103,_373.EachalphabetA,B..Zisaconstant.A=1,B=2,C=3^2,D=4^9nsoon.Eachletterisassignedavalue-thepositionofthatletterraisedtothevalueofprecedingalphabet.(C=3^B,D=4^Cnsoon)Computethenumericalvalueof(X-A)(X-B)(X-C)….(X-Y)(X-Z).374.Mr.Thasawrongweighingpan.Onearmislengthierthanother.1kilogramonleftbalances8melonsonright.1kilogramonrightbalances2melonsonleft.Ifallmelonsareequalinweight,whatistheweightofasinglemelon?375.Inagameofdice,2dicethrownateachturn.Thescoreateachturnistakenastheproductofnumberon2dices.therewerefiveturns(rolls).secondrollis1lessthanfirstn(likethis…therelationshipbetweenthirdnsecond,thirdnfourth,fourthnfifth)weregiven.Findthescoreinfirstroll,secondroll,thirdroll,fourthroll.(jusgivinganideaabtquestionanddonknowtheexactrelationships).PURPLE:thesearealwayspoisonousifredare.YELLOW:sixmonthsinayeartheyaresafe.GREEN:alwayssafetoconsumeifpurplearepoisonous.RED:sixmonthsinayearpoisonous.Thecolorsarecolorsofmushroomsavailable.ATthistimewhichoneissafetoconsume?G:Iam22M=G+2H=G–1H:Iamnottheyoungest.differencebetweenM&His3Gis25.M:MisyoungerthanG.G=23.H=G+2.Mr.G,Mr.M,Mr.Hmadeonlyonestatementfalse.Findtheagesofallthree.(Iamnotsureabtthestatementsjuschkitoutwithothers)376Matrixproblemrepeatedfromprevpaperthereare3malesA,B,Cand3femalesX,Y,W.theyplayed18gamesofgolfaltogether.1.Ascored942.Xscored1063.Yscored102.4.Zscored100.5.BandCscored96and98anddon’tnowho’sscorewhat??6.A’swifebeatsC’swife.7.therearetwocoupleswhosesumofscoresissame.Determinewho’swifeiswhoandscoresofBandC.377.Agirlhadseveraldollarswithher.shewentoutforshoppingandspenthalfoftheminshoppingmall,beinggenerousshehadgiven1dollartothebeggar.Afterthatshewqentforlunchandspentthehalfoftheremainingandgave2dollarsastiptothewaiter.Thenshewenttowatchamovieandspentthehalfofremainingdollarsandgaveautorikshaw-wala3dollars.Thisleftherwithonly1dollar.Howmanydollarsdidshehadwithheratthebeggining.378.Apersonsaysthathissonis5timesasoldashisdaughterandhiswifeis5timesolderthanhissonandheistwicetheageofhiswife.Thesumtotalofalltheagesequalstheageofthegrandmotherwhocelebratedher81stbirthdaytoday.Howoldwashisson?379.Abargainhunterboughtsomeplatesfor$1.30fromasaleonsaturday,whereprice2wasmarkedoffateacharticle.Onmondayshewenttoreturnthematregularprices,andboughtsomecupsandsaucersfromthatmuchamountofmoneyonly.thenormalpriceofplatewereequaltothepriceof‘onecupandonesaucer’.Intotalshebought16itemsmorethanprevious.saucerswereonlyof3centshenceshebrought10saucersmoretahnthecups,Howmanycupsandsaucerssheboughtandatwhatprice?380.Ajewellerpreparedawindowdisplayeachdisplaying3ofthe7jemsatatime.Theyweremethyst,opal,sapphire,emerald,rubyandgarnet.Displayedaccordingtothefollowingconditions:-1AsholudalwaysbedisplayedontheleftwindowandDontheright.2RubyshouldnevercomewithanyofDorG.3.EshouldalwaysbewithS.thensome4questionswereaskedonthis.easy#1whichcombinationisappropriate?AOS;ADR;AES(ans).#2whichconditioniscorrectintherightwindow?#3Rubycanbedisplayedwithfollowingothertwo?#4Scanbedisplayedwiththefollowingothertwoonleftsidewindow?381.Racingcompetition.Participantswerefrom3tribesSonorean-alwayssaystruthMidorean-alternativelysaysTandF,notwithanyparticularstart.Nororean-alwaysFalseAsays-1.Cobstructedmeatthelastmoment,whichcausedmetolosetherace.2.Calwaysspeaktrue3.cisthewinner.Bsays–1.Aisthewinner.2.csaysfalsealways.Csays-1.BwontheRace2.Ididn’tcausedanyobstructiontoAatthelasttime.IDentifythetribesofeach.382.Abosstells1/6thofhislifeinchildhood,1/12ofhisinyouthand1/7ofhisinbachelor,fiveyearsafterhiselectionasonwasbornwhomwasdiedfouryearsagoathalfhisfinalage.findthebossage..ANS.:74thssolutiona/6+a/12+a/7+5……383.Twothieveswenttothemuseumtostolethediamondsfirstthiefstolehalfofthemandwhilegoinghetookanothertwoandleft.Second,thirdandfourthdidthesameandtherewaszerodiamondsattheend.Howmanydiamondsinitiallyatthebeginning?SimilartoQ.No.193StolenMangoesfromShakuntalaDevi–MorePuzzlesAns:79384.A,B,CarethehusbandsandD,E,Faretheirwivesnotinthatorder.TheyareplayingtheGolffollowingtheseconditions.D,E,FandBscoresareasfollows106,102,100and94.AandCscoresare98and96notinthatorderastheirnamesarenotdisplayed.Twocouplesgetthesamescore.BwifebeattheAwifelistoutthewivesnamesandthescorestheygot.Ans:HusWifeScoreTotalAF98102200100198BD94106200106200CE9610096102198385.Awomenwithdollarbillsgototheshoppinghespenthalfofthemoneyshehadforshoppingasshewassokindshegaveonedollartothebeggar.shewenttothehotelandspenthalfoftheremaningandshegave2dollarstothewaiter,theshebuysomegoodswithhalfoftheremainingandshegave3dollarstothereceptionist.howmuchmoneyshehadinthebegining?ans:42comeinthereverseorder1+3=4andtwiceofit8+2=10andtwiceofit20+1=21andtwiceofit42.386.Aconducterinthebusaskthemanhowoldtheboyis.themanrepliedthatmysonisfivetimesolderthanmydaughterandmywifeisfivetimesolderthanmysonandiamtwiceoldertomywifeandouragessummeduptomygranmotherwhoseageis81years.canutellmethesonage?ans:5yearsx+5x+25X+50X=8181X=81x=1thereforesonageis5yearsold387.findoutwhoisoldestandwhoisyoungestfromthefollowingstatements…a)eitherAorBrtheoldestb)eitherCistheoldestorBistheyoungest.ans:AistheoldestandBistheYoungest388.oneboytellsthreeppltoguessmulecolor..numberonesaysitsnotblknumbertwosaysitseiterhbrownorgreynumber3saysitsbrown...theboythensaysoneisatleastlyingansatleasttellingtruth…finfmulecoloransgrey?389.2mentaketurnswalkingandridingonehorsethattheyshare…walkingspeed4km/hr..ridingspeed12km/hr..oneridesforsometimeandtieshorsefortheotherwalkingfellowandcontinueswalking……theykeepgoingonlikethisalternately..findtimethatthehorserests390.7pplhaveholidayson7diffdays…andtheygiveconditionslikeA’sholis3daysbeforeBetcetc…wehavetofindthedaysonwhichtheytakeholiday5.6subjects3pplteach2each…somecrazyconditionsandwegottafindthesubjectforeach..icantreallyrecallclearlysowhyconfuseuguys391.ALady(sayL)isaphilanthropist.shegoestoarestaurent,ordersfoodandpayshalftheamountshehasandanotherdollertoawaiterastip.shethengoestoamall,doessomepurchasesandpayshalftheamountleftandanother2dollerstoabeggeroutside.Atlastshegoestoabookstore,takessomebooksandpayshalftheamountleftandanother3dollerstoabeggeroutside.shethenchecksthatsheonlyhadadollerlefttoher.Howmuchmoneyshehadinitially?ANs.42$392.Threecouplesareplayinggolftogether.ThemenareE,B&TwhilewomenareMG&H.theyplay8rounds.M,G,H&Escore106,102,100,94respectively.whileB&Tscoredeither96or98asitwasunresolvedduetoerroratscoreboard.Whenfinallyresolvedtheyfoundthattwoofthecouplesscoredsame.Itisgiventhat-E’swifescoredgreaterthanB’swife.Who’swhosewife&howmuchthemenscoredeach?393.Aladybuyssomeplatesin130$with2$offeveryitem.shethenreturnstheplatesforthesameamountnextdaytoexchangethemforsomecups&saucers.Eachsaucercostsonly3$eachandtheno.ofsaucersis10morethancups.Altogethershetakes16moreitemsthanbefore.Ifshehadtobuyonlycups,howmanyofthemshecouldhavebeentakenhomeonthefirstday?394.Impressedbyadmirationoftheboybystranger,thefathersaid“Mysonisfivetimesasoldasmydaughterandmywifeisfivetimesasoldasmyson.I’mdoubletheageofmywifeandmygrandmotherisasoldasthesumofagesofallofusandsheiscelebratingher81stbirthday.”whatistheageoftheboy?ANS.5yrs395.A,B&Cparticipateinarace&oneofthemwins.Theybelongtothreecommunities-M,N,O.Oalwaysspeakthetruth,NalwayslieandMalternate.EachofA,B&Cbelongstoonecommunity.ASAYS:1.IwouldhavewontheraceifChadnotinterferedmeatthelastmovement.2.Calwaysspeakstruth.3.Cisthewinner.BSAYS:1.Awinstherace.2.Cisnota‘N’.CSAYS:1.Ihadn’tinterferedwithAatthelastmovement.2.Bwinstherace.Tell,who’swho?396.HarryisafriendofAxyandAmy.Twostatementsaregivenaboutthem.1.ifoneofAxyandAmyisoldestthenanotherisyoungest.2.EitherHarryistheoldestorAmyistheyoungest.Whoistheoldest?ANS.Axy397.sonsageis5timesdaughters.motherisfivetimesson.fatheris5timeswife.TotalofallageisGrandpaswhoiscelebrating81stB`day.Ans:-5yrs398)Onewomanbuysplatesworth1.30$at2centdiscounteachplate.Thensheexchangedtheplatesforsausers&bowlwhereonebowl&onesauserscostsequaltooneplate.noofsauserswhichcosts3centis10morethanbowl.noofsaucers&bowlis16morethannoofplates.Ans:-10Plates399.“One-sixthofmylife”,saidmyboss,“Ispentasachild,nextone-twelfthasanoldboy,one-seventh&5moreyearsinpolitics&socialization.ThisbroughtmeuptowhenJimmyborn.Jimmywaselectedforthegovernerfouryearsago,whenhewashalfmypresentage.”Howoldismyboss?ANS.:84yrs.(However,Ioverlookedthat‘one-seventh’part,&gottheanswer36–awronganswer.)*******************************************************J=(B/2)+4(B/6)+(B/12)+(B/7)+5+J=B=>B=84*******************************************************401.ACoupledecidedtotravelanorthcountryside.sotheydecidetotravelaminimumamountoncarthefirstdayandthesecondandsubsequentdayadistanceof20miles.Iftheytravelatotalamountof1080miles.Findhedistancetraveledonthe4thdayandthe9day.402.Acardboardof34*14hastobeattachedtoawoodenboxandatotalof35pinsaretobeusedontheeachsideofthecardbox.Findthetotalnumberofpinsused.403.DuringaPizzabuffetwhereAeatsmoretimes2.4thanB,andBeats6timeslessthanC.findtheleatnumberoftimesallthethreehastoeat.404.LastYearmycousincametomyplaceandweplayedagamewheretheloosingonehastogiveonechoclatetothepersonwhowonthegame.Attheendofthevacation,i.ethedaymycousinwasleavingshecountednumberofgamesthatiwonanshewon.Atlastshegavemeatotalof8choclateseventhoughshewonabout12games.Findthemumberofgamesthatweplayed.405.Atreeonfirstdaygrows1/2ofitssizesecondday1/3rdofitssizeonthepreviousdaysimilarlythan1/4thandsoon.uhavetocalculateafterhowmanydaysthetreewillbe100timesofitsoriginalsize.ans-198days406.threepersonarethereletABConealwaystelltruthonealwayslieandonesometimestelltruththeyarestandinginstraightlinethefirstpersonwhoisseniormostandalwaystellstruthtellsinmiddleAisstandingthemiddleonesaysCisinthethirdpositionthelastonesaysBisinsecondpositioniemiddle407.A,B,C,DandEarejuniorsandF,G,H,Iareseniorsyouhavetomakethreegroupseachcontaingthreepersonsuchthatineachgrouponesenioristhereandsomeotherconditionswhichicantrecallexactlybutwaslikethatifthispersonwillbeingroupthanthiscantbeinthesamegroup.408.thereare100teamsinafootballknockouttournamenthowmanymathcesshouldbeheldtogetthewinneransweris99ieonelessthanthenoofteamsbcozineverymatchonteamgoesout409.Acartravelingwithuniformspeed.Therer15poles.Acartravelfrom1to10thpolein10seconds.thepolesareequallyspaced.thenhowmanysecondsittakestoreachthe15thpole?(4)410.Aboyjumptotheriverfromthebridge.Heswimoppositedirectionofthestream.After1000yardshenotedthathishatwasfallenatthebridge.Thehegoestotakethehat.Hedidn’tchangehisspeed.Whatisthevelocityofstream?(4)411.UnclesAboughtaHat&SuitforRs.15.AuntyBboughtaSuitwithasmuchascostofuncle’sHat.ThenreamingcostheboughtDresses.Dressescostisonerupeemorethanhishat’scost.Thenshetoldhimhishat’shatis1and½costofherhat.Theyspendequalamountontheirpurchase.a.ThenunclesaidhowmuchisthecostofHat.b.Howmuchtheyspendaltogether?(4)412.Thereare17brownties,13redties,9greenties,5bluetiesand2whiteties.Thenamantakesatie.so,howmanytimesheatleasttaketietogetthe2tiesInsamecolour?(6)413.Mrs.BarbingerboughtsomeplatesonSaturdayfor$1.30,wheneverythingwasbeingsoldtwocentsbelowtheregularprice.SheexchangedthoseplatesonMonday,attheirregularprice,forcups&saucers.Costofoneplateequalscostofoneplate&onesaucer.Shereturnedhomewith16morearticlesthanbefore.Since,saucerscostonly3centseach,shebought10moresaucersthancups.Thepuzzleis,howmanycupscouldshehaveboughtonSaturday,for$1.30?ANS.:13cups*******************************************************OnMonday:cup=12cents,saucer=3cents,plate=15centsOnSaturday:cup=10cents,saucer=1cent,plate=13cents*******************************************************414.MrandMrsABCpurchasesuitandhatsfor15Rs.thenfromremainingmoneyMrs.ABCpurchaseAdress.Sheshaid”Mydresscostismorethan1Rsfromyourhat’scost.shealsoadded“ifwedivideourmoneyandthenpurchaseandcostofmyhatis3and1/2timesyourshatthenwehadspendequalmoney”a.”ifthat”conditionfallowswhatispriceofhishat?b.Totalamountspend?ans.hat=6Rs,Total=22Rs.(notsure)415.Myrackcontains8Redcolourties,13violatecolourties,10Bluecolourties,5Pinkcolourties,4greencolourties.Ifelectricitygoneandiwantatleasttwotiesofsamecolourthenhowmanytiesishouldtakeoutfrommyrack?Ans:6ties.416.Twotrainsleavingfromtwostation50milesawayfromeachotherwithcostantspeedof60milesperhour,approachestowardseachotherondiffrenttracks.iflenghtofeachtrainis1/6mile.whentheymeetHowmuchtimetheyneedtopasseachothertotally?ANS:10sec.(notsure)417.Allhandsome,fairskinned,muscular,lean,employed,andrichmenaretall.Allhandsomemenarefairskinned.Somemuscularmenarehandsome.Somemuscularmenarenotfairskinned.Allleanmenaremuscular.Noleanmanishandsome.Nofairskinnedmanwhoisnothandsomeisrich.Alltallmenwhoareneitherfairskinnednormuscularareemployed.1.pramodisnotfairskinned.Whichofthefollowingmustbetrue?a)pramodisemployedb)ifpramodismuscular,heisneitherhandsomenorleanc)ifpramodistall,heisemployedormuscular.d)ifpramodisnotemployed,heismuscular.e)ifpramodistall,hemaybemuscularorhandsome,butnotboth.2.whichmustbefalseiftheinformationgivenistrue?a)noleanmenarefairskinned.b)somefairskinnedarelean.c)somerichmenarebothfairskinnedandmuscular.d)sometallmenareneitherfairskinnednoremployede)somerichmenarelean3.whichofthefollowingcanbededucedfromtheinformationgiven?a)allrichmenarehandsomeb)somerichmenarehandsomec)somerichmenareemployedd)somerichmenaremusculare)allrichmenarehandsome,muscular,oremployed4.whichcannotbeshowntobetrueorfalseonthebasisoftheinformationgiven?I.NofairskinnedormuscularmanisemployedII.SomemuscularmenarefairskinnedbutnothandsomeIII.Nofairskinnedmanbothhandsomeandleana)Ionlyb)IIonlyc)IIIonlyd)IandIIe)IIandIII418InMulund,theshoestoreisclosedeveryMonday,theboutiqueisclosedeveryTuesday,thegrocerystoreisclosedeveryThursdayandthebankisopenonlyonMonday,WednesdayandFriday.EverythingisclosedonSunday.OnedayA,B,CandDwentshoppingtogether,eachwithadifferentplacetogo.Theymadethefollowingstatements:ADandIwantedtogoearlierintheweekbuttherewasn’tdaywhenwecouldbothtakecareofourerrands.BIdidnotwanttocometodaybuttomorrowIwillnotbeabletodowhatIwanttodo.CIcouldhavegoneyesterdayorthedaybeforejustaswellastoday.DEitheryesterdayortomorrowwouldhavesuitedme.Whichplacedideachpersonvisit?419TheNovicehockeytournamentsareonforbeginners.Justthreeteamsareintheleague,andeachplaystheothertwoteamsjustonce.Onlypartoftheinformationappearsintheresultchart,whichisgivenbelow.TeamGamesWonLostTiedGoalsForGoalsagainstA210B2112C2Thescoringpatterninthetournamentisasfollows:Twopointsareawardedtothewinningteam.Incaseofatie,bothteamsareawardedonepoint,sothetotalpointsinthestandingsshouldalwaysequalthetotalnumberofgamesplayed(sinceeachgameplayediscountedasoneforeachofthetwoparticipatingteams).Ofcourse,totalgoalsscoredforandgoalsscoredagainstmustbethesame,sinceeverygoalscoredforoneteamisscoredagainstanother.Thegamesareplayedinthefollowingorder:Game1:AVsB;Game2:AVsC;GameBVsCCanyoudeterminethescoreofeachoftheabovegames?420Arecentmurdercasecenteredaroundthesixmen,clam,flip,gront,herm,mast,andwalt.Inoneorderoranotherthesemanwerethevictim,themurderer,thewitness,thepolice,thejudge,andthehangman.Thefactsofthecaseweresimple.Thevictimhaddiedinstantlyfromtheeffectofgunshotwoundinflictedashot.Afteralengthytrialthemurdererwasconvicted,sentencedtodeath,andhanged.VMastknewboththevictimandthemurderer.vIncourtthejudgeaskedclamhisaccountoftheshooting.VWaltwasthelastofthesixtoseeflipalive.VThepolicetestifiedthathepickedupgrontneartheplacewherethebodywasfound.VHermandwaltnevermet.Whatroledideachofthefollowingplayinthismelodrama?a)Murdererb)Victimc)Judged)Witness421.Aalonecandoaworkin6daysBalonecandoin8dayswithhelpofctheyfinishedtheworkin3days.Iftheagreedsumis640whatistheshareofc.(referr.sagarwal)422)Aboygoestoschoolfromhishouse.ononefourthohhiswaytoschool,hecrossesamachinerystation.Andononethirdofhiswaytoschool,hecrossesaRailwaystation.Hecrossedthemachinerystationat7:30andhecrossestheRailwaystationat7:35.Whendoesheleavethehouse&whendoeshereachtheschool?(5M)423.Adrivesacarfourtimesalap10,2030,60kmphwhatistheaveragespeed.424.speedofboatinstillwater10km,ifspeedupstreamis24kmandspeeddownstreamis16whatisspeedoftheriver.425.Ifgrandfatherageissumallthethreegrandchildernwhosagerinequalintervalwhatistheageofthegrandfather?426.Inagrassfieldif40cowcouldeatfor40days.Thesamegrassfieldcanfeed30cowsfor60days.howlongwillitfeed20cows?427)AnEraser,Pencil,Notebooktogethercosts$1.00.Notebookcostsmorethanthecostof2Pencils.3Pencilcostsmorethan4Erasers.3EraserscostsmorethanaNotebook.Howmuchdoesapencilcosts?(5M)428)FourpersonsA,B,C,Dwerethere.Allwereofdifferentweights.AllFourgaveastatement.Amongthefourstatementsonlythepersonwhoislightestinweightofallothersgaveatruestatement.ASays:BisheavierthanD.BSays:AisheavierthanC.CSays:IamheavierthanD.DSays:CisheavierthanB.Findthelightest&Listthepersonsinascendingorderaccordingtotheirweights.(5M)428.Amanwastravellingtoaplace30milesawayfromstartingpoint.hewasspeedingat60miles/hr.butwhenhecameback,hiscargotbreakdownandhalfanhourwaswastedinreparingthat.altogetherhetook1hrforreturnjourney.Findtheavg.speedofthewholejourney.429.I’MNOTVERYSUREREGARDINGTHISQUESTION.Adetectivewasassignedtogenerateacodeusing4digits,sothatnoonecouldbreakit.heknewthatifthecodestartswith0,5or7itwillbecracked.sohowmanynumberscanbeformedusing4digits.430.Acowwasstandingonabridge,5feetawayfromthemiddleofthebridge.suddenlyalightningexpresswith90miles/hrwascomingtowardsthebridgefromnearestendofthecow.seeeingthisthecowrantowardstheexpressandmanagedtoescapewhenthetrainisonefeetawayfromthebridge.ifitwouldhaverantooppositedirection(ieawayfromtrain)itwouldhavebeenhitthetrainoneftawayfromtheendofthebridge.Calculatethelengthofbridge.431.thereare3townsattackedby3dragons-x,y,z.Numberofdaysxattackatownisequaltonumberofdaysyattackinganothertown.Numberofdaysxattackisequaltohalfthesquarerootofnumberofdayszattackingatown.numberofdaysyattackingthetownistwicethesquarerootofz.calculatehowmuchdaysthecurseofeachdragonbe.432.Atownhaveapopulationof500000and42%ofmalesand28%offemalesaremarriedtosametown.findthetotalnumberofmales433.AandBcamebackhomeaftertheirexamandtheirfatheraskedthemaboutthetest.Areplied–1/3rdofmyanswerswerewrongBreplied–5ofmyanswerswerewrongbuttogetherwegot3/4ofanswersright.Howmanyquestionsweretherefortheexam?434)Wearegiven100piecesofapuzzle.Iffixingtwocomponentstogetheriscountedas1move(acomponentcanbeonepieceoranalreadyfixedsetofpieces),howmanymovesdoweneedtofixtheentirepuzzle.Ans:18435)Thisproblemhasappearedb4.4kidsfrom2familiesGuptaandsharma…theirnamesarePraveen,Pra…blahblah…andsomerelation…whichfamilyandwhataretheirages..Ans:Sinhas–11(praveen)Sinhas–5(lalit)Gupta–10(pratap)Gupta–7(rajesh)436)Thiswasonehellofalongproblem–Butithasappearedbefore..Twogirlzafteroneguy(sue,sweandsamithink)..Suefirstaskshishouseno…hereplieswithtwostatements(secondisfalse)soshegoestothewronghouse…blahblah..samethinghappenswiththeothergalWhatwasthehousenumberofsueandsamAns:20and24437)Acomplexstatement–aboutanaeroplanecomminglate.“Theboysaysifitwas6hourslater,thewaitingtimewouldbe1/5thofthetimeiftheplanehadcome2hoursearlierinstead.theplaneissupposedtocomeatmidnightAns11.00a.m438)Thereare4statementsand4guys(Dave,Gus,someoneelseandonemoresomeoneelse)–sorrymymemoryisrotten!Anywaynowtheseguysmake4statementsabt.whocommitedthecrime.Weneedtofindoutwhodiditif(i)allbutonearesayingfalseand(ii)allbutonearesayingtrueAns:(i)archie(ii)tony439)Akidgoestoabankwithachecque…Comesbackandsayshespent35cents..hismomsaysyouhavebroughtbacktwicewhatuversupposedtoget.Whathappenedisthenovicebankclerkgavedollarsforcentsandvice-versa(quotesilly)anway…Whatwastheactualamount??Ans:don’tknow…440.JohnhaddecidedtodividehisRS.1000/-forhisfourchildrenaccordingtotheirages.TheelderchildshouldbeaRS.20/-extraforeachthanhisyoungerchild.WhatwillbetheshareofMaheshwhoistheyoungest?[3marks]441.Onesideofthemeasuringarmwaslongerthantheotherside.If3pyramidwidthwasplacedinlongersideitisequalto2cubewidthintheshorterarm.If8pyramidwidthwasplacedinlongerarmthenitisequalto6cubewidth.Let1pyramidwidthisequalto10kg.Whatisthewgtofcubewidth?442.A,B,C,Darefourgirlswhohave1,2,3,4appleswiththemrespectively.IfEhaveapplesequaltohissister,Fhavetwicetheapplesashissister,GhavethricetheapplesthanhissisterandIhavefourtimestheapplesthanmysister.Alltogetherwehave32apples.A,B,C,Darethesistersofwhomandwhom?443.Andy,Brian,Cedric,Davearearchitects,barber,caseworkeranddentistbutnotintheorder.*Architectwillhavetheletter‘r’inhisname.*Atleastoneofthepersonshouldhavecoincidenceinthefirstletteroftheirnameandtheiroccupationbutnotall[eg:andy-architect]*BarberanddentistsharetheirnamebyonlyoneletterWhatistheoccupationofeachperson?444.Thereare100bulbsconnectedto100switches•1to100alltheswitchesareputON.•Onlyevennumbersofswitchesareusedie,ONmeansOFFandviceversa•Similarlyoddnumbersofswitchesaredone•Switchnumberwhichisdivisibleby3aredonesimilarly•Switchnumberwhicharedivisibleby4aredonesimilarlyThisprocessisdoneupto100divisibles.WhendoallthebulbsareinONandOFFcondition?[8marks]445.Amanwrotehis“will’accordinglythemoneywasalsosharedbetweenhiscardriver,5sonsand5daughters.Firsthegaveonerupeetohiscardriver,remaining1/5ofthemoneyisgiventohis1stson.againhegaveonetohiscardriverandremaining1/5ofthemoneyisgiventohis2ndson,continuingtheprocessuntil5sonsarecompleted.Afterthatheremainingmoneyisdividedbetweenhis5daughters.Whatwastotalamountofmoney?446.4peopleidentifiedacriminalandtheirstatementsare:#A:Eyeswasblue,heightwastallandheworeahat&avest.#B:Eyeswasdark,heightwashortandheworeahat&avest#C:Eyeswasgreen,heightwasmediumandheworehat&atie.#D:Eyeswasgrey,heightwastallandheworearaincoatandahat.Everyonesaidonlyonecorrectidentifyothertwowasuntrue.Howcanbethecriminalidentified?4470.Awallclockwasslowby10minutes.Accordingtothewallclock,atableclockwas10minutesaheadofit.Accordingtothetableclockanalarmclockwas5minutesbehindandaccordingtothealarmclockwrstwatchwas5minutesfast.Atnoonalltheclockswereadjusted.Whatwillbethetimeat6P.Mwristwatch?448.ProfessorKittredge’sliteratureseminarincludesstudentswithvariedtastesinpoetry.Allthoseintheseminarwhoenjoythepoetryofbrowingalsoenjoythepoetryofeliot.Thosewhoenjoythepoetryofeliotdespisethepoetryofcoleridge.SomeofthosewhoenjoythepoetryofeliotalsoenjoythepoetryofAuden.AllofthosewhoenjoythepoetryofColeridgealsoenjoythepoetryofDonne.SomeofthosewhoenjoythepoetryofAudenalsodespisethepoetryofColeridge.AllofthosewhoenjoythepoetryofDonnealsoenjoythepoetryofFrost.i.MissGarfieldenjoysthepoetryofDonne.Whichofthefollowingmustbetrue?(A)shemayormaynotenjoythepoetryofcoleridge.(B)ShedoesnotenjoythepoetryofBrowing.(C)Shedoesnotenjoythepoetryofeliot.(D)SheenjoysthepoetryofColeridge.ii.Mr.HuxtableenjoysthepoetryofBrowing.Hemayalsoenjoyanyofthefollowingpoetsexcept(A)Auden.(B)Coleridge(C)Donne(D)Eliot(E)Frostiii.MissInaguchienjoysthepoetryofColeridge.Whichofthefollowingmustbefalse?(A)shedoesnotenjoythepoetryofAuden.(B)SheenjoysthepoetryofDonne.(C)SheenjoysthepoetryofFrost.(D)ShedoesnotenjoythepoetryofBrowning.(E)ShemayenjoythepoetryofEliot.iv.Basedontheinformationprovided,whichofthefollowingstatementsconcerningthemembersoftheseminarmustbetrue?(A)AllthethosewhoenjoythepoetryofeliotalsoenjoythepoetryofBrowning.(B)NoneofthosewhodespisethepoetryofFrostenjoythepoetryofAuden.(C)SomeofthosewhoenjoythepoetryofAudendespisethepoetryofColeridge.(D)NoneofthosewhoenjoythepoetryofBrowningdespisethepoetryofDonne.(E)SomeofthosewhoenjoysthepoetryofFrostdespisethepoetryofDonne.a.Rimmiewearsahatonlyifgoergewearsatie.b.GeorgewearsascarfonlyifJohniewearsatie.c.VickiewearsagooglesonlyifRimmiewearsahat.d,e,f,g,hsomewhatlikethisthereare8statements,fromthatwehavetodeterminewhowearswhat.449.8Kigsand14Ligscando510torsofworkin10days.13Kigsand6Ligscando484torsofworkin12days.ThenfindworkdonebyKigsandLigsindividuallyintors/hr?450.Thereisa3digitednumber.3rdnumberisthesquarerootofthe1stdigit.2nddigitisthesumof1stand3rd.Andthatnumberisdivisibleby2,3,6,7.Whatisthatnumber?451.Aboyisplayingagame.Hetooktotally55blocksandkeptlikeplacingsomexnumberontheground,nextonelessthanthatabovethoseblockslikethattillthetopmostoneisone,like:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(Theydidn’tgavethispictuire,butmyexplanationisnotclear,that’sIgaveuthispicture)thequestionishowmanyblocksarethereatthebaselevel?452.Therer100nationscompetingforaworld-cup.TheboarddecidedtomakeKnock-outseries.Howmanymatchestobeplayedfordecidingtheworldchampion?453.Thereislogweighing30kgs.Theloghavingtwicethicknessandtwiceshortasfirstonewillweighhowmuch??454.thereiatruckwhichshouldreachsomeplaceat11`oclock,ifittravelswith30mphitreachesihourbefore,ifittravleswith20mphitreaches1hourlate.whatisthedistanceitmustbetravlledandwhatisthespeeditmustmaintaintorechatexacttime?ans:120milesand24mph455.Thereisasquarecabbagepatch.Hetoldhissisterthatihavealargerpatchthanlastyearandhence211morecabbagesthisyear.ThenhowmanycabbagesIhavethisyear.?Ans:106*106=11236456.therearetwocolcksoneruns1min/hrsfasterandother1min/hrslowerwhenwillthetwoclockshavetimetimedifferenceof1hr:ans:30hrs457.itakeataxiwhosenois3digitno.itisnotdivisibleby2,3,5,7butdivisibleby11itisthesmallestnopossible:ans:121458.Amanbroughtsomewatermelonstotownandsoldthem.hesold1/2morethan1/2ofwhathebroughtandewasleftwithonemelon.howmanymelonsdidhebringtoTown?ans:3459.Whenureversethedigitsofageoffatheruwillgettheageofson.oneyearagotheageoffatherwastwicethatofson’sage.whatarethecurrentagesoffatherandson?ans:73&37460.Therewillbefourfriends,oneisdoctor,oneislawyer…theyarehavingfourcarsoneferrari,corvette….thereweresomeconditionsandweweresupposetofindwhatisprofessionofeachoneandwhatcartheyown.thiswastheonefor8marks.461.Thereisacircularringinwhichthereare12blackmiceandonewhitemice.acatwalkscircularlyintheringandeatsevery12thmice.whereshouldthecatstartsothatthewhitemiceisthelastonetobeeatenbycat?ans:ifthecatmovescircularlyithastostartfromthe11thmice(clockwise)w.r.t.towhiteone.462.AfarmergrowsfourtypesofcropssayW,X,Y&Z.twoconditionsweregiven:1.IfthefarmergrowscropWinayearthenalsogrowsXthatyear2.IfthefarmergrowscropZoneyearthenhenevergrowscropYnextyearTherewere6choicesamongwhichweweresupposetofindonecorrectonewhichdoesnotviolatethetwoconditionsthechoicesweresomethinglike:(firstpairdenotescropsgrownfirstyearandsecondaftersemicolonrepresentscropsgrownnextyear)W,X;X,Z(thisoneisavalidone)Ans:Idon’trememberthechoicesbuttheanswasoptionC463.Inaclasstherearelessthan500students.whenitisdividedby3itgivesawholenumber.Similarlywhenitisdividedby4,5or7givesawholenumber.findtheno.ofstudentsintheclassans:420464.TherearethreetypesofbirdsA,B&C.Acosts5pounds,Bcosts3PoundsandCcosts1/3ofapound.findtheno.ofA,B&Csuchthatuwillget100birdsfor100pounds.(Ithinkweweresupposetofind3answerssincetherewere3rowsintheanswer)ans:A:4B:18C:78465.Thereare5personswhohavewontopfiveplacesinaneventinOlympics.oneofthemasksallthefiveregardingthierpositions,theyreplyasa:“iamnotthelast”b:“cisinthirdplace”c:“EisbehindA”d:“Bisinfirstplace”e:“Disnotthefirst”Thepersonswhohavewongoldandsilverhaveliedfindthepositionsinorder(format:nameoffirst,nameofsecond,..)ans:B,D,E,A,C466.AcoffeesellerhastwotypesofcoffeeBrandAcosting5bitsperpoundandBrandBcosting3bitsperpound.hemixestwobrandstogeta40poundmixture.hesoldthisat6bitsperpound.thesellergetsaprofitof331/2percent.howmuchhehasusedBrandAinthemixture?ans:30pounds467.Youaregivenwithtwoidenticalironbars.oneofthemismagnetizedandtheotherisnot.uaresupposetofindwhichoneismagnetized.uarenotsupposetouseanyotherthing.myans:firsttimeitoldthatiwillsuspendthebarsfreely.butthentheytoldmethatiamnotsupposetouseanyexternalhelp.itooksometimeandthenrealizedthatamagneticbarinthemiddlerepelstowardstheend.itoldthatplaceoneofthebarshorizontal&thenmovetheotheroneperpendicularlytoit.ifitrepelstowardsanyofendsthenthehorizontaloneismagnetizedifitattractsthenisnot.Theywereconvinced468:Whatistheresultof(x-a)*(x-b)*(x-c)*………..*(x-y)*(x-z)?myans:itoldthatsincethereisaterm(x-x)theansweriszero.Theytoldok.finallytheyaskedmewhetherihaveanyquestionstothemiaskedthemwhatisthedurationoftrainingandwhatisfieldwhichiwillbeworkingonifigetselected.AnyonelookingforinfisolveShakuntaladevi’s2books,GeorgesummersandRavinarulathiswouldmemorethanenough.mostimportantthingisdevelopurlogicalanalysisskillandtrytoremembertheapproachratherthananswers.don’tpanicintheinterviewjustbecoolandconfidentuwilldefinitelygetthrough.Bestofluckforall469)a)101928374655647382__b)2416512_writethenextelementsintheseries.GREWORDLISTabacus:framewithballsforcalculatingabate:tolessentosubsideabdication:givingupcontrolauthorityaberration:strayingawayfromwhatisnormalabet:help/encouragesmb(indoingwrong)abeyance:suspendedactionabhor:tohatetodetestabide:befaithfultoendureabjure:promiseorsweartogiveupabraded:rubbedoffwornawaybyfrictionabrogate:repealorannulbyauthorityabscond:togoawaysuddenly(toavoidarrest)abstruse:difficulttocomprehendobscureabut:borderonabysmal:bottomlessextremeacarpous:effetenolongerfertilewornoutacclaimed:welcomedwithshoutsandapprovalaccolade:praiseapprovalaccretion:thegrowingofseparatethingsintooneadamant:kindofstoneinflexibleadmonitory:containingwarningadorn:addbeautydecorateadulteration:makingunpurepoorerinqualityaffable:politeandfriendlyaffinity:closeconnectionrelationshipaggravate:makeworseirritateagile:activequick-movingagog:eager/excitedail:troublebeillalacrity:eagerandcheerfulreadinessalcove:recess/partiallyenclosedplaceallegiance:dutysupportloyaltyalleviate:make(pain)easiertobearalloy:todebasebymixingwithsomethinginferioraloof:reservedindifferentamalgamate:mixcombineunitesocietiesambidextrous:abletousethelefthandortherightequallywellambiguous:doubtfuluncertainambivalent:havingbothoftwocontrarymeaningsameliorate:improvemakebetteramortize:end(adebt)bysettingasidemoneyanguish:severesufferinganimosity:strongdislikeantidote:medicineusedagainstapoisonoradiseaseantithetical:directopposingapartheid:brutalracialdiscriminationaplomb:self-confidenceapostate:onewhoabandonslong-heldreligiousorpoliticalconvictionsapotheosis:deificationglorificationtogodlinessappease:makequietorcalmapprehensive:graspingunderstandingfearunhappyfeelingaboutfutureapprise:givenoticetoinformapprobation:approvalapropos:appropriatetothesituationaptapt:well-suitedquick-wittedarabesque:acomplexornatedesignarboreal:ofconnectedwithtreesardor:enthusiasmarduous:steepdifficultascentlaboriousargot:jargonslangarrant:inthehighestdegreearrogance:proudsuperiormannerofbehaviourarticulate:speakdistinctlyconnectbyjointsascend:goorcomeupascertain:gettoknowascetic:practicingself-denialausterestarkascribe:considertobetheoriginoforbelongingtoaseptic:surgicallycleanasperity:roughnessharshnessilltemperirritabilityaspersion:slanderassail:withattackviolentlyassiduous:diligenthard-workingsedulousassuage:makesmth(paindesire)lessasterisk:themark*(e.g..omittedletters)astringent:substancethatshrinksastute:cleverquickatseeingtogetanadvantageatonement:repaymentdeathofJesusattenuate:makethin.weakenenervateattune:bringintoharmonyaudacious:daringfoolishlyboldimpudentaugury:omensignaugust:majesticvenerableauspicious:favorablesuccessfulprosperousaustere:severelymoralandstrictsimpleandplainauxiliary:helpingsupportingaver:affirmassertprovejustifyaversion:strongdislikeavid:eagergreedyavow:admit.Declareopenlybaleful:harmfulominouscausingevilbalk:obstaclepurposelytogetonthewayofbaneful:causingharmorruinperniciousdestructivebarrage:artificialobstaclebuiltacrossariverbarren:notgoodenoughunabletohaveyoungoneswithoutvaluebask:inenjoywarmthandlightbeatify:toblessmakehappyorascribeavirtuetobedizen:toadornespeciallyinacheapshowymannerbelabor:beathardbellicose:belligerentpugnaciouswarlikebelligerent:(personnation)wagingwarbenefactor:personwhohasgivenhelpbenevolence:wishoractivityindoinggoodbenign:kindandgentlemild(climate)bequest:arrangementtogivesmthatdeathberate:scoldsharplybereft:robordispossessofsmth(material)bewilder:puzzleconfusebigot:stubbornnarrow-mindedpersonbilge:bulgetheprotuberanceofacaskblandishment:flatterycoaxingblandness:politemannercomfortinguninterestingblatant:noisyandroughblithe:cheerfulcasualcarefreebogus:shamcounterfeitnotgenuineboisterous:loudnoisyroughlackingrestraintbolster:givegreatlyneededsupportboorish:crudeoffensiverudebrash:hastyrushcheekysaucybrass:yellowmetal(mixingcopperandzinc)brazen:madeofbrassbreach:openingbrokenplacebreakingbrittle:easilybrokenbroach:bringupannouncebegintotalkaboutbrook:totolerateendure

Page 4: Daily paragraph editing terminal velocity answers

buoyant:abletofloatlight-heartedburgeon:growforthsendoutbudsburnish:topolishrubtoashinecabal:aschemeorplotagroupofplotterscadge:tobegtogetbybeggingcajole:useflatteryordeceittopersuadecalipers:metalsupportsattachedtothelegsmeasuringinstrumentcalumny:slanderaspersioncandid:frankstraight-forwardcant:insinceretalk/jargoncantankerous:bad-tempered/quarrelsomecanvass:discussthoroughlysortoftoutingcastigate:tochastisecorrectbypunishingcastigation:severepunishmentcatalyst:substancethatcausesspeedingupcaustic:bitingsarcasticcensure:expressionofblameordisapprovalarebukecenturion:leaderofaunitof100soldierschary:cautiouswarychastened:correctedpunishedchastisement:punishmentchauvinist:ablindlydevotedpatriotchicanery:legaltrickery/falseargumentchisel:steeltoolforshapingmaterialschurl:bad-temperedpersonclamor:shoutcomplainwithalotofnoiseclientele:customersclinch:cometogrips/settleconclusivelycling:toresistseparationclot:half-solidlumpformedfromliquidcloture:closingdevice(inParliament)toendadebatebyvotingcoagulation:changetoathickandsolidstatecoalescing:comingtogetherandunitingintoonesubstancecoax:getsmbtodosmthbykindnesscoda:passagethatcompletesapieceofmusiccoddle:treatwithcareandtendernesscoerce:compeltoforcetomakeobedientcoeval:ofthesameperiodcoexistingcogent:strongconvincingcogitate:thinkdeeplymediatecognizant:beingfullyawareofcolander:bowl-shapedvesselwithmanyholesusedtodrainoffwatercollusion:secretagreementforadeceitfulpurposecombustion:processofburningcommemorate:keepthememoryofcommodious:havingplentyofspaceforwhatisneededcommuter:personwhotravelsregularlycomplaisance:tendingtocomplyobligingwillingnesstopleasecompunction:feelingofregretforone’sactionconceal:hidekeepsecretconceit:over-highopinionoftoomuchprideconciliatory:reconcilingsoothingcomfortingmollifyingconcord:agreementorharmonyconcur:agreeinopinionhappentogethercondense:increaseindensitystrengthmakelaconiccondone:forgivecongeal:makeorbecomestiffandsolidconjoin:tojointogetherconnoisseur:apersonwithgoodjudgement(e.g..inart)connotation:suggestioninadditiontoconsequential:pompousselfimportantconsole:givecomfortorsympathytoconspicuous:easilyseenremarkableconsternation:surpriseandfeardismayconstrain:compelconstrict:maketightorsmallerconsume:gettotheendofconsummate:perfect/makeperfect/completecontemn:toscornordespisecontentious:argumentativepugnaciouscombativequarrelsomecontiguous:touchingneighboringnearcontrite:filledwithdeepsorrowforwrongdoingcontumacious:insubordinaterebelliousconundrum:ariddledilemmaenigmaconviction:convincingfirmbeliefconvoke:calltogethersummonconvoluted:complicatedcoiledtwistedcordial:warmandsincerecordon:line(ofpoliceactingasaguard)cornucopia:abundantsupplycorporeal:physicaloforforthebodycorrelate:haveamutualrelationcorroboration:additionalstrengtheningevidencecountenance:tofavororapproveofcounterfeit:forgerycountervail:counterbalancecovert:disguisedcovetous:eagerlydesirouscower:crouchshrinkbackcoy:shy/modest(espofagirl)crass:verygreat(es.stupidity)cravat:pieceoflinenwornasanecktiecraven:cowardlycrease:linemadebycrushingwhitelineonthegroundincricketcredulity:toogreatareadinesstobelievethingscredulous:readytobelievethingscrush:pressloseshapesubdueoverwhelmcryptic:secretwithahiddenmeaningcumbersome:burdensomeheavyandawkwardtocarrycurmudgeon:bad-temperedpersoncurriculum:courseofstudycursory:quickhurriedcurtail:makeshorterthenwasplanneddainty:pretty/delicate(food)/difficulttopleasedaunt:intimidatemakefearfuldawdler:personwhoisslowwasteoftimedearth:shortagedebacle:abreakupoverthrowsuddendisasterdecorum:proprietypropernessdecree:ordergivenbyauthoritydecry:disapproveofdefer:postponegiveway(toshowrespect)deferential:showingrespectdefiance:opendisobedienceorresistancedelineate:toportraydepictsketchoutdeluge:greatfloodheavyrushofwaterdemagogue:personappealingnottoreasonsdemur:tohesitateraiseobjectionsdenigrate:blackenbelittlesullydefamedenouement:anoutcomeorsolutiontheunravelingofaplotdeplete:useuntilnoneremainsdeposition:dethronementdepositingdeprave:makemorallybadcorruptdeprecate:protestagainstexpressdisapprovalofdereliction:desertingandleavingtofallintoruinsderision:ridiculemockeryderidingderivative:unoriginalobtainedfromanothersourcederogatory:insultingtendingtodamagedescry:catchsightofseesmthinthedistancedesiccant:substanceusedtoabsorbmoisturedesuetude:cessationofusedisusedesultory:aimlesshaphazarddigressingatrandomdeter:discouragehinderdetraction:slanderingverbalattackaspersiondetumescence:diminishingorlesseningofswellingdeviance:beingdifferentinmoralstandards(fromnormal)dexterity:skill(esp.inhandling)diaphanous:transparentgauzydiatribe:bitterandviolentattackinwordsdiffidence:shynessdilate:speakcomprehensivelybecomewiderlargedisallow:refusetoalloworacceptasacorrectdiscern:seewithaneffortbutclearlydiscomfit:confuseembarrassdisconcert:upsettheself-possessionofdiscountenance:refusetoapproveofdiscourse:speechlecturediscredit:refusetobelievediscreet:careful/prudentdiscrete:individuallydistinctdisdain:lookonwithcontemptdisencumber:freefromencumbrancedisheveled:untidydisingenuous:sophisticatedartfultryingtodeceivecunningdisinter:digupfromtheearthdislodge:moveforcefromtheplaceoccupieddismal:sadgloomymiserabledisparate:essentiallydifferentdisproof:prooftothecontrarydissemble:speakorbehavesoastohidesmth(inmind)disseminate:distribute(esp.ideas)dissent:haveadifferentopinionrefusetoassentdissolution:disintegrationloosenessinmoralsdistraught:distractedviolentlyupsetinminddivergence:gettingfartherapartfromapointdivestiture:takingoffgettingridofgivingupdivulge:makeknownsmthsecretdoggerel:trivialpoorlyconstructedversedogmatic:positivecertainarbitrarywithoutroomfordiscussiondolt:stupidfellowdormant:inastateofinactivitybutawaitingdevelopmentdote:showmuchfondnesscenterone’sattentiondrawl:slowwayofspeakingdroll:jestingdrone:malebeepersonwhoisn’tself-employeddrowsiness:feelingsleepyhalfasleepdubious:feelingdoubtdud:nousepersonsmththatfailsdulcet:melodiousharmoniousdupe:cheatmakeafoolofduplicity:deliberatedeceptionduress:threatstocompelsmbdwarf:personorsmbmuchbelowtheusualsizedynamo:ageneratorsomethingthatproduceselectriccurrentearthenware:dishesmadeofbakedclayebullience:exuberanceoutburstoffeelingebullient:overflowingwithenthusiasmshowingexcitementecumenical:representingthewholeChristianworldedacious:voraciousdevouringeddy:circularorspiralmovement(e.g..ofwind)edible:fittobeeaten/notpoisonouseffete:infertilewornoutweakefficacy:productionofadesiredresulteffluvia:outflowinastreamofparticlesanoxiousodororvaporeffrontery:boldnessimpudencearroganceegress:wayoutexitelaborate:workedoutwithmuchcareingreatdetailelegy:alamentamelancholycompositionelicit:drawouteloquence:fluentspeakingskillfuluseoflanguageemaciate:makethinandweakembellish:makebeautifulembezzle:useinawrongwayforone’sownbenefitemote:stirupexciteempirical:relyingonexperimentencapsulate:encloseincapsuleencomium:warmorglowingpraiseeulogypanegyricencumbrance:burdenthingsthatgetonthewayofendearing:makingdearorlikedendemic:epidemicendorse:writeone’snameonthebackofenduring:lastingenervate:weakendepriveofstrengthattenuateengender:causeproducegiverisetoengrave:impressdeeplyengrossing:takenupallthetimeorattentionwritinginlargeorformalengulf:swallowupenigma:smththatispuzzlingenmity:hatredbeinganenemyensign:flag/badgeentangle:putintodifficultiesenthral:pleasegreatly/enslave(fig)entice:temptorpersuadeentreat:askearnestlyenunciate:pronounce(words)/expressatheoryenzyme:catalystepicurean:devotedtopleasure(sensuousenjoyment)epistle:letterepithet:adjectiveepitome:briefsummaryrepresentativeexampleatypicalmodelequable:steadyregularequanimity:calmnessoftemperamentequilibrium:stateofbeingbalancedequipoise:equaldistributionofweightequilibriumequivocal:havingadoubleordoubtfulmeaningsuspiciousequivocate:trytodeceivebyequivocallanguageeradicate:getridofpullupbytherootserratic:irregularinbehaviouroropinionerudite:learnedscholarlyeschew:avoidesoteric:abstruseintendedonlyforasmallcircleofespouse:marrygiveone’ssupporttoeulogy:formalpraisepanegyriceuphoria:elationstateofpleasantexcitementeuthanasia:easyandpainlessdeathevasive:tendingtoevadeevince:toshowclearlytoindicateevoke:callupbringoutexcoriation:severecriticismexculpate:toclearfromachargeofguiltexhaustive:completethoroughexigency:emergencyanurgentsituationexoneration:setsmbclearfree(e.g..fromblame)exorbitant:muchtoohighorgreatexpatiate:toroamwanderfreelyexpedient:likelytobeusefulforapurposeexpiation:endingexpiringexploit:brilliantachievementdevelopuseselfishlyexpostulate:argueearnestlytodissuadecorrectorprotestexpurgate:toremoveobscenitypurifycensorexscind:tocutoutcutawayextant:stillinexistenceextempore:withoutpreviousthoughtorpreparationextenuate:reducethestrengthoflessenseriousnesspartiallyexcuseextinct:nolongeractiveextinguish:endtheexistenceof/wipeorputoutextirpate:todestroyexterminatecutoutexscindextol:praisehighlyextort:obtainbythreatsviolenceextralegal:outsidethelawextricable:thatcanbefreedextrovert:cheerfulpersonexuberance:stateofgrowingvigorouslybeingfulloflifefacetious:humorousfunnyjocularfacile:easilydonefallacious:basedonerrorfalter:waver/moveinanuncertainmannerfatuous:withoutsensefoolishself-satisfactionfawn:youngdeertrytowinsmb’sfavorfeckless:lackingpurposeorvitalityineffectivecarelessfecund:fertilefeint:pretendfelicitous:aptsuitablyexpressedwellchosenaproposfelon:personguiltyofmurderferment:substancebecomeexcitedferocity:savagecrueltyferret:discoverbysearchingsearchfervid:showingearnestfeelingfervor:warmthoffeelingsearnestnessfetid:stinkingfetter:toshackleputinchainsfeud:bitterquarreloveralongperiodoftimefidelity:loyaltyaccuracyfidget:moverestlesslymakenervousfigurehead:carvedimageontheprowofashipfinesse:delicatewayofdealingwithasituationfinical:toofussyaboutfoodclothingetc.finicky:finicalfission:splittingordivision(esp.ofcells)fixate:stareatflak:criticism/anti-aircraftgunsflamboyant:brightlycoloredfloridflaunting:showoffcomplacentlyflax:paleyellow(hair)aplantfledged:abletoflytrainedexperiencedfleet:numberofshipsquick-movingflinch:drawmovebackwinceflop:fail/move/fallclumsilyflorid:verymuchornamentednaturallyred(e.g..offace)flout:rejectmocktogoagainst(asingoingagainsttradition)fluke:luckystrokefluster:makenervousorconfusedfoible:defectofcharacter(apersoniswronglyproud)foil:preventfromcarryingoutcontrastfoment:putsmthwarm(tolessenthepain)foolproof:incapableoffailureorerrorfoppish:likeamanwhopaystoomuchattentiontohisclothesforage:foodforhorsesandcattleforbear:refrainfrombepatientancestorforbearance:patiencewillingnesstowaitford:shallowplaceinariver(tocross)forestall:preventbytakingactioninadvancepreemptforfeit:sufferthelossofsmthforge:workshopfortheshapingofmetaltoshapemetalleadforgery:counterfeitforswear:renouncedisallowrepudiatefoster:nurturecareforfracas:noisyquarrelfragile:easilyinjuredbrokenordestroyedfragrant:sweet-smellingfrantic:wildlyexcitedwithjoypainanxietyfrenetic:franticfrenziedfret:worryirritationwearawayfringe:edgeornamentalborderpartofhairovertheforeheadfroward:intractablenotwillingtoyieldorcomplystubbornfrugal:carefuleconomicalfulmination:bitterprotestfulsome:disgustingoffensiveduetoexcessivenessgainsay:todenytoopposegarble:makeunfairselectionfromfactsgarment:articleofclothinggarner:togatherandsavetostoreupgarrulity:talkativenessgarrulous:tootalkativegaucherie:sociallyawkwardtactlessbehaviorgermane:relevantpertinenttogist:thepointgeneralsenseglean:gatherfactsinsmallquantitiesglib:readyandsmoothbutnotsincereglimmer:weak/unsteadylightgloat:overlookatwithselfishdelightglut:supplytomuchfilltoexcessgnaw:wasteawaybitesteadilygoad:smthurgingapersontoactiongorge:eatgreedily/narrowopeningwithastreamgossamer:softlightdelicatematerialgouge:toolforcuttinggroovesinwoodgrandiloquent:usingpompouswordsgrave:seriousrequiringconsiderationgraze:touchorscrapelightlyinpassinggregarious:livinginsocietieslikingthecompanygrievous:causinggrieforpainseriousdiregravegrovel:crawlhumbleoneselfguile:deceitcunninggullible:easilygulledgush:burstoutsuddenly/talkardentlygust:outburstoffeelingsuddenrainwindfireetc.hack:cutroughlyhiredhorsehalcyon:calmandpeacefulhallow:tomakeholyconsecrateharangue:alongpassionatespeechharbinger:smthorsmbthatforetellsthecomingofharrow:todistresscreatestressortormenthaughty:arrogantconceitedheed:attention/givenoticetoheinous:odious(ofcrime)heresy:beliefcontrarytowhatisgenerallyacceptedhermetic:sealedbyfusionheterogeneous:madeupofdifferentkindshew:makebyhardworkcut(bystriking)highbrow:(person)withsuperiortasteshirsute:hairyshaggyhoax:mischievoustrickplayedonsmbforajokehoi:polloithemassestherabblehollow:notsoledwithholeholster:leathercaseforapistolhomiletics:actofpreachinghone:stoneusedforsharpeningtoolshoodwink:trickmisleadhospitable:likingtogivehospitalityhubris:arrogantpridehush:makeorbecomesilenthusk:worthlessoutsidepartofanythinghypocrisy:falselymakingoneselfappeartobegoodiconoclast:personwhoattackspopularbeliefsidiosyncrasy:personalmannerismidolatry:excessiveadmirationofidyll:acarefreeepisodeorexperienceignoble:dishonorablecommonundignifiedignominious:shamefuldishonorableundignifieddisgracefulillicit:unlawfulforbiddenimbroglio:complicatedandembarrassingsituationimmaculate:purefaultlessimminent:likelytocomeorhappensoonimmutable:thatcannotbechangedimpair:worsendiminishinvalueimpassive:unmovedfeelingnosignofpassionimpecunious:havinglittleornomoneyimpede:hindergetinthewayofimpediment:smththathinders(e.g.stammer)impending:imminentbeingabouttohappenexpectedimperative:urgentessentialimperious:commandinghaughtyarrogantimpermeable:thatcannotbepermeatedimperturbable:calmnotcapableofbeingexcitedimpervious:notallowingtopassthrough(ofmaterials)imperviousness:haughtyarrogantcommandingimpetuous:havingsuddenenergyimpulsivethrustingaheadforcefulimpiety:lackofreverenceordutifulnessimplacable:incapableofbeingplacatedunpleasableimplicate:showthatsmbhasashareimplicit:impliedthoughnotplainlyexpressedimplosion:collapseburstinginwardimportune:begurgentlysolicit(ofaprostitute)imprecation:aninvocationofevilacurseimpromptu:withoutpreparationimpudent:rashindiscreetimpugned:challengedtobedoubtedimpute:toattributetoacauseorsourceascribeinadvertent:notpayingproperattentioninane:sillysenselessinasmuch:sincebecauseincense:makeangryincessant:oftenrepeatedcontinualinchoate:notyetfullyformedrudimentaryelementaryincipient:beginningincise:engravemakeacutinincite:stiruprouseinclined:directingthemindinacertaindirectionincongruous:outofplacenotinharmonyoragreementincorrigibility:cannotbecuredorcorrectedincredulous:skepticalunwillingtobelieveinculcate:fixfirmlybyrepetitionincumbents:officialdutiesincursion:araidasuddenattackindefatigability:noteasilyexhaustibletirelessnessindelible:thatcannotberubbedoutindigence:povertyindigenous:nativeindistinct:noteasilyheardseenclearlymarkedindolence:lazinessindomitable:noteasilydiscouragedorsubduedindulge:gratifygivewaytosatisfyallowoneselfindulgent:inclinedtoindulgeineffable:togreattobedescribedinwordsineluctable:certaininevitableinept:unskillfulsaidordoneatthewrongtimeineptitude:qualityofbeingunskillfulinferno:hellinfuriate:fillwithfuryorrageinfuse:putpourfillingenuous:naiveyoungartlessfrankhonestsincereingest:takeinbyswallowinginimical:harmfulorfriendlyinimitable:defyingimitationunmatchableinnocuous:causingnoharminscrutable:incapableofbeingdiscoveredorunderstoodinsensible:unconsciousunresponsiveunaffectedinsinuate:suggestunpleasantlymakeawayforsmthgentlyinsipid:withouttasteorflavorinsouciant:unconcernedcarefreeinsularity:narrow-mindednessisolatedinsurrection:risingofpeopletoopenresistancetointerdict:prohibitforbidinterim:asaninstallmentintersperse:placehereandthereintransigence:unwillingnesstocompromisestubbornnessintractabilityintransigent:uncompromisingintrepid:fearlessbraveundauntedintrospection:examiningone’sownthoughtsandfeelingsinundate:floodcoverbyoverflowinginured:accustomedtoadaptedinvective:abusivelanguagecursesinveigh:toattackverballydenouncedeprecateinveterate:deep-rooted.long-establishedinvincible:toostrongtobedefeatedinvolute:complexirascible:irritableeasilyangeredirate:angryire:angerirksome:tiresomeirresolute:hesitatingundecidedirrevocable:finalandunalterableitinerate:totravelfromplacetoplacetoperegrinatejabber:talkexcitedlyutterrapidlyjibe:gibemakefunofjocular:meantasajokejudicious:soundinjudgmentwiseknit:drawtogetherunitefirmlylabyrinthine:toentanglethestateofaffairslachrymose:causingtearstearfullackluster:(ofeyes)dulllament:showfeelgreatsorrowlassitude:wearinesstirednesslatent:presentbutnotyetactivedevelopedorvisiblelaudatory:expressingorgivingpraiselavish:givingorproducingfreelyliberallyorgenerouslylegacy:smthhandeddownfromancestorslevee:formalreception/embankmentlevity:lackofseriousnesslibel:statementthatdamagesreputationliberality:freegivinggenerositylibertine:immoralpersonlien:legalclaimuntiladebtonitisrepaidlimn:paintportraylimp:lackingstrengthwalkingunevenlylionize:treatasafamouspersonlithe:bendingtwistingloll:resttositorstandinalazywayhang(dog’stongue)lope:movealongwithlongstridesloquacious:talkativegarrulouslucubrate:writeinscholarlyfashionluculent:easilyunderstoodlucidclearlugubrious:mournfulexcessivelysadlull:becomequietorlessactivelumber:moveinaclumsy/noisywayluminary:starlight-givingbodylurk:beoutofviewreadytoattacklustrous:beingbrightpolishedmacabre:gruesomesuggestingdeathmacerate:makeorbecomesoftbysoakinginwatermachination:plotscheme(esp.evil)maladroit:tactlessclumsymalapropism:misuseofaword(foronethatresemblesit)malevolence:wishingtodoevilmalign:injuriousspeakillofsmbtellliemalinger:tofakeillnessorinjuryinordertoshirkadutymalleable:yieldingeasilyshapedmoldableadaptingmanacle:chainsforthehandsorfeetmassacre:cruelkillingofalargenumberofpeoplematriculation:beadmittedenterauniversityasastudentmaudlin:sentimentalinasillyortearfulwaymaul:hurtbyroughhandlingmaverick:rebelnonconformistmellifluous:sweetlyflowingmendacity:dishonestymendicant:abeggarmercurial:quickchangeableincharacterfleetingmeretricious:attractiveonthesurfacebutoflittlevaluemesmerize:hypnotizemeticulous:givinggreatattentiontodetailsmettle:qualityofenduranceorcouragemettlesome:courageoushigh-spiritedmiddling:fairlygoodbutnotverygoodminatory:menacingthreateningmince:pronounceorspeakaffectedlyeuphemizemisanthrope:personwhohatesmankindmischievous:harmfulcausingmischiefmiser:personwholoveswealthandspendslittlemisogynist:onewhohateswomen/femalesmoderation:qualityofbeinglimitednotextrememollify:makecalmerorquietermolt:moultlosehairfeathersbeforenewgrowingmorbid:diseasedunhealthy(e.g..aboutideas)morose:ill-temperedunsocialmuffler:clothwornroundtheneck/silencermultifarious:variedmotleygreatlydiversifiedmundane:worldlyasopposedtospiritualcommonplaceeverydaymyriad:verygreatnumbernadir:lowestweakestpointnascent:comingintoexistenceemergingnebulous:cloud-likehazyvagueindistinctnegligent:takingtoolittlecareneophyte:personwhohasbeenconvertedtoabeliefnexus:aconnectiontieorlinknibble:showsomeinclinationtoaccept(anoffer)noisome:offensivedisgusting(smell)nonchalant:nothavinginterestnonplused:greatlysurprisednostrum:aquackremedyanuntestedcurenoxious:harmfulnugatory:trifling/worthlessobdurate:hardenedandunrepentingstubborninflexibleobfuscate:todarkenmakeobscuremuddleoblivious:unawarehavingnomemoryobloquy:abusivelydetractivelanguagesharpcriticismvituperationobsequious:tooeagertoobeyorserveobstreperous:noisyloudobtain:tobeestablishedacceptedorcustomaryobtrusive:projectingprominentundesirablynoticeableobtuse:blunt/stupidobviate:tomakeunnecessarygetridofoccluded:blockedupodious:repulsivehatefulodium:contemptdislikeaversionodor:smellfavorreputationofficious:tooeagerorreadytohelpofferadviceominous:threateningonerous:needingeffortburdensomeopaqueness:dullness/notallowinglighttopassthroughopprobrious:showingscornorreproachossify:toturntobonetosettlerigidlyintoanideaostensible:seemingappearingassuchprofessedostentation:displaytoobtainadmirationorenvyostracism:shutoutfromsocietyrefusetomeettalkoverhaul:examinethoroughlytolearnabouttheconditionoverweening:presumptuouslyarrogantoverbearingimmoderatebeingajerkpaean:songofpraiseortriumphpalate:roofofthemouthsenseoftastepalatial:magnificentpalliate:lessentheseverityofpalpability:canbefelttouchedunderstoodpalpitate:tremblebeatrapidlyandirregularlypanegyric:formalpraiseeulogyparadigm:amodelexampleorpatternparenthesis:sentencewithinanotheronesmthseparatedpariah:anoutcastarejectedanddespisedpersonparsimonious:tooeconomicalmiserlypartisan:one-sidedcommittedtoapartybiasedorprejudicedpatron:regularcustomerpersonwhogivessupportpaucity:scarcityalackingofpeccadillo:smallsinsmallweaknessinone’scharacterpedantic:bookishshowingofflearningpedestrian:commonplacetriteunremarkablepellucid:transparenteasytounderstandpenchant:stronginclinationalikingpenitent:feelingorshowingregretpenurious:poor/stingypenury:extremepovertyperegrination:travelingaboutwanderingperemptory:urgentimperativeunchallengeableendingdebateperfidious:treacherousfaithlessperfidy:treacherybreakingoffaithperfunctory:doneasadutywithoutcareperilous:dangerousperipatetic:wanderingperish:bedestroyeddecayperjury:willfulFALSEstatementunlawfulactpermeate:spreadintoeverypartofpernicious:harmfulinjuriousperpetrate:beguiltycommit(acrime)personable:pleasinginappearanceattractiveperspicacity:quickjudgingandunderstandingpertain:belongasaparthavereferencepest:destructivethingorapersonwhoisnuisancepetrified:takenawaypower(tothinkfeelact)petrify:tomakehardrocklikepetrous:likearockhardstonypetulant:unreasonablyimpatientphilistine:asmugignorantpersononewholacksknowledgephlegmatic:calmsluggishtemperamentunemotionalpicaresque:involvingcleverroguesoradventurerspied:ofmixedcolorspinch:betootighttakebetweenthethumbandfingerpine:wasteawaythroughsorroworillnesspious:dutifultoparentsdevotedtoreligionpiquant:agreeablypungentstimulatingpique:hurttheprideorself-respectstir(curiosity)pitfall:coveredholeasatrapunsuspecteddangerpith:essentialpartforcesoftliquidsubstancepivotal:ofgreatimportance(othersdependonit)placate:soothepacifycalmplaintive:mournfulmelancholysorrowfulplaque:flatmetalonawallasamemorialplatitude:atriteorbanalstatementunoriginalityplea:requestplead:addressacourtoflawasanadvocateplethora:glutpliant:pliableeasilybentshapedortwistedplod:continuedoingsmthwithoutrestingpluck:pullthefeathersoffpick(e.g..flowers)plumb:gettotherootofplummet:fallplungesteeplyplunge:movequicklysuddenlyandwithforcepoignant:deeplymovingkeenponcho:largepieceofclothponderous:heavybulkydullportent:omenmarvelousthreateningprecarious:uncertainriskydangerousprecepts:rulesestablishingstandardsofconductpreclude:preventmakeimpossibleprecursory:preliminaryanticipatingpredilection:speciallikingmentalpreferencepredominate:havemorepowerthanotherspreen:tidy/showself-satisfactionpremature:doingorhappeningsmthbeforetherighttimepreponderance:greatnessinnumberstrengthweightpresage:warningsignpresumption:arrogancepreternatural:notnormalorusualprevalent:commonprevaricate:toequivocatetostrayfromthetruthprim:neatformalpristine:primitiveunspoiledpureasinearliertimesunadulteratedprobity:uprightnessincorruptibilityprincipleproclivity:inclinationprocrastination:keepingonputtingoffprodigal:wastefulrecklesswithmoneyprodigious:enormouswonderfulprofane:worldlyhavingcontemptforGodprofligacy:shamelessimmoralityprofligate:wastefulprodigallicentiousextravagantprofundity:depthprofuse:abundant/lavishproliferate:growreproducebyrapidmultificationprolix:tiringbecausetoolongprone:prostrateinclinedto(undesirablethings)propagation:increasingthenumberspreadingextendingpropinquity:nearnessintimeorplaceaffinityofnaturepropitiatory:conciliatoryappeasingmitigatingpropitious:auspiciouspresentingfavorablecircumstancesprosaic:everydaymundanecommonplacetritepedestrianproscribe:denounceasdangerousprotracted:prolongedprovident:frugallookingtothefutureprovisional:ofthepresenttimeonlyprovoke:makeangryvaxprudence:carefulforethoughtprudish:easilyshockedexcessivelymodestprune:driedplumsillypersonpry:getsmthinquiretoocuriouslypucker:wrinklepugnacious:fondofinthehabitoffightingpuissance:strengthpunctilious:precisepayingattentiontotrivialitiespundit:pedantauthorityonasubjectpungency:sharpnessstingingqualitypurvey:providesupplypusillanimous:cowardlycravenputrefaction:becomingrottenpyre:largepileofwoodforburningquack:persondishonestlyclaimingtosmthquaff:drinkdeeplyquail:losecourageturnfrightenedqualm:feelingofdoubttemporaryfeelingofsicknessquandary:stateofdoubtorperplexityquell:suppresssubduequibble:trytoavoidbysophisticationquiescence:stateofbeingpassive/motionlessquiescent:atrestdormanttorpidquirk:habitoractionpeculiartosmborsmthquixotic:generousunselfishquotidian:banaleverydayrabble:mobcrowdthelowerclassesofpopulaceraconteur:personwhotellsanecdotesraffish:lowvulgarbasetawdryramify:tobedividedorsubdividedtobranchoutrancorous:feelingbitternessspitefulnessrant:useextravagantlanguagerapacious:greedy(espformoney)rarefy:tomakethintomakelessdensetopurifyorrefinerave:actwithexcessiveenthusiasmreactionary:opposingprogressrebuff:snubrecalcitrant:disobedientrecant:takebackasbeingFALSEgiveuprecast:castorfashionanewrecidivism:relapseintoantisocialorcriminalbehaviorreciprocity:grantingofprivilegesinreturnforsimilarrecitals:anumberofperformanceofmusicrecluse:personwholivesaloneandavoidspeoplerecompense:makepaymenttorewardpunishreconcile:settleaquarrelrestorepeacerecondite:littleknownabstruserecreancy:cowardiceacowardlygivinguprecuperate:becomestrongafterillnesslossexhaustionredeem:getbackbypaymentcompensateredoubtable:formidablecausingfearrefine:makeorbecomepureculturalrefractory:stubbornunmanageableuntractablerefulgent:shiningbrilliantregale:todelightorentertaintofeastregicide:crimeofkillingakingreiterate:sayordoagainseveraltimesrejuvenation:becomingyounginnatureorappearancerelapse:fallbackagainremonstrate:toprotestobjectrender:deliverproviderepresentrenovate:restoresmthtobetterconditionrenowned:celebratedfamousrepast:mealrepel:refusetoaccept/causedislikerepine:atbediscontentedwithreproach:scoldupbraidreprobate:personhardenedinsinonedevoidofdecencyrepudiate:disownrefusetoacceptorpayrepulsive:causingafeelingofdisgustrequite:repaygiveinreturnrescind:repeal/annul/cancelresigned:unresistingsubmissiveresilience:qualityofquicklyrecoveringtheoriginalshaperesort:tofrequentlyvisitrestive:refusingtomovereluctanttobecontrolledresuscitation:comingbacktoconsciousnessretard:checkhinderreticent:reserveduntalkativesilenttaciturnrevere:havedeeprespectforreverent:feelingorshowingdeeprespectriddle:puzzlingpersonorthingrift:splitcrackdissensionrivet:fixtakeupsecuremetalpinroll:callcallingofnamesrotund:richanddeepplumpandroundruffian:violentcruelmanrumple:makeroughsagacious:havingsoundjudgmentperceptivewiselikeasagesalacious:obscenesalubrious:healthfulsalutary:remedialwholesomecausingimprovementsanctimony:self-righteousnesshypocriticalwithFALSEpietysanction:approval(byauthority)penaltysanguine:cheerfulconfidentoptimisticsanity:healthofmindsoundnessofjudgementsash:longstripwornroundthewaistsatiate:satisfyfullysaturnine:gloomydarksullenmorosesavant:personofgreatlearningsavor:tasteflavorsmthsawdust:tinybitsofwoodscabbard:sheathforthebladescent:smell(esppleasant)scorch:becomediscolored/dryup/goathighspeedscribble:writehastilyscurvy:meancontemptiblesecular:material(notspiritual)livingoutsidemonasteriessedulous:perseveringseminal:likeaseedconstitutingasourceoriginativesententious:shortandpithyfullofmaxims/proverbssequence:successionconnectedlineofsere:makehardandwithoutfeelingsermon:reprovingapersonforhisfaultsserrated:havingatoothededgeserration:havingatoothededgeservile:likeaslavelackingindependencesever:breakoffseverance:severingshallow:littledepthnotearnestshard:pieceofbrokenearthenwaresheath:coverforthebladeofaweaponoratoolshrewd:astuteshowingsoundjudgementshrill:sharppiercingshun:keepawayfromavoidshunt:sendfromonetracktoanotherlayasideevadediscussionsidestep:steptoonesidesimper:(givea)silly/self-conscioussmilesinuous:windingundulatingserpentineskiff:smallboatskit:shortpieceofhumorouswritingslack:sluggishdullnottightslake:toassuagetosatisfyallayslate:kingofblue-greystoneproposecriticizesluggard:lazyslow-movingpersonslur:joinsounds/words(indistinct)smolder:burnslowlywithoutflamesnare:trapsnub:treatwithcontemptsoar:riseflyhighsober:self-controlledsobriety:qualityorconditionofbeingsobersodden:soakedsaturatedsoggy:heavywithwatersolvent:ofthepowerofformingasolutionsomatic:ofthebodysoot:blackpowderinsmokesophisticated:complexsubtlerefinedsophistry:fallaciousreasoningfaultylogicsophomoric:self-assuredthoughimmatureaffectedbombasticoverblownsoporific:producingsleepsordid:wretchedcomfortlesscontemptiblespear:weaponwithametalpointonalongshaftspecious:illogicalofquestionabletruthormeritsplenetic:bad-temperedirritablesplice:join(twoends)sponge:porousrubberforwashingliveatonceexpensespurious:FALSEcounterfeitspurn:havenothingtodorejectorrefusesqualid:foulfilthysquander:spendwastefullysquat:crouch/settlewithoutpermissionstanch:tostoptheflowofafluidsteeply:risingorfallingsharplystentorian:extremelyloudandpowerfulstickler:personwhoinsistsonimportanceofsmthstigma:markofshameordisgracestigmatize:describesmbscornfullysting:smthsharpstingy:spendingusingunwillinglystint:tobethriftytosetlimitsstipple:paintwithdotsstipulate:stateorputforwardasanecessaryconditionstolid:showingnoemotionimpassivestray:wanderloseone’swaystreak:longthinmoveveryfaststriated:stripedgroovedorbandedstride:walkwithlongstepsstrut:asupportingbarstygian:hencedarkgloomystymie:tohinderobstructorblocksubdue:overcomebringundercontrolsublime:extremeastoundingsubmerge:putunderwaterliquidsinkoutofsightsuborn:inducebybriberyorsmthtocommitperjurysubpoena:writtenorderrequiringapersontoappearinalowcourtsubstantiation:givingfactstosupport(statement)subsume:includeunderarulesuccor:assistancereliefintimeofdistresssuffice:beenoughsuffocate:causeorhavedifficultyinbreathingsullied:tobestainedordiscreditedsummarily:brieflywithoutdelaysumptuous:magnificentsundry:variousmiscellaneousseparatesupercilious:disdainfulcharacterizedbyhaughtyscornsuperfluous:morethenisneededorwantedsuperimpose:putsmthonthetopsupersede:taketheplaceofsupine:lyingonthebackslowtoactpassivesuppliant:askinghumblybeseechingsupplicate:makeahumblepetitiontosuppress:preventfrombeingknownputanendtosurcharge:additionalload/chargesurfeit:satiatefeedtofulnessortoexcesssusceptibility:sensitivenessswerve:changedirectionsuddenlysycophant:personwhoflattertotherichandpowerfulsynopsis:summaryoroutlinetaciturn:untalkativesilenttadpole:formofafrogwhenitleavestheeggtalon:clawofabirdofpreytamp:tapordrivedownbyrepeatedlightblowstamper:interferewithtangential:suddenlychangeabletarnished:lostbrightnesstassel:bunchofthreadstaunt:contemptuousreproachhurtfulremarktaut:tightlystretchedtautology:arepetitionaredundancytawdry:cheapgaudyshowytackyteetotal:opposetoalcoholtemerity:boldnessbrashnessintrepidnesstemperance:abstinencefromalcoholself-controlmoderationtemperate:showingself-controltenacity:firmnesspersistencyadhesivenesstendingtohangontenuous:insubstantialflimsyweaktepid:lukewarmterse:briefandtothepointtestiness:witness/evidencethrift:careeconomythrivingprosperousthwart:obstruct/frustratetimid:shyeasilyfrightenedtimorous:fearfultimidafraidtoady:obsequiousflatterertonic:smthgivingstrengthorenergytopple:beunsteadyandoverturntorment:severepainorsufferingtorpid:sleepingsluggishlethargicdormanttorque:twistingforcecausingrotationtortuous:devious/notstraightforwardtout:personwhoworriesotherstobuysmthtousehisservicetractable:easilycontrolledorguidedtransgress:breakgobeyond(alimit)transient:temporaryfleetingtransitory:brieftravesty:parody/imitationtrenchant:forcefuleffectivevigorousextremelyperceptiveincisivetrepidation:alarmexcitedstateofmindtrickle:flowindropstrifling:unimportanttrite:notnewtruce:(agreement)stopoffightingforatimetruculence:aggressivenessferocitytrudge:walkheavilyturbid:muddyhavingthesedimentstirredupturbulence:beinguncontrolledviolentturgid:excessivelyornateswollenorbloatedturmoil:troubledisturbanceturpitude:wickednessshamefulnessturquoise:greenish-bluepreciousstonetyro:tirobeginnerubiquitous:presenteverywhereulterior:situatedbeyondumbrage:offenseresentmentuncouth:roughawkwardunderbid:makealowerbidthensmbelseundermine:weakengraduallyatthebasemakesmthunderundulate:tomoveinwavelikefashionfluctuateunearth:discoverandbringtolightunencumbered:easy-goingtrifleunfeigned:notpretendedsincereunscathed:unharmedunhurtuntoward:unfortunateinconvenientupbraid:scoldreproachurbane:elegantrefinedinmannersvacillation:beinguncertainhesitatingvagary:strangeactorideavain:withoutuseresultconceitedvaliant:bravevalorous:bravevanquish:conquerveer:changedirectionvenal:readytodosmthdishonestveneer:surfaceappearancecoveringtheTRUEnatureveneration:regardwithdeeprespectveracity:truthverdant:freshandgreenverisimilitude:appearingTRUEorrealveritable:realrightlynamedverve:spiritvigorenthusiasmvestige:traceorsignvex:annoydistresstroublevigilance:watchfulnessself-appointedgroupwhomaintainordervigilant:memberofavigilancecommitteevigorous:strongenergeticvilify:slandersayevilthingsvindictive:havingadesiretorevengevirago:alouddomineeringwomanascoldornagvisceral:oftheinternalorgansofthebodyviscous:sticky/semi-fluidvitiate:lowerthequalityweakenthestrengthvituperate:curseabuseinwordsvivacious:livelyhigh-spiritedvolatile:changeableinconstantfickleunstableexplosivevolubility:fluencyverbosityeasyuseofspokenlanguagevoluble:fluentwaffle:talkvaguelyandwithoutmuchresultwaft:scentwavingmovementcarrylightlythroughwag:merrypersonwarmonger:personwhostirsupwarwarrant:authoritywrittenorderguaranteewean:toturnaway(fromahabit)weigh:measurehoeheavysmthiswelter:turmoilabewilderingjumblewend:togoproceedwhimsical:fullofoddandfancifulideaswince:showbodilyormentalpainwoo:trytowinwrit:writtenorderyarn:talestoryfibersforknittingTCS[NOTEthatsomequestionsarerepeated.Someanswersarenotcorrect.Somequestionsarenotright.Somerightanswershavewrongquestions!!]TCSPAPERSVerbal========SectionDirectionsforquestions1-15:Findthesynonymsofthefollowingwords1.MerryAns.Gay,Happy2.AlienateAns.Estrange3.SolicitAns.Torequest4.HeapAns.Topile5.CargoAns.Freight6.MomentaryAns.Transient7.VolumeAns.Quantity8.VeerAns.Diverge9.DispelAns.Dissipate10.AdmonishAns.Cautious11.MeagerAns.Scanty12.LatitudeAns.Scope13.LatentAns.Potential14.CovetAns.Crave15.DiscretionAns.PrudenceQuantitative==============1.Iftwopencilscost8cents,thenhowmuchdo5pencilscost?Ans.20cents2.Someworkisdonebytwopeoplein24minutes.Oneofthemcandothisworkalonein40minutes.Howmuchtimedoesthesecondpersontaketodothesamework?Ans.60minutes3.Acarisfilledwithfourandhalfgallonsoffuelforaroundtrip.Iftheamountoffueltakenwhilegoingis1/4morethantheamounttakenforcoming,whatistheamountoffuelconsumedwhilecomingback?Ans.2gallons4.ThelowesttemperatureinthenightinacityAis1/3morethan1/2thehighestduringtheday.Sumofthelowesttemperatureandthehighesttemperatureis100degrees.Thenwhatisthelowtemp?Ans.40degrees5.Javagal,whodecidedtogotoweekenedtripshouldnotexceed8hoursdrivinginaday.Theaveragespeedofforwardjourneyis40miles/hr.Duetotrafficonsundays,thereturnjourney’saveragespeedis30m/h.Howfarhecanselectapicnicspot?a)120milesb)between120and140milesc)160milesAns.120miles6.Asalespersonbymistakemultipliedanumberandgottheansweras3,insteadofdividingthenumberby3.Whatistheanswerheshouldhaveactuallygot?Ans.37.AbuildingwithheightDshadowuptoG.WhatistheheightofaneighbouringbuildingwithashadowofCfeet.Ans.(C*D)/G8.Apersonwasfinedforexceedingthespeedlimitby10mph.Anotherpersonwasalsofinedforexceedingthesamespeedlimitbytwicethesame.Ifthesecondpersonwastravellingataspeedof35mph,findthespeedlimit.Ans.15mph9.Abusstartedfrombustandat8.00am,andafterstayingfor30minutesatadestination,itreturnedbacktothebusstand.Thedestinationis27milesfromthebusstand.Thespeedofthebusis18mph.Duringthereturnjourneybustravelswith50%fasterspeed.Atwhattimedoesitreturntothebusstand?Ans.11.00am10.Inamixture,Ris2partsandSis1part.InordertomakeSto25%ofthemixture,howmuchofRistobeadded?Ans.OnepartofR11.Windflows160milesin330min,fortravelling80mileshowmuchtimedoesitrequire?Ans.2hrs45mins12.Witha4/5fulltankavehiclecantravel12miles,howfarcanittravelwitha1/3fulltankAns.5miles13.Therearetwotreesinalawn.Onegrowsatarate3/5oftheotherin4years.Ifthetotalgrowthoftreesis8ft.Whatistheheightofthesmallertreeafter2yearsAns.11/2feet14.Refertothefigurebelow.AshipstartedfromPandmovesataspeedofImilesperhourandanothershipstartsfromLandmovingwithHmilesperhoursimultaneously.Wheredothetwoshipsmeet?||—g—||—h—||—i—||—j—||—k—||—l—||PGHIJKLarethevariousstopsinbetweendenotedby||.Thevaluesg,h,i,j,k,ldenotethedistancebetweentheports.Ans.BetweenIandJ,closertoJ15.IfAistravellingat72kmperhouronahighway.Bistravellingataspeedof25meterspersecondonahighway.Whatisthedifferenceintheirspeedsinm/sec.Ans.1m/secCriticalReasoningSection==========================Thecriticalreasoningsectionconsistsofsomepassagesfollowedby4to7questionsperpassage.Thequestionsaresuchthattheyrequireabilitytoreadfastandcomprehend.ThequestionsaskedinthissectionhavethreechoicesTRUE,FALSE,CAN’TSAY.Someexamplesofquestionsaregivenbelow.Pleasenotethatthesepassagesarenottheexactpassagesasked.Thepassagesusedagooddealofdifficultwordswhichhavebeenremovedinthisreproduction.Alsothepassagesappearingintheactualpaperaremuchlengthier.Directions:Answerthequestionsgivenbelowthepassageorstatementastrue,falseorcan’tsay.PASSAGEA:Myfatherhasnobrothers.Hehasthreesisterswhohastwochildseach.Answer1-5basedonthepassageA1.Mygrandfatherhastwosons.Ans.False2.ThreeofmyauntshavetwosonsAns.Can’tsay3.MyfatherisonlychildtohisfatherAns.False4.IhavesixcousinsfrommymothersideAns.Can’tsay5.IhaveoneuncleAns.Can’tsay(unclecanbefromthemother’ssideaswell)PASSAGEB:Etherinjectedintogallabladertodissolvecolestrolbasedgallstones.Thistypeonedaytreatmentisenoughforgallstonesnotforcalciumstones.Thismethodisalternativetosurgeryformillionsofpeoplewhoaresufferingfromthisdisease.Answerquestions6-9basedonpassageB6.CalciumstonescanbecuredinonedayAns.False7.HundredsofpeoplecontainscalciumstonesAns.Can’tsay8.SurgeryistheonlytreatmenttocalciumstonesAns.True9.EtherwillbeinjectedintothegallbledertocurethecholestrolbasedgallstonesAns.TruePASSAGEC:Hackingisillegalentryintoanothercomputer.Thishappensmostlybecauseoflackofknowledgeofcomputernetworking.Withnetworksonemachinecanaccesstoanothermachine.Hackinggoaboutwithoutknowingthateachnetworkisaccreditedtousenetworkfacility.Answerquestions10-12basedonpassageC10.HackersneverbreakthecodeofthecompanywhichtheyworkforAns.Can’tsay11.HackingistheonlyvulnerabilityofthecomputersfortheusageofthedataAns.False12.HackingisdonemostlyduetothelackofcomputerknowledgeAns.FalsePASSAGED:Alphinetunnelsareclosedtunnels.Inthepast30yrsnotevenasingleaccidenthasbeenrecordedforthereisoneaccidentintherailroadsystem.Evenincaseofafireaccidentitispossibletoshiftthepassengersintoadjacentwagonsandeventhelivefirecanbedetectedandextinguishedwithinthedurationof30min.Answerquestions13-16basedonpassageD13.NoaccidentcanoccurintheclosedtunnelsAns.True14.Fireisallowedtolivefor30minAns.False16.Allthecarethattravelinthetunnelswillbecarriedbyrailshutters.Ans.TruePASSAGEE:Inthepasthelicopterswereforcedtogroundorcrashbecauseoftheformationoftheiceontherotorsandengines.Anewelectronicdevicehasbeendevelopedwhichcandetectthewatercontentintheatmosphereandwarnsthepilotifthetemperatureisbelowfreezingtemperatureabouttheformationoftheiceontherotorsandwings.Answerquestions17-20basedonpassageE17.TheelectronicdevicecanavoidformationoftheiceonthewingsAns.False18.Therewillbethemalfunctionofrotor&enginebecauseofformationoficeAns.True19.ThehelicoptersweretobecrashedorgroundedAns.True20.ThereisonlyonedevicethatwarnabouttheformationoficeAns.TruePASSAGEF:Inthesurveyconductedinmumbaioutof63newlymarriedhousewivesnotasinglehousewifefeltthatthehusbandsshouldtakeequalpartinthehouseholdworkastheyfelttheyloosetheirpowerovertheirhusbands.Inspiteoftheircareerstheyopttodothekitchenworkthemselvesaftercomingbacktohome.thewivesgethalfasmuchleisuretimeasthehusbandsgetattheweekends.Answerquestions21-23basedonpassageF.21.HousewiveswantthehusbandstotakepartequallyinthehouseholdAns.False22.WiveshavehalfasmuchleisuretimeasthehusbandshaveAns.False23.39%ofthemenwillworkequallyinthehouseincleaningandwashing.Ans.FalsePASSAGEG:Copernicusistheintelligent.Inthedaysofcopernicusthetransportandtechnologydevelopmentwasless&ittookplaceweekstocomunicateamessageatthattime,whereinwecansenditthroughsatellitewithinnotime.Evenwiththisfastdevelopmentsithasbecomedifficulttounderstandeachother.Answerquestions24-27basedonpassageG.24.PeoplewerenotintelligentduringCopernicusdaysAns.False25.TransportfacilitiesareverymuchimprovedinnoeadaysAns.Can’tsay26.Evenwiththefastdevelopmentsofthetechonologywecan’tlivehappily.Ans.Can’tsay27.WecanunderstandthepeopleverymuchwiththedevelopmentofcommunicationAns.False.PASSAGEH:Seniormanagerswarnedtheworkersthatbecauseoftheintfoductorsofjapaneseindustryinthecarmarket.Thereisthethreattotheworkers.Theyalsosaidthattherewillbethereductioninthepurchaseofthesalesofcarinpublic.theinterestratesofthecarwillbeincreasedwiththelossindemand.Answerquestions28-31basedonpassageH.28.Japaneseworkersaretakingoverthejobsofindianindustry.Ans.False29.Managerssaidcarinterestswillgodownafterseeingtheraiseininterestrates.Ans.True30.Japaneseinvestmentsareceasingtoendinthecarindustry.Ans.False31.Peopleareveryinterestedtobuythecars.Ans.FalsePASSAGEI:Inthetotalitarituricandays,thewordshaveverymuchdevalued.Inthepresentday,theyarebecomingdomesticthatisthewordswillbemuchmoredevalued.Inthatdays,thewordswillbeverymucheffectedinpoliticalarea.butatpresent,thewordscameverycheap.Wecansaytheycomefreeatcost.Answerquestions32-34basedonpassageI.32.Totalitariansocietywordsaredevalued.Ans.False33.TotalitarianswillhavetocomemuchaboutwordsAns.True34.Thearttotalitatiansocietythewordsareusedforthepoliticalspeeches.Ans.FalsePASSAGEJ:Thereshouldbecopyrightforallarts.Thereelehascamethatalltheartshascomeunderonecopyrightsociety,theywereusethemoneythatcomefromtheartsforthedevelopments.TheremaybealotofmoneywillcomefromtheTagoreworks.WehavetoaskthebenifitersfromTagoreworktohelpforthedevelopmentofhisworks.Answerquestions35-39basedonpassageJ.35.Tagoreworksarecameunderthiscopyrightrule.Ans.False36.Peoplearefreetogotothepublicbecauseofthecopyrightrule.Ans.Can’tsay38.Peoplegivestotheaterandcollectthemoneyfordevelopment.Ans.Can’tsay39.WehaveasktheTagoreresedentstohelpforthedevelopmentsofart.Ans.Can’tsayPsycometricTest================Youdon’tneedtofretmuchaboutthistest.Thistestconsistsof150questionsandisjustapyshcologytestwhichshouldbeansweredconfidentlyanddoesn’trequireanypreparation.Onemusttrybeingconsistentwhileansweringasthesamequestionsarerepeatedlyaskedindifferentforms.Alsoonemustanswerallquestions.Questionsareofyes,noorcan’tsaykind.1.Willyoubeinterestedinsocialactivities.2.Whilegoingupstairsdoyoumovetwostepsatatime.3.Canyoumakefriendswithpeopleofthesamesexorwithoppositesexalso4.Yourfriendsconsideryouasaleaderinyourgroup5.Peoplethinkthatyour’eseriousminded.6.Therearetimesyoufeeldullwithoutanyreason.7.Youhostseveralparties8.Whenrelativescometoyourhousedoyouentertainthem.9.Youcanworkforlonghourswithouttireness.10.Inyourcompanyyouwanttoleadtheorganisation.NOTE:EACHOFTHEQUESTIONSGIVENBELOWAPPEARASMULTIPLECHOICEQUESTIONSINTHEACTUALPAPER.VerbalSection===============Directionsforquestions1-15:Findthesynonymsofthefollowingwords1.DepreciationAns.Deflation,Depression,Devaluation,fall,slumpinvalue2.DeprecateAns.Feelandexpressdisapprovalof3.IncentiveAns.Thingoneencouragesapersontodosomething4.EchelonAns.Levelofauthorityorresponsibility5.InnovationAns.Tomakechangesorintroducenewthings6.IntermittantAns.Externallystoppingandthenstarting7.DetrimentalAns.Harmful8.AberrationAns.Deviation9.ConciliationAns.Tomakelessangryormorefriendly10.OrthodoxAns.Conventionalorsuperstitious11.FallibleAns.Liabletoerr12.VolatileAns.Everchanging13.ManifestionAns.Clearorobvious14.ConnotationAns.Suggestinadditiontothefundamentalmeaning15.ReciprocalAns.Reverse,OppositeQuantitativeSection====================1.Thereare150weights.Someare1kgweightsandsomeare2kgweights.Thesumoftheweightsis260.Whatisthenumberof1kgweights?Ans.402.Aisdrivingonahighwaywhenthepolicefineshimforoverspeedingandexceedingthelimitby10km/hr.AtthesametimeBisfinedforoverspeedingbytwicetheamountbywhichAexceededthelimit.Ifhewasdrivingat35km/hrwhatisthespeedlimitfortheroad?Ans.15kmph3.Amoves3kmseastfromhisstartingpoint.Hethentravels5kmsnorth.Fromthatpointhemoves8kmstotheeast.HowfarisAfromhisstartingpoint?Ans.13kms4.Acartravels12kmswitha4/5thfilledtank.Howfarwillthecartravelwith1/3filledtank?Ans.5kms5.Thesumofthedigitsofatwodigitnumberis8.When18isaddedtothenumber,thedigitsarereversed.Findthenumber?Ans.356.Thecostofonepencil,twopensandfourerasersisRs.22whilethecostoffivepencils,fourpensandtwoerasersisRs.32.Howmuchwillthreepencils,threepensandthreeeraserscost?Ans.277.Fathersageis5timeshisson’sage.4yearsbackthefatherwas9timesolderthanson.Findthefathers’presentage.Ans.40years8.Whatnumbershouldbeaddedtoorsubtractedfromeachtermoftheratio17:24sothatitbecomesequalto1:2.Ans.10shouldbesubtracted9.Whatisthe12thtermoftheseries2,5,8,….Ans.3510.If20mentake15daystotocompleteajob,inhowmanydayscan25menfinishthatwork?Ans.12days11.Inafraction,if1isaddedtoboththenumeratoratthedenominator,thefractionbecomes1/2.Ifnumeratorissubtractedfromthedenominator,thefractionbecomes3/4.Findthefraction.Ans.3/712.IfRs.1260isdividedbetweenbetweenA,BandCintheratio2:3:4,whatisC’sshare?Ans.Rs.56013.AshopkeeperboughtawatchforRs.400andsolditforRs.500.Whatishisprofitpercentage?Ans.25%14.Whatpercentof60is12?Ans.20%15.HansiemadethefollowingamountsinsevengamesofcricketinIndia:Rs.10,Rs.15,Rs.21,Rs.12,Rs.18,Rs.19andRs.17(allfiguresincroresofcourse).Findhisaverageearnings.Ans.Rs.16croreCriticalReasoningSection================================Thissectionisbasicallyjustareadingcomprehensionsection.Thecriticalreasoningsectionconsistsofsomepassagesfollowedby4to7questionsperpassage.Thequestionsaresuchthattheyrequireabilitytoreadfastandcomprehend.ThequestionsaskedinthissectionhavethreechoicesTRUE,FALSE,CAN’TSAY.Someexamplesofpassagesaregivenintest1.ForfurtherpracticeyoumaygothroughanyGREorCATbookwhichwillprovideyouwithamplepracticeregardingthesekindsofquestions.PsychometricTestThistestconsistsof150questionsandisjustapyshcologytestwhichshouldbeansweredconfidentlyanddoesn’trequireanypreparation.Onemusttrybeingconsistentwhileansweringasthesamequestionsarerepeatedlyaskedindifferentforms.Alsoonemustanswerallquestions.Questionsareofyesornokind.Example:Areyousincere?Ifyoufindapurseinthemarketwithloadsofmoneywouldyoureturnittotherightfulowner?Whileclimbingupthestairsdoyoutaketwostepsatatime?Doyoudrinkandsmokemorethanyouthinkyoushould?Areyouthelifeofthepartyyouattend?Areyoushy?Thistestconsistsof50questions.TheSetCodeforthispaperisD.1.TheClanguageterminatoris(a)semicolon(b)colon(c)period(d)exclamationmark2.Whatisfalseaboutthefollowing—Acompoundstatementis(a)Asetofsimplestatments(b)Demarcatedoneithersidebycurlybrackets(c)Canbeusedinplaceofsimplestatement(d)ACfunctionisnotacompoundstatement.3.WhatistrueaboutthefollowingCFunctions(a)Neednotreturnanyvalue(b)Shouldalwaysreturnaninteger(c)Shouldalwaysreturnafloat(d)Shouldalwaysreturnmorethanonevalue4.Mainmustbewrittenas(a)Thefirstfunctionintheprogram(b)Secondfunctionintheprogram(c)Lastfunctionintheprogram(d)Anywhereintheprogram5.Whichofthefollowingaboutautomaticvariableswithinafunctioniscorrect?(a)Itstypemustbedeclaredbeforeusingthevariable(b)Ttheyarelocal(c)Theyarenotinitialisedtozero(d)Theyareglobal6.Writeonestatementequivalenttothefollowingtwostatementsx=sqr(a);return(x);Choosefromoneofthealternatives(a)return(sqr(a));(b)printf(“sqr(a)”);(c)return(a*a*a);(d)printf(“%d”,sqr(a));7.WhichofthefollowingabouttheCcommentsisincorrect?(a)Ccommentscangoovermultiplelines(b)Commentscanstartanywhereintheline(c)Alinecancontaincommentswithoutanylanguagestatements(d)Commentscanoccurwithincomments8.Whatisthevalueofyinthefollowingcode?x=7;y=0;if(x=6)y=7;elsey=1;(a)7(b)0(c)1(d)69.Readthefunctionconv()givenbelowconv(intt){intu;u=5/9*(t-32);return(u);}Whatisreturned(a)15(b)0(c)16.1(d)2910.Whichofthefollowingrepresentstruestatementeitherxisintherangeof10and50oryiszero(a)x>=10&&xMAX)x=1;elseif(xa.Atypeof2.Square–Polygon—>b.Apartof3.Roof–Building—>c.Notatypeof4.Mushroom–Vegetables—>d.AsupersetofAns:1-d,2-a,3-b,4-c51.Matchthefollowing.1.brother�sister—>a.Partof2.Alsatian�dog—>b.Sibling3.sentence�paragraph—>c.Typeof4.car–steering—>d.NotatypeofAns.1-b,2-c,3-a,4-d*****RemainingQuestionswerefromGraph,piecharts,BarchartandVenndiagramwhichwereveryeasy.SECTION3:CRITICALREASONING==============================I.TheplayersG,H,J,K,L,M,N,OaretobefelicitatedofrepresentingthecountyteaminBaseballOutoftheseH,M,OalsoareintheFootballteamandK,NarethereintheBasketballteam.Theseplayersaretobeseatedonatableandnotwoplayerswhohasrepresentedthecountyinmorethanonegamearetosittogether.1.Whichoneoftheorderscantheybeseatedin2.Whichoftheordersisnotpossible3.IfNisseatedinthemiddlethenwhichofthefollowingpairscannotbeseatednearhim.4.IfMisseatedthenwhichofthefollowingpairscanbeseatednexttohim.ChoicesaregivenforallthequestionsIIThereare2groupsnamedBrownandred.Theycan?marryinthesamegroup.Ifthehusbandorwifediesthenthepersonwillconverttotheirowngroup.Ifapersonismarriedthenthehusbandwillhavetochangehisgrouptohiswife?group.Thechildwillownthemothersgroup.Fromtheseasetof4questionsweregiven.SolvethemEg;1.Brown?daughterisred(False)2.Ifapersonisred.Thenhis/hermother?brotherbelongtowhichgroupifheismarried(Brown)III7people�a,b,c,d,e,f,gNeedtomakeaseatingarrangementforthem.Conditions:1)Ashouldbeatthecenter2)B,Fshouldbeattherightextreme3)C,Ealwaysinpair4)D,GasfaraspossibleQuestionsfromtheabovewereasked?Eg:Whichofthefollowingpairswerenotpossible?Othersquestionsweresimilartotheabove.MorequestionswerefromBarrons.HRQUESTIONS:==============Forallthequestionstheyexpectaelaborateanswerwithjustificationsandnotashortone.1)Marketurself2)WhyTCS?3)WilluswitchovertoanyothercompanyafterjoiningTCS?IfNOthenwhy?4)Rumobile?(Rureadytogoanywhere?)5)Rureadytogotoplacesofextremetemperature.Ifyeswhatdouthinkofursafety?6)Whataretherequirementsforleadershipquality?7)Whyuswitchovertos/wfromurownbackground?8)Whatarethequalitiesrequiredforas/wengineerandProjectmanager?9)Rateurgoodqualities?10)Whatisthedifferencebetweenhardandsmartwork?11)Douhaveaplanofdoinghigherstudies?TECHNICALQUESTIONSGeneral:=====================Thequestionsweredifferentfordifferentpersonsanddependsonthefieldofinterestthatusay.Communication:===============1)OSILayersinn/wwiththefunctionalities2)TCP/IPprotocol3)Bridges,Routers,LAN,WAN,MAN4)Tokenbus,FDDI,EthernetCLanguage:=============1)Datastructuresesp:Linkedlistandtrees2)Structures,unions,Kindofvariables(local,Global)3)Strrev()program4)Casestructure(itisnottheusualswitchcasestat)5)Calloc,malloc6)Divide2numberandprinttheo/p(NOTE:Checkfordividebyzeroerror)PSYCHOMETRYTEST================Direction:Inthissectionyouwillfinddifferentquestionswiththesamemeaning.Inallsuchquestionsyouranswerhastobesame.fore.g.:Inbeingthrownbychancewithastranger,youwaitforthepersontointroducehimselforherself.(a)Yes(b)No(c)?Itisdifficultforyoutochataboutthingsingeneralwithpeople.(a)Yes(b)No(c)?Thesetwoquestionshavesimilarmeanings.Ifyouanswerthefirstone‘NO’andthesecondone‘YES’,i.e.ifyoudifferinyouranswerstosimilarquestionsyoulosemarksforeveryquestionwiththeabovemeaning.Thechoicestothesequestionsare:(a)Yes.(b)No.(c)?1.Youstarttoworkonaprojectwithgreatdealofenthusiasm.2.Youwouldratherplananactivitythantakepartinit.3.Youhavemorethanoncetakenleadinorganizingprojectoragroupofsomekind.4.Youliketoentertainguests.5.Yourinterestschangequicklyfromonethingtoanother.6.Whenyoueatamealwithothers,youareusuallyoneofthelasttofinish.7.Youbelieveintheideathatweshould”eat,drinkandbemerry,fortomorrowwedie.”8.Whenyoufindthatsomethingyouhaveboughtisdefective,youhesitatetodemandanexchangeorarefund.9.Youfinditeasytofindnewacquaintances.10.Youaresometimesbubblingoverwithenergyandsometimesverysluggish.11.Youarehappiestwhenyougetinvolvedinsomeprojectsthatcallsforrapidaction.12.Otherpeoplethinkofyouasbeingveryseriousminded.13.Inbeingthrownbychancewithastranger,youwaitforthepersontointroducehimselforherself.14.Youliketotakepartinmanysocialactivities.15.Yousometimesfeel“justmiserable”fornogoodreasonatall.16.Youareoftensomuch”onthego”thatsoonerorlateryoumaywearyourselfout.17.Youlikepartiesyouattendtobelively.18.Ifyouholdanopinionthatisradicallydifferentthatexpressedbyalecturer,youarelikelytotellthepersonaboutiteitherduringorafterthelecture.19.Itisdifficultforyoutochataboutthingsingeneralwithpeople.20.Yougivelittlethoughttoyourfailuresaftertheyarepassed.21.Youoftenwonderwhereothersgetalltheexcessenergytheyseemtohave.22.Youareinclinedtostoptothinkthingsoverbeforeyouact.23.Youavoidarguingoverapricewithaclerkorsalesperson.24.Youwoulddislikeverymuchtoworkaloneinsomealoneplace.25.Youoftenfinditdifficulttogotosleepatnightbecauseyoukeepthinkingofwhathappenedduringtheday.26.Youfindyourselfhurryingtogettoplacesevenwhenthereisplentyoftime.27.Youlikeworkthatrequiresconsiderableattentiontodetails.28.Youaresatisfiedtoletsomeoneelsetaketheleadingroupactivities.29.Youenjoygettingacquaintedwithpeople.30.Ittakesalottogetyouemotionallystirreduporexcited.31.Youworkmoreslowlyanddeliberatelythanmostpeopleofyoursexandage.32.Youareacarefreeindividual.33.Whenpeopledonotplayfairyouhesitatetosayanythingaboutittothem.34.Itbothersyoutohavepeoplewatchyouatyourwork.35.Youhaveusuallybeenoptimisticaboutyourfuture.36.Youliketohaveplentyoftimetostopandrest.37.Youtakelifeveryseriously.38.Youenjoyapplyingforajobinperson.39.Youwouldliketobeahostorhostessforpartiesatclub.40.Youoftenfeeluncomfortableoruneasy.41.Youarethekindofpersonwhois“onthego”allthetime.42.Youoftencraveexcitement.43.Thethoughtofmakingaspeechfrightensyou.44.Youfinditeasytostartconversationwithstrangers.45.Youoftenfeelguiltywithoutaverygoodreasonforit.46.Peoplethinkyouareaveryenergeticperson.47.Yousometimesmakequickdecisionsthatyoulaterwishyouhadn’tmade.48.Youfinditdifficulttoaskpeopleformoneyorotherdonations,evenforacauseinwhichyouareinterested.49.Youaresonaturallyfriendlythatpeopleimmediatelyfeelateasewithyou.50.Youdaydreamagreatdeal.51.Youarequickinyouractions.52.Youhaveahabitofstartingthingsandthenlosinginterestinthem.53.Whenyouwereachildmanyofyourplaymatesnaturallyexpectedyoutobetheleader.54.Yousometimesavoidsocialcontactsforfearofdoingorsayingthewrongthing.55.Youhavefrequentupsanddownsinmood,sometimeswithandsometimeswithoutapparentcause.56.Youalwaysseemtohaveplentyofvigourandvitality.57.Itisdifficultforyoutounderstandpeoplewhogetveryconcernedaboutthings.58.Whenaclerkinastorewaitsonotherswhocomeafteryou,youcallhisorherattentiontothefact.59.Youwouldbeveryunhappyifyouwerepreventedfrommakingnumeroussocialcontacts.60.Therearetimeswhenyourfuturelooksverydark.61.Yousometimeswishthatpeoplewouldslowdownabitandgiveyouachancetocatchup.62.Manyofyourfriendsthinkyoutakeyourworktooseriously.63.Youhesitatetowalkintoameetingwhenyouknowthateveryone’seyewillbeuponyou.64.Youlimityourfriendshipsmostlytomembersofyourownsex.65.Youalmostalwaysfeelwellandstrong.66.Youseemtolackthedrivenecessarytogetasmuchasotherpeopledo.67.Youmakedecisionsonthespurofthemoment.68.Youarerathergoodatbluffingwhenyoufindyourselfindifficulty.69.Afterbeingintroducedtosomeone,youjustcannotthinkofthingstosaytomakegoodconversation.70.Youfeellonesomeevenwhenwithotherpeople.71.Youareabletoworkforunusuallylonghourswithoutfeelingtired.72.Youoftenactonthefirstthoughtthatcomesintoyourhead.73.Atthesceneofanaccident,youtakeanactivepartinhelpingout.74.Youhavedifficultyinmakingnewfriends.75.Yourmoodoftenchangesfromhappinesstosadnessorviceversawithoutknowingwhy.76.Youtalkmoreslowlythanmostpeople.77.Youliketoplaypracticaljokesuponothers.78.Youtaketheleadinputtinglifeintoadullparty.79.Youwouldliketobelongtoasmanyclubsandsocialorganizationsaspossible.80.Therearetimeswhenyourmindseemstoworkveryslowlyandothertimeswhenitworksveryrapidly.81.Youliketodothingsslowlyanddeliberately.82.Youareahappy-go-luckyindividual.83.Whenyouareservedstaleorinferiorfoodinarestaurant,yousaynothingaboutit.84.Youwouldratherapplyforajobbywritingaletterthanbygoingthroughwithapersonalinterview.85.Youareofteninlowspirits.86.Youareinclinedtorushfromoneactivitytoanotherwithoutpausingenoughforrest.87.Youaresoconcernedaboutthefuturethatyoudonotgetasmuchfunoutofthepresentasyoumight.88.Whenyouareattractedtoapersonwhomyouhavenotmetearlieryoumakeanactiveattempttogetacquaintedeventhoughitmaybequitedifficult.89.Youareinclinedtolimityouracquaintancestoselectfew90.youseldomgiveyourpastmistakesasecondthought.91.Youarelessenergeticthanmanypeopleyouknow.92.Youoftenstoptoanalyzedyourthoughtsandfeelings.93.Youspeakoutinmeetingstoopposethosewhomyoufeelsurearewrong.94.Youaresoshyitbothersyou.95.Youaresometimesbotheredbyhavingauselessthoughtcomeintoyourmindoverandover.96.Yougetthingsinhurry.97.Itisdifficultforyoutounderstandhowsomepeoplecanbesounconcernedaboutthefuture.98.Youlietosellthings(i.e.toactasasalesperson)99.Youareoften“LifeoftheParty”.100.Youfinddaydreamingveryenjoyable.101.Atworkoratplayotherpeoplefindithardtokeepupwiththepaceyouset.102.Youcanlistentoalecturewithoutfeelingrestless.103.Youwouldratherworkforagoodbossthanforyourself.104.Youcanexpressyourselfmoreeasilyinspeechthaninwriting.105.Youkeepinfairlyuniformspirits.106.Youdisliketobehurriedinyourwork.107.Yousometimesfindyourself“crossingbridgesbeforeyoucometothem”.108.Youfinditsomewhatdifficulttosay“no”toasalespersonwhotriestosellyousomethingyoudonotreallywant.109.Thereareonlyafewfriendswithwhomyoucanrelaxandhaveagoodtime.110.Youusuallykeepcheerfulinspiteoftrouble.111.Peoplesometimestellyouto“slowdown”or“takeiteasy”.112.Youareoneofthosewhodrinkorsmokemorethantheyknowtheyshould.113.Whenyouthinkyourecognizepeopleyouseeinapublicplace,youaskthemwhetheryouhavemetthembefore.114.Youprefertoworkalone.115.Disappointmentaffectyousolittlethatyouseldomthinkaboutthemtwice.116.Youareslowanddeliberateinmovements.117.Youlikewildenthusiasm,sometimestoapointborderingonrowdyismatafootballorbaseballgame.118.Youfeelselfconsciousinthepresenceofimportantpeople.119.Peoplethinkofyouasbeingaverysocialtypeofperson.120.Youhaveoftenlostsleepoveryourworries.121.Youcanturnoutalargeamountofworkinashorttime.122.Youkeepatataskuntilitisdone,evenafternearlyeveryoneelsehasgivenup.123.Youcanthinkofagoodexcusewhenyouneedone.124.Otherpeoplesaythatitisdifficulttogettoknowyouwell.125.Youdaydreamsareoftenaboutthingsthatcannevercometrue.126.Youoftenrunupstairstakingtwostepsatatime.127.Youseldomletyourresponsibilityinterferewithyourhavingagoodtime.128.Youliketotakeonimportantresponsibilitiessuchasorganizinganewbusiness.129.Youhavehesitatedtomakeortoaccept“dates”becauseofshyness.130.Yourmoodisveryeasilyinfluencedbypeoplearoundyou.131.Othersareoftenamazedbytheamountofworkyouturnout.132.Yougenerallyfeelasthoughyouhaven’tacareintheworld.133.Youfinditdifficulttogetridofsalespersonwhomyoudonotcaretolistenorgiveyourtime.134.Youarealistenerratherthanatalkerinasocialconversation.135.Youalmostalwaysfeelthatlifeisverymuchworthliving.136.Itirritatesyoutohavetowaitatacrossingforalongfreighttraintopass.137.Youusuallysaywhatyoufeellikesayingatthemoment.138.Youliketospeakinpublic.139.Youliketobewithpeople.140.Yougenerallykeepcoolandthinkclearlyinexcitingsituations.141.Otherpeopleregardyouasalivelyindividual.142.Whenyougetangry,ifyouletyourselfgo,youfeelbetter.143.Youseektoavoidalltroublewithotherpeople.144.Peopleseemtoenjoybeingwithyou.145.Yousometimesfeellistlessandtiredfornogoodreason.146.Itishardtounderstandwhymanypeoplearesoslowandgetsolittledone.147.Youarefondofbettingonhorseracesandgames,whetheryoucanafforditornot.148.Ifsomeoneyouknowhasbeenspreadinguntrueandbadstoriesaboutyou,youseethepersonassoonaspossibleandhaveatalkaboutit.149.Shynesskeepyoufrombeingaspopularasyoushouldbe.150.Youaregenerallyfreefromworryaboutpossiblemisfortunes.PSYCHOMETRYGROUPINGIhavegroupedthepsychometricquestionsnumbering150.asitisnotpossibleformetowriteeachquestionIamindicatingonlythenumbers.ItsuptoutocorrespondtothequestionsAttheoutsetIwouldliketoclearlystatethatthisversionhasnoguaranteetobethecorrectversion.Actuallysome30/150questionsfallintomanygroupsandthelinedifferentiatingthemisverythin.Ihavetriedmybesttogroupthem.Talkingaboutthegroups-theyare11innumber.AsIhavementioned-thisisnottheonlycorrectversion-butthiscanbeone.Soifufeelucangroupthemmorefinerucansubdividethemintomanymore.Iwouldadviseustrictlytogothroughthewholesetofgroupsanddefineurselves-thekeytopsychometrictestistodefinewhouareandthenstartlookingintodeeplythequestions.Eachgrouprepresentsacharacterorpersonality-uwilldecidewhichofthefollowingattributesuwouldliketoincludeinurpersonality.GROUP1LEADERSHIPQUALITIES2328395373103128GROUP2SOCIABLENATURE491314242944495459647074798889109114119139GROUP3BALANCEDPSYCHEpeoplewhoarebalanced-notwaveryintheirmoodsetc..etc51015163540414552556065758095105130145148GROUP4DAYDREAMERS50100107125GROUP5PATIENCEANDATTRIBUTEOFTAKINGRIGHTDECISIONSAFTERCAREFULANALYSIS2227476772869296102112117126134136137140142147GROUP6EASYGOINGANDCAREFREENATUREDPERSONALITIES620253257687782879098115123127132135150GROUP7ENTHUSIASTICPERSONALITIES1174266788599110141144GROUP8SLOWSLUGGISHDULLPERSONALITIES7112130313646515661768191106116101146GROUP9SERIOUSPERSONALITIES1226376297111120124143GROUP10STRONGFULLOFENERGY71121122131GROUP11DIFFIDANT(shy,notabletoaskeventhemostrequiredthing..etc..)818192333343843(34)485863(34)698384(38)93104(34)108113118(34)129133149readthefollowingbeforeproceeding1.thelastgroupisbiggerandwithinthegroupitselfasmallsubgroupingisdone-theno.inthebracketistheparentquestiontowhichthenooutsidethebracketbelongsto-hopeuunderstand2.strictly-thismaynotbe100%rightasmanyquestionslookverysimilar.Sogothruandmakealterationsifufeelso.3.ineachgroupstherer2kindsofquestions-ifusayyestosomeandnotoothersuwilllandupatthesamedefinition.Soitsurcommonsensetounderstandtheaffirmativeandnegativetonesofeachquestionandansweraccordingly-ushldknowwhentoanswernoandyesforeachquestioninthesamegroup-4.somegroupsitselfareoppositetoeachotherandcanbegroupedtogether-butIhaveseparatedthemonthebasisoffinerinferenceseg:-seriouspersonscantbeeasygoingtype.ifusaynotoanyquestiononseriousgroupquestionuwilllandasaneasygoingpersonalityandviceversa-sotheycanbeputunderasinglegroup-butsomefinerpointspreventfromdoingsoTCSCOBOLpaper.01.considerthefollowingpieceofcode01GROSS-PAY05BASIC-PAYPIC9(5)05ALLOWENCESPIC9(3)ifBASIC-PAYhasavalue1000andALLOWANCEShasavalueof250,whatwillbedisplayedbythestatementDISPLAYGROSS-PAYa.1250b.01000250c.01250d.1.25002.considertwodataitems77W-APIC9(3)V99VALUE23.7577W-BPICZZ9V99VLAUE123.45afterthestatementMOVEW-ATOW-BwhatwillbeW-B’svalue?a.123.75b.b23.75(wherebindicatesspace)c.023.75d.invalidmove03.whatistheresultofthefollowing?DIVIDEAINTOBGIVINGC.a.C=A/Bb.thereminderofB/AisstoredinCc.C=B/Ad.thereminderofA/BisstoredinC04.considerthestatement(incomplete)IF(ANUMERIC)DISPLAYAthevariableAcanbea.NUMERICb.ALPHABETICc.ALPHANUMERICd.NUMERICORALPHANUMERIC05.whichofthefollowingcanbeusedasacheckprotectionsymbola.Zb.Sc.*d.+06.whatifany,isthesyntexerrorinthefollowingpieceofcode01BPICA(7)02CPIC9(4)……..IF(BNUMERIC)ADD10TOCa.theconditionintheifstatementiswrongb.notingiswrongc.becauseCisinitialised.ADD10TOCiswrongd.bothBandCshoudhavesamesize.07.studythefollowingcode01A105BPIC9905CPICX(4)01A205BPIC99V9905CPICA(4)pickoutthevalidstatementfromthefollowinga.A1andA2cannothavesub-ordinatesb.A1andA2canhavethesamesub-ordinatesbut

Page 5: Daily paragraph editing terminal velocity answers

musthavesamePICclausec.thereisnothingwrongd.A1andA2canhavesamesub-ordinatesprovidedtheyarenotat01level08.studythefollowing01APIC99V0VALUE501BPIC9V9VALUE601CPIC99V9VALUE2.501DPIC99VALUE3COMPUTEAROUNDEDBC=A+B*C/DONSIZEERRORPERFORMPRINT-ERRORthecommentsofA.B.Cafterexecutionoftheabovestatementarea.A=10B=0C=10b.A=10B=9.9C=9.9c.A=10B=0C=9.9d.A=10B=6C=1009.howmanytimesPARA-Aisperformed:PERFORMPARA-AVARYINGTIMES-COUNTERFROM1BY1UNTILTIMES-COUNTER>0PARA-AMOVEPTOQMOVEHTOTIMESCOUNTERa.10b.1c.11d.010.considerthefollowingpieceofcode01GROUP-ITEM05AMOUNT-1PIC99V9USAGECOMPVALUE5005AMOUNT-2PIC9(4)V99USAGECOMPMOVEZEROTOGROUP-ITEMADD50TOAMOUNT-1whatwillbethecontentofAMOUNT-1?a.50b.100c.0d.unpredictable11.considerthefollowingprogrmstatementsMOVE0TOSW.NO.OF.RECPERFORMPRI-OUTUNTILSW=1DISPALYNO.OF.RECSTOPRUNPRE-OUTREADIN-FILEATENDMOVE1TOSWWRITEOUO-RECFROMIN-RECADD1TONO.OFRECiftheIN-FILEcontains1000recordswhatvaluewillbedisplayedafterthePERFORMisover?assumethatN0.OF.REChasPIC9(4)a.1000b.1001c.1d.noneoftheabovesincethereisasyntexerror12.studythedatadiscriptionsandanswerthequestionsgivenbelowi)01ORDERRECORD05OUT-HEADERPICX(50)05ITEM-COUNTPIC9905OUT-ITEMPICX(20)OCCURS1TO20DEPENDINGONITEM-COUNTii)01NAME-AND-ADDRESS05N-AND-A-LINEOCCURES505LINE-LENGTHPICP905N-AND-A-CHARPICXOCCURS1TO20DEPENDINGONLINE-LENGTHiii)01SALES-LIST05SALESMAN-COUNTPIC9905SALESPIC9(6)OCCURS1TO100DEPENDINGONSALESMAN-COUNTiv)01ORDER-RECORD05NO-OF-BRANDSPIC9905BRAND-PURCHASEDOCCURS1TO15DEPENDINGONNO-OF-BRANDSwhichofthefollowingistrue?a.i)andiii)arevalidb.i)andiv)arevalidc.i)andiii)arenotvalidd.allarevalid13.C1C2C3arethreeconditionswhoseTRUTHvaluesareasfolloes.C1-TRUEC2-FALSEC3-TRUEA,B,CaredefinedasgivenbelowA:C1AND(NOTC2)ORC3B.(NOTC1)OR(NOTC2ANDNOTC3)C.(C1ORC2)ANDC3D.C1ANDC2ORC3giventheaboveinformationwhichofthefollowingstatementsarevalid?a.onlyA,BandCareTRUEb.onlyA,CandDareTRUEc.A,B,CandDareTRUEd.onlyCandDareTRUE14.considerthefollowingFDFILE-101REC-1PICX(80)……WORKING-STORAGESECTION01W-RECPICX(90)……..PROCEDUREDIVISIONFIRST-PARA…….READFILE-1INTOW-RECATENDMOVE1TOEOF-FLAGwhichofthefollowingistruewithrespecttotheabove?a.REC-1willcontainnothingandW-RECwillcontainthecontainsoftherecordreadb.REC-1andW-RECcontainthesamedatac.syntexisinvalidanderrorwilloccurd.REC-1andW-RECmustbeofsamesize15.PERFORMACCUMULATE-TOTALSVARYINGAFROM1BY2UNTILA>2AFTERBFROM1BY1UNTILB>2AFTERCFROM2BY-1UNTILC9.——PARA-XADD1TOW-NUMHowmanytimesPARA-Xisexecuted?(a)10(b)9(c)11(d)Infiniteloop24.Considerthefollowingcode:77APIC99V99VALUE55.3577BPIC99V999VALUE32.754ADDBTOAONSIZEERRORDISPLAY“ERROR!!!”Whatwillbetheresult?(a)A=88.10,B=32.754(b)A=87.00B=32.754(c)A=87.10B=32.754(d)ERROR!!!willbeDISPLAYedonthescreen.25.Considerthefollowing:77APIC9(10)77BPIC9(10)77CPIC9(19)MULTIPLYABBYBGIVINGCWhichofthefollowingistrue?(a)Theexecutionoftheabovemayresultinsizeerror.(b)Theexecutionoftheabovewillresultinsizeerror.(c)ThedefinitionofCisinvalidresultingincompilationerror.(d)Noerrorwillbetheeandtheprogramwouldproceedcorrectly.26.AparagraphPARA-XistobeexecutedwhennoneofthedatanamesA,BandChavevalueof1.Whichofthefollowingwillachievethis?(a)IFANOT=1ORBNOT=1ORCNOT=1PERFORMPARA-X(B)IFNOTA=1ANDB=1ANDC=1PERFORMPARA-X(C)IFANOT=1IFNOTB=1ORC=1PERFORMPARA-X(C)IFANOT=1ANDBNOT=1ANDCNOT=1PERFORMPARA-X27.Studythefiveexpressionsandtheclasstowhichtheybelong:S.N.ExpressionClass1“SPACES”Figurativeconstant2.“DepreciationScheduleNon-numericliteral3.“12%”Non-numericliteral4.INTEREST-DUENon-numericliteral5.ZEROESFigurativeconstantWhichofthefollowingstatementistrue?(a)1and3areincorrect(b)1and4areincorrect(c)3and4areincorrect(d)Allarecorrect28.Identifytheinvaliddatanamefromthefollowing:(a)SAVINGS-ACCOUNT(b)ANNUAL-ALLOCATION-FOR-OVERHEAD(c)SAMOUNT250(d)12DEMAND29.StudytheDATADIVISIONentriesandthethreePROCEDUREDIVISIONentriesgivenbelow:01END-OF-FILE-SWITCHPICXXX.88NO-MORE-RECSVALUE“YES”.88MORE-RECSVALUE“NO”.(i)READSAMPLE-FILEATENDMOVE“YES”TONO-MORE-RECS.(ii)IFNO-MORE-RECS=“YES”GOTOLAST-PARA.(iii)IFNO-MORE-RECSGOTOLAST-PARA.Whicharewrong?(a)(i)and(ii)(b)(ii)and(iii)(c)(i)and(iii)(d)all30.ThefollowingentriesappearintheWORKING-STORAGESECTION:01DATE-TODAY.05YYPICXXVALUE“90”.05MMPICXXVALUE“12”.05DDPICXXVALUE:31″.01DATE-EDITPICXX/XX/XX.MOVEDATE-TODAYTODATE-EDIT.(a)901231(b)90/12/31(c)31/12/90(d)31129031.Howmanybyteswillbeallocatedforthefollowingrecorddescriptionentries?01REC-A.05APICS9(4).05BPICXXXBXXX.05CPIC____9.99.05DPICS9(5)COMP-3.05EPIC9(3)COMP.(a)29(b)26(c)25(d)2832.Whatiswrongwiththefollowingdatadeclaration?01W-DATEPICX(6).05DDPIC99.05MMPIC99.05YYPIC99.(a)Nothingiswrong.(b)UnderW-DATEalllevel05itemsarehavingaPIC99butlevel01hasPICX(6).(c)PICcan’tbespecifiedforagroupitem.(d)DD,MM,andYYareinvaliddatanames.33.Whatistheoutputgeneratedbythefollowingcode?01GRP-I.05SUBFLD1PICXXVALUE“AB”.05FILTERPICX(6)VALUESPACES.01GRP-2REDEFINEDGRP-1.05SUB-FLD2PICXX.05SUB-FLD3PICXX.05FILTERPICX(4).IFSUB-FLD1NOT=SPACESDISPLAY“SUBFLD1”MOVE“ABBCCD”TOGRP-1IFSUB-FLD3=SPACESDISPLAY“SPACES”ELSEDISPLAY“SUBFLD3”DISPLAY“END”ELSEDISPLAY“SPACES”DISPLAY“END”.(a)SUBFLD1SUBFLD3END(b)SPACESEND(c)SUBFLD1END(d)SUBFLD1SPACES34.88levelentryisusedfor(a)dataitemsinWORKING-STORAGESECTION(b)itemswithRENAMESclause(c)condition-names(d)Noneoftheabove35.ZEROESandSPACESare_______constants(a)Figurative(b)Numeric(c)Non-numeric(d)Alphabete36.COMPUTEX=A*B–C*DandCOMPUTEX=(A*B)–(C*D)(a)Arenotthesame(b)Aresame(c)Syntacticallywrong(d)Willyieldaruntimeerror37.OCCURSclauseisusedintheDATADIVISIONondatanamesat(a)01level(b)77level(c)88level(d)anylevelfrom02to4938.ConsiderthefollowingCOBOLentries:05XPIC99VALUE10.SUBTRACT20FROMX.TheresultantvalueofXwilbe(a)10(b)00(c)compile-timeerror(d)noneofthese39.ConsiderthefollowingCOBOLentries05XPIC99VALUE10.ADD40XTOX.COMPUTEX=3*X–40.TheresultinXis(a)10(b)40(c)CompileorRuntimeerror(d)noneofthese40.giventhefollowingpieceofcode:CALLSUB-PGMUSINGA,B,C.CALLSUB-PGMUSINGA,C,C.(a)BothCALLstatementswillalwaysproducesameresult.(d)BothCALLstatementsmayproducedifferentresult.(c)Compile-timeerrorbecauseSUB-PGMisadataname.(d)Compile-timeerrorbecauseA,B,Careusedtwice.41.Thehierarchyoftheexecutionoflogicaloperatorsis(a)NOTANDOR(b)ANDORNOT(c)ORANDNOT(d)ORNOTAND42.Theorderofprecedenceofarithmeticoperatorsinanexpressioncanbeoverriddenwiththeuseof(a)[](b)()(c){}(d)AnyoftheaboveConsiderthefollowingpassageforansweringquestions43to47.Aprogramiswrittentoacceptananswertothequery“enoughfotheDay?”Iftheresponsis“N”thentheprogramacceptsquantitypurchasedandrateoftheitemanddisplaystheamounttobecollected.Thentheabovequeryisagaindisplayedandtheloopcontinues.Attheendoftheday,whentheresponsetotheabovequeryis“Y”,thedaycollectionsaredisplayed.Theprogramchecksthatthequantitypurchasedisbetween25and125andtherateoftheitemisbetween10.00and75.00.Ifanyofthesetwoconditionsareviolated,theprogramdisplaysanappropriatemessageandasksfornextinput.Theamountsaredisplayedwithproperediting.Theprogramiswrittenassumingthattherecanbeamaximumof1000transactionsaday.43.Howmanyvariableswouldyoudeclarefortheaboveproblem?(a)3(b)4(c)5(d)744.WhatshouldbethePICTUREclauseofthevariableusedtocalculateendofthedaycollections?(a)9(9)v99(b)9(8)v99(c)995)v99(d)Informationgivenisinsufficienttoarriveattheanswer45.WhatshouldbethePICTUREclauseofthevariableusedtocalculatetobecollected.(a)9(9)v99(b)9(8)v99(c)9(5)v99(d)Informationgivenisinsufficienttoarriveattheanswer46.AssumingthattheaboveprogramisbeingexecutedinaDepartmentStoresinMADRASwhichofthefollowingPICTUREclausewillbesuitableforDISPLAYingtheendofthedaycollections?(a)Z(5)V99(b)Z(5).99(c)ZZ,ZZ,ZZ,ZZ9.99(d)Informationgivenisinsufficienttoarriveattheanswer47.Howmany_____statementsdoyouthinkwillbethereintheprogram?(a)3(b)4(c)5(d)Informationgivenisinsufficienttoarriveattheanswer48.WhichofthefollowingparagraphsiscompulsoryineveryCOBOLprogram?(a)SPECIAL-NAMES(b)PROGRAM-ID(c)FILE-CONTROL(d)OBJECT-COMPUTER49.WhichofthefollowingfilescanbeOPENedinallthe4modes?ThefourmodesareINPUT,I-O,OUTPUTandEXTEND.(a)INDEXED(b)RELATIVE(c)SEQUENTIAL(d)Alloftheabove50.WhichofthefollowingEDITindandPICTUREsymbolsistobeusedifaminus(-)istoappearbeforethevalueifthevalueis-veandaplus(+)istoappearbeforethevalueifthevalueis+ve?(a)+(b)–(c)+OR(d)Itisnotpossiblesolutions(NOTsurehowaccurateorcorrectlybelowareordered)1,2,3,4,5,6,7,8,9,10,1520253035b,b,c,c,c,a,d,a,b,a,c,c,b,b,b,c,b,d,a,a,c,b,d,a,d,d,b,c,d,b,a,c,a,c,a,b,d,384348a,c,b,a,b,b,b,c,c,a,b,c,aTCSAptitudetest:====================1.iftheword‘ddosszm’ischangedto‘central’thenwhatwillbethechangefor‘rtjbl’?ans:quick2.whatisthelargestprimenumberin8digitnumber?3.thewordunimpressivewasgiven.theyaskedustodochange1st&2nd,3rd&4th,soon.thentheyaskedwhatwillbe10thletterfromright?ans:m4.theplanequestionwasasked.ittookofffrom7degree53′6.1”andlandedat8degree6′43.5”.ittakes12hourstotravelbetweenthesepoints.thenwhatwillbelocaltimeatdestination?[justfollowpreviousquespapertheproblemwassame]5.g[0]=1,g[1]=-1,g[n]=2*g[n-1]-3*g[n-2]thencalculateg[4]=?6.theserieswasasked:5,6,7,8,10,11,14,..?7.theyaskedthetemperatureproblem.itwassameaspreviouspapers.theratiowas-t*t/6+4t+12.8.thequesonaman,awomanandaboyfinishworktogetherin6days.mantakes10days,womantakes24daysthenhowmuchboywilltake?ans:40days8.thematrixofa(7,9)wasgiven.theaddressofthefirstbyteofa(1,1)=1258.ittakes4bytestostorethenuymber.thencalculatetheaddressofthelastbyteofa(5,8).9.theprogramrequires4000(n)1/2[iesquarerootofn].ifsizeofprogramwasincreasedby1%thencalculatethepercentagechangeinsizeofprogram.10.modulo(373,7)+round(5.8)+truncat(7.2)-round(3.4)=?iexactlydon’trememberthetruncatefunction.butthefunctionwaswhereweskipthe‘.’part.ans:1211.thebucketsizeis10KB.ittakes0.0001KB/milisectofillbucket.thebuckettakes100or1000milisectoreachtodestination.ittakes100milisectopassacknowledgementfromdesttosource.socalculatehowmuchtimewillittaketopassNKB,writeformula.[idon’tremembertheexactfiguresofbuckettransmissiontimefromsourcetodest]12.thegraphwasgiven.thexandyaxeswerethere.thelineisintersectingthem.thepointsofintersectionwerey=3,x=0andx=-2,y=0.writetheequationofline.13.thedecimalnumberwasgiven.itwasconvertedtoothersystem.theyaskedtoidentifythesystem.i.e.octal,hexadecimal.14.theyaskedustomatchthepairs.theywerelike,ABbasmati-wheatnottypeof15.theparagraphwasgiven.itwasonassociationsandtheexampleoflecturerwasthereinpara.SECTIONI==========1.IfVXUPLVHiswrittenasSURMISE,whatisSHDVD?Ans.PEASA(hint:inthefirstword,thealphabetsofthejumbledoneisthreealphabetsafterthecorrespondingalphabetinthewordSURMISE.S=V-3,similarlyfindtheoneforSHDVD)2.IfDDMUQZMiscodedasCENTRALthenRBDJKcanbecodedas———Ans.QCEIL(hint:Writeboththejumbledandthecodedwordasatable,findtherelationbetweenthecorrespondingwords,i.eC=D-1,N=M+1&soon3.InthewordECONOMETRICS,ifthefirstandsecond,thirdandforth,forthandfifth,fifthandsixthwordsareinterchangeduptothelastletter,whatwouldbethetenthletterfromright?Ans.wordisCENOMOTEIRSCtenthwordisR4.Findtheresultofthefollowing__expressionif,Mdenotesmodulusoperation,Rdenotesround-off,Tdenotestruncation:M(373,5)+R(3.4)+T(7.7)+R(5.8)Ans.195.Whatisthelargestprimenumberthatcanbestoredinan8-bitmemory?Ans.6.Findthephysicalquantityinunitsfromtheequation:(Force*Distance)/(Velocity*Velocity)Ans.Ns2/m7.Findthevalueof@@+25-++@16,where@denotes“square”and+denotes“squareroot”.Ans:6218.Iff(0)=1andf(n)=f(n-1)*n,findthevalueoff(4).Ans:249.Convertthedecimalnumber310tothebase6.Ans:123410.Findthemissingnumberintheseries:2,5,__,19,37,75Ans:911.Inatwo-dimensionalarray,X(9,7),witheachelementoccupying4bytesofmemory,withtheaddressofthefirstelementX(1,1)is3000,findtheaddressofX(8,5).Ans.12.Findthefourthrow,havingthebitpatternasanintegerinan8-bitcomputer,andexpresstheanswerinitsdecimalvalue.A00001111B00110011C01010101(AU(B-C))?Ans.2913.Completetheseries2,7,24,77,__(hint:2*12=24,7*11=77,therefore24*10=240)Ans:24014.Considerthefollowingdiagramforansweringthefollowingquestions:A.Findthedifferencebetweenpeopleplayingcricketandtennisalone.Ans:4B.Findthepercentageofpeopleplayinghockeytothatplayingbothhockeyandcricket.Ans:C.Findthepercentageofpeopleplayingallthegamestothetotalnumberofplayers.Ans:6%15.Onemorequestionofthesametype(Sametypeofdiagram;ofcourseinadifferentset)1.HowmanymoreorlessspeakEnglishthanFrench?2.What%peoplespeakallthethreelanguages?3.What%peoplespeakGermanbutnotEnglish?{Inanothersetcricket,hockeyandtennisarechangedwiththenameofsomecomputerlanguages,suchasJava,Cobol,Fortran(maybesomeothername)}16.Selecttheoddoneouta.Oracleb.Linuxc.Ingressd.DB217.Selecttheoddoneouta.SMTPb.WAPc.SAPd.ARP18.Selecttheoddmanout.a.Javab.Lispc.Smalltalkd.Eiffel19.Whichofthefollowingareorthogonalpairs?a.3i+2jb.i+jc.2i-3jd.-7i+j20.Numberoffaces,verticesandedgesofacubea.12,8,6b.4,6,8c.6,8,12d.6,12,821.GivenaBarChartshowingthesalesofacompany.(InFigure)Thesalesinyearsasshowninthefigureare(incrores)1998-1999–130,1997-1998–90,1996-1997–90,1995-1996–701.ThehighestgrowthratewasfortheyearAns.1998-19992.Thenetincreaseinsalesofthecompanyintheyearspanof1995-1999Ans.60crores.3.ThelowestgrowthratewasfortheyearAns.199722.Findthevalueofthedecimalnumbertothebase7.Ans.1436.23.Completetheseries:5,6,7,8,10,11,14,__.Ans.1524.Ifthevertex(5,7)isplacedinthememory.Firstvertex(1,1)?addressis1245andthenaddressof(5,7)is———-Ans.25.Inwhichofthesystem,decimalnumber384isequalto1234?Ans.26.Aman,awoman,andachildcandoapieceofworkin6days.Manonlycandoitin24days.Womancandoitin16daysandinhowmanydayschildcandothesamework?Ans.27.InMadras,temperatureatnoonvariesaccordingto-t^2/2+8t+3,wheretiselapsedtime.Findhowmuchtemperaturemoreorlessin4pmto9pm.Ans.28.ThesizeofthebucketisNkb.Thebucketfillsattherateof0.1kbpermillisecond.Aprogrammersendsaprogramtoreceiver.Thereitwaitsfor10milliseconds.Andresponsewillbebacktoprogrammerin20milliseconds.Howmuchtimetheprogramtakestogetaresponsebacktotheprogrammer,afteritissent?Ans.29.ThesizeofaprogramisN.AndthememoryoccupiedbytheprogramisgivenbyM=squarerootof100N.Ifthesizeoftheprogramisincreasedby1%thenhowmuchmemorynowoccupied?Ans.30.Apowerunitistherebythebankoftheriverof750meterswidth.Acableismadefrompowerunittopoweraplantoppositetothatoftheriverand1500mtsawayfromthepowerunit.ThecostofthecablebelowwaterisRs.15/-permeterandcostofcableonthebankisRs.12/-permeter.Findthetotaloflayingthecable.Ans.Rs.22,500(hint:theplantisontheothersideoftheplanti.e.itisnotonthesamesideastheriver){Therearetwoquestions,bothshowingacurve.Inthefirstone,youhavetoidentifythecurve.InthesecondoneyouhavetoWritetheequationofthecurve.In}SECTIONII===========1.IfAcancopy50pagesin10hoursandAandBtogethercancopy70pagesin10hours,howmuchtimedoesBtakestocopy26pages?a.b.c.d.2.Matchthefollowing:1.Male–Boy—>a.Atypeof2.Square–Polygon—>b.Apartof3.Roof–Building—>c.Notatypeof4.Mushroom–Vegetables—>d.AsupersetofAns:1-d,2-a,3-b,4-c3.Matchthefollowing.1.brother�sister—>a.Partof2.Alsatian�dog—>b.Sibling3.sentence�paragraph—>c.Typeof4.car–steering—>d.NotatypeofAns.1-b,2-c,3-a,4-dQuestions20-24arebasedonthefollowingpassage:TheofficestaffoftheXYZcorporationpresentlyconsistsofthreebookkeepers(A,BandC)andfivesecretaries(D,E,F,GandH).Managementisplanningtoopenanewofficeinanothercityusingthreesecretariesandtwobookkeepersofthecurrentstaff.Todosotheyplantoseparatecertainindividualswhodonotfunctionwelltogether.Thefollowingguidelineswereestablishedtosetupthenewoffice:I.BookkeepersAandCareconstantlyfindingfaultwithoneanotherandshouldnotbesentasateamtothenewoffice.II.CandEfunctionwellalonebutnotasateam.Theyshouldbeseparated.III.DandGhavenotbeenonspeakingtermsformanymonths.Theyshouldnotgotogether.IV.SinceDandFhavebeencompetingforpromotion,theyshouldnotbeateam.Ans.4.IfAistobemovedasoneofthebookkeepers,whichofthefollowingcannotbeapossibleworkingteam?(a)ABDEH(b)ABDGH(c)ABEFH(d)ABEGH(e)ABFGH5.IfCandFaremovedtothenewoffice,howmanycombinationsarepossible?(a)1(b)2(c)3(d)4(e)56.IfCissenttothenewoffice,whichmemberofthestaffcannotgowithC?(a)B(b)D(c)F(d)G(e)H7.Undertheguidelinesdeveloped,whichofthefollowingmustgotothenewoffice?(a)B(b)D(c)E(d)G(e)H8.IfDgoestothenewofficewhichofthefollowingis(are)true?I.Ccannotgo.II.Acannotgo.III.Hmustalsogo.a.Ionly.b.IIonly.c.IandIIonly.d.IandIIIonly.e.I,IIandIII.9.TwostationsA&Bare110kmapart.OnetrainstartsfromAat7am,andtravelstowardsBat20kmph.AnothertrainstartsfromBat8amandtravelstowardsAat25kmph.Atwhattimewilltheymeet?a.9amb.10amc.11amd.10.30am10.Ifamancanswimdownstreamat6kmphandupstreamat2kmph,hisspeedinstillwateris:a.4kmphb.2kmphc.3kmphd.2.5kmphAnswerthefollowingthreequestionsbasedontheparagraph:Astudentapplyingatacollegeshouldtakethreecourses.Therearealtogetherfourcourses,namely,Science,Maths,SocialSudiesandEconomics.(Thenamesmayvary,butthepatternisthesame)OnecantakeaSciencecourseontyifhehastakenaMathscourse.OnecantakeaMathscourseonlyifhehastakenaSciencecourse.OnecantakeanEconomicscourseonlyifhehastakenaSocialStudiescourse.11.Whichofthefollowingisapossiblecourse?a.TwoSciencecoursesandaSocialStudiesCourse.b.TwoMathscoursesandanEconomicscourse.c.OneMatscourse,oneSciencecourseandaSocialStudiescourse.d.OneMathscourse,oneSciencecourseandanEconomicscourse.12.Whichofthefollowingcoursesastudentcantake?I.OneScience,oneSocialStudies,oneEconomicsII.TwoScience,oneSocialStudiesIII.TwoScience,oneMaths.a.Ionlyb.IIIonlyc.IandIIonlyd.IIandIIIonly13.Whichofthefollowingisnotapossiblecourse?a.TwoSciencecoursesandaMathscourse.b.TwoMathscourseandaSciencecourse.c.OneMathscourse,oneSciencecourseandaSocialStudiesCourse.d.OneMathscourse,oneSciencecourseandanEconomicscourse.Synonyms(youmaywanttocheckcorrectdefinition,incaseofdoubtat=========Pillage:steal,loot,plunderCleft–split,crackIncesment:Brazen–bold,shamelessAwry–skewed,twisted,crookedRemiss:careless,negligentDefection–desertionEnsue–followAvid–keen,eagerRupidiateRepudiate–reject,denyGauche–clumsy,vulgarIntrinsic–essentialGaudy:flashy,showyHidebound:narrowmindedIncognitent–Intermittent:irregular,brokenClastrophobia–fearContraband:illegaltradePagmconcealedraptVoracious:avid,hunger,greedySeedy:sleazy,seamyOmniscience:knowingallDiatribe:attack,criticismSlack–loose,relaxedFelicitous:fortunate,luckRelish:enjoy,savorAloofness:unfriendliness,remotenessAmbiguity–unknownPattryBaleful:threatening,malevolentOdium:hatred,disgustLapidarianGambol–skipHighhanded:dominant,imperiousRetrospection–perceptionAntithePaganGenuflect:kneel,bowcoerce:force,compelIndubitably:undoubtedly,certainlyExtraneous:irrelevant,unrelatedCorpulent:fat,pumpTransient:momentarySpurious:false,fakeWhimsical–fancyBraggadocio–ChimericalCallow:inexperience,naiveMenial:unskilled,boringIndigenous:native,originalAmbiguityFoil:frustrate,haltPillage:steal,loot,plunderCleft–split,crackIncesment:Brazen–bold,shamelessAwry–skewed,twisted,crookedRemiss:careless,negligentDefection–desertionEnsue–followAvid–keen,eagerRupidiateRepudiate–reject,denyGauche–clumsy,vulgarIntrinsic–essentialGaudy:flashy,showyHidebound:narrowmindedIncognitent–Intermittent:irregular,brokenClastrophobia–fearContraband:illegaltradePagmVoracious:avid,hunger,greedySeedy:sleazy,seamyOmniscience:knowingallDiatribe:attack,criticismSlack–loose,relaxedFelicitous:fortunate,luckRelish:enjoy,savorAloofness:unfriendliness,remotenessAmbiguity:unknownPattryBaleful:threatening,malevolentOdium:hatred,disgustLapidarianGambol–skipHighhanded:dominant,imperiousRetrospection–perceptionAntithePaganGenuflect:kneel,bowcoerce:force,compelIndubitably:undoubtedly,certainlyExtraneous:irrelevant,unrelatedCorpulent:fat,pumpTransient:momentarySpurious:false,fakeWhimsical–fancyBraggadocio–ChimericalCallow:inexperience,naiveMenial:unskilled,boringIndigenous:native,originalAmbiguityFoil:frustrate,haltPSGTech07.06.2004–SomeVerbal==================================(Analyticalswerefrom13theditionBarron?GREGuide,mainlyfromthe5modeltestpapersatthelast.Therewerenoalterationsinthequestionsorthechoicesandwassimplyreplicatedfromthebook.Buttherewereonly4questionsundereachannalsproblemintheTCStest:thereare5inbook.Which4ofthese5willappearisnotpredictable).Someofthesewordsarenotcorrectlyspelt!Synonym==========1.Insimate2.Banal3.misdemeanour4.bombastic5.tenacious6.repellent7.ensue8.reprobate9.acerbity10.gambol11.ameliorate12.confiscate13.quixotic14.foray15.fidelity16.inimical17.stoic18.haggard19.cacophony20.discord21.fledgling22.incongruous23.ingenious24.estrange25.clandestineAntonym=========1.loutish2.prevaricate3.Hilary4.admonition5.boonish6.dangle7.spur8.apex9.aplomb10.veracious11.clich:12.muggy13.bouillon14.incocus15.proximity16.indement17.whimsical18.distal19.transient20.predominant21.mockish22.misanthrope23.miscanprehencia24.doltish25.mullet26.gadfly27.ignominious28.hidebound29.reticence30.tantamount31.estrangeTCSCPAPER-2003==================1.fn(intn,intp,intr){staticinta=p;switch(n);{case4:a+=a*r;case3:a+=a*r;case2:a+=a*r;case1:a+=a*r;}}Theaboueprogrammecalculatesa.Compoundinterestfor1to4yearsb.AmountofCompoundinterestfor4yearsc.Simpleinterestfor1yeard.Simpleinterestfor4year2.inta[50],*pa;pa=&a[0];Inordertoaccess5thelement,findtheincorrectonea.pa[5]b.a[5]c.*(*(pa+5))d.*(a+5)3.RegardingthevariablesselectincorrectoneAns.Autovariablesselectincorrectone4.Writeonestequivalenttothefollowingtwox+sqrt(a);return(x);Chooseoneofthealternativesa.printf(“%d”,sqrt(a));b.return(sqrt(a));c.printf(“sqrt(a)”);b.return(a*a*a);5.Whichofthefollowingisnotaninfiniteloopa.while(i){….}b.do{……}while(i);c.for(ii)d.#defineTRUE0while(TRUE){….};6.Whatdoesthefollowingfunctionprint?func(inti){if(i%2)return0;elsereturn1;}main(){inti=3;i=func(i);i=func(i);printf(“%d”,i);}a.2b.3c.1d.07.to10.thbit:Chooseoneofthealternativesforthefollowinga.floatb.intc.chard.string7.’9′8.”1e02″9.10e0310.1511.Considerthefollowingstructurestrucnum_name{intno;charname[25];}strucnum_namen1[]={{12,”find”},{15,”matrix”},{8,”pick”}};printf(“%d%d”,n1[2],no,(*(n1+2)),no+1);Whatdoestheabovest.do?a.8,9b.8,8c.9,9d.8,unpredictablevalue12.for(i=0;i!=10;i+=2)printf(“…..”);Howmanytimewillitexecute?a.10b.0c.5d.notevenonce13.20bytesareallocatedtoastringss=”ENIRANCB”l=strlen(s);theni=?a.20b.22c.21d.814.y=5;if(x==10)elseif(x==9)elsey=3;theny=?a.8b.7c.5d.015.Whichisincorrect?a.a+=b;b.a*=b;c.a>=b;d.a**=b;16.operatorfora.notavailableb.**c.^d.%17.cond1?cond2?cond3?:exp2:exp2:exp3:exp4theequvalentsetofstatementstotheaboveisa.b.c.d.18.valuuestoredinavariableoftypedoubleisa.canbelessathanintorfloatorlongb.always>intc.always<longd.always>float19.Thetreare100functionsandfirst50areinfile1.candrestinfile2.cthentheymustbedeclaredinfile1.casa.autob.globalc.staticd.external20.structout{structin{charc;intd;}s1,*p1;}a1,*pa1;pa1=&a1;a1.p1=&s1;Whichisincorrect?a.a1.p1->cb.pa1->p1->cc.a1->p1d.a1.s1.c21.ifa=zthenvaluea2X=4:=>X=2.approxThereforethefuelconsumedwhilecoming=2gallon4.Lowtemperatureatthenightinacityis1/3morethan1/2highashighertemperatureinaday.Sumofthelowtemperatureandhighesttemp.is100degrees.Thenwhatisthelowtemp?Sol:40deg.5.Aperson,whodecidedtogotoweekendtripshouldnotexceed8hoursdrivinginaday.Averagespeedofforwardjourneyis40m/h.DuetotrafficinSundays,thereturnjourneyaveragespeedis30m/h.Howfarhecanselectapicnicspot?a)120milesb)Between120and140milesc)160milesAnswer:120miles6.Asalespersonmultipliedanumberandgottheanswer3,insteadofthatnumberdividedby3.Whatistheanswerheactuallyhastoget?Sol:(1/3)*1*3=3,sonumber=1Dividedby3Answer:1/3.7.AshipstartedfromportandmovingwithImilesperhourandanothershipstartedfromLandmovingwithHmilesperhour.Atwhichplacethesetwoshipsmeet?|—-|—-|—-|—-|—-|—-|portGHIJKLSol:AnswerisbetweenIandJandclosetoJor(L*I*H)/(H+I)8.AbuildingwithheightDshadowuptoG.AneighborbuildingwithwhatheightshadowsCfeet.|—-|—-|—-|—-|—-|—-|—-|ABCDEFGHSol:BFt.orCD/G9.Apersonwasfinedforexceedingthespeedlimitby10mph.Anotherpersonwasalsofinedforexceedingthesamespeedlimitbytwicethesame.Ifthesecondpersonwastravelingataspeedof35mph,findthespeedlimit.Sol:Let?:bethespeedlimitPerson?:wasfinedforexceedingthespeedlimitby=10mphPerson?:wasfinedforexceedingthespeedlimitby=twiceof?:=2*10mph=20mphgiventhatthesecondpersonwastravelingatthespeedof35mph=>35mph:20mph=15mphThereforethespeedlimitis=15mph10.Abusstartedfrombusstandat8.00am,andafter30minutesstayingatdestination,itreturnedbacktothebusstand.Thedestinationis27milesfromthebusstand.Thespeedofthebusis18mph.Inreturnjourneybustravelswith50%fastspeed.Atwhattimeitreturnstothebusstand?Sol:11.00am11.Inamixture,Ris2partsSis1part.InordertomakeSto25%ofthemixture,howmuchristobeadded?Sol:OnePart12.Windflows160milesin330min,for80mileshowmuchtimerequired.Sol:13.With4/5fulltankvehicletravels12miles,with1/3fulltankhowmuchdistancetravelsSol:(5miles)14.Twotreesarethere.Onegrowsat3/5oftheotherin4years,totalgrowthoftreesis8ft.whatgrowthwillsmallertreewillhavein2yearsSol:(<2ft.)15.Astormwillmovewithavelocityoftowardsthecenterinhours,atthesameratehowmuchfarwillitmoveinhrs.Sol:(buttheansweris8/3or22/3)1.Inatwo-dimensionalarray,X(9,7),witheachelementoccupying4bytesofmemory,withtheaddressofthefirstelementX(1,1)is3000;findtheaddressofX(8,5).Ans:32122.InthewordORGANISATIONAL,ifthefirstandsecond,thirdandforth,forthandfifth,fifthandsixthwordsareinterchangeduptothelastletter,whatwouldbethetenthletterfromright?Ans:I3.Whatisthelargestprimenumberthatcanbestoredinan8-bitmemory?Ans:2514.Selecttheoddoneout:..a.Javab.Lispc.Smalltalkd.Eiffel.5.Selecttheoddoneouta.SMTPb.WAPc.SAPd.ARP6.Selecttheoddoneouta.Oracleb.Linuxc.Ingressd.DB27.Selecttheoddoneouta.WAPb.HTTPc.BAANd.ARP8.Selecttheoddoneouta.LINUXb.UNIXc.SOLARISd.SQLSEVER9.Selecttheoddoneouta.SQLb.DB2c.SYBASEd.HTTP10.ThesizeofaprogramisN.AndthememoryoccupiedbytheprogramisgivenbyM=squarerootof100N.Ifthesizeoftheprogramisincreasedby1%thenhowmuchmemorynowoccupied?Ans:0.5%(SQRT101N)11.Aman,awoman,andachildcandoapieceofworkin6days.Manonlycandoitin24days.Womancandoitin16daysandinhowmanydayschildcandothesamework?Ans:1612.Inwhichofthesystem,decimalnumber184isequalto1234?Ans:513.Findthevalueofthe678tothebase-7.Ans:165614.Numberoffaces,verticesandedgesofacubeAns:681215.Completetheseries2,7,24,77,__Ans:23816.Findthevalueof@@+25-++@16,where@denotes”square”and+denotes“squareroot”.Ans:62117.Findtheresultofthefollowingexpressionif,Mdenotesmodulusoperation,Rdenotesround-off,Tdenotestruncation:M(373,5)+R(3.4)+T(7.7)+R(5.8)Ans:1918.IfTAFJHHiscodedasRBEKGIthenRBDJKcanbecodedas?Ans:qcckj19.G(0)=-1,G(1)=1,G(N)=G(N-1)–G(N-2),G(5)=?Ans:–220.Whatisthemaxpossible3digitprimenumber?Ans:99721.Apowerunitistherebythebankoftheriverof750meterswidth.Acableismadefrompowerunittopowerplantoppositetothatoftheriverand1500mtsawayfromthepowerunit.ThecostofthecablebelowwaterisRs.15/-permeterandcostofcableonthebankisRs.12/-permeter.Findthetotaloflayingthecable.Ans:1000(24725-cost)22.ThesizeofaprogramisN.AndthememoryoccupiedbytheprogramisgivenbyM=squarerootof100N.Ifthesizeoftheprogramisincreasedby1%thenhowmuchmemorynowoccupied?Ans:0.5%(SQRT101N)23.InMadras,temperatureatnoonvariesaccordingto-t^2/2+8t+3,wheretiselapsedtime.Findhowmuchtemperaturemoreorlessin4pmto9pm.Ans:At9pm7.5more24.ThesizeofthebucketisNkb.Thebucketfillsattherateof0.1kbpermillisecond.Aprogrammersendsaprogramtoreceiver.Thereitwaitsfor10milliseconds.Andresponsewillbebacktoprogrammerin20milliseconds.Howmuchtimetheprogramtakestogetaresponsebacktotheprogrammer,afteritissent?Ans:3025.Aman,awoman,andachildcandoapieceofworkin6days.Manonlycandoitin24days.Womancandoitin16daysandinhowmanydayschildcandothesamework?Ans:1626.Ifthevertex(5,7)isplacedinthememory.Firstvertex(1,1)`saddressis1245andthenaddressof(5,7)is———-Ans:127927.Whichofthefollowingareorthogonalpairs?a.3i+2jb.i+jc.2i-3jd.-7i+jAns:a,c28.IfVXUPLVHiswrittenasSURMISE,whatisSHDVD?Ans:PEASE29.IfA,BandCarethemechanismsusedseparatelytoreducethewastageoffuelby30%,20%and10%.Whatwillbethefueleconomyiftheywereusedcombined.Ans:20%30.Whatisthepowerof2?a.2068b.2048c.266831.Completetheseries.3,8,–,24,–,48,63.Ans:15.3532.Completetheseries.4,-5,11,-14,22,—Ans:-2733.A,BandCare8bitno’s.Theyareasfollows:A->11011011B->01111010C->01101101Find((A-B)uC)=?Hint:109:.A-Bis{A}–{AnB}34.AFlighttakesoffat2A.Mfromnortheastdirectionandtravelsfor11hourstoreachthedestination,whichisinnorthwestdirection.Giventhelatitudeandlongitudeofsourceanddestination.Findthelocaltimeofdestinationwhentheflightreachesthere?Ans:7am35.Acancopy50papersin10hourswhilebothA&Bcancopy70papersin10hours.ThenforhowmanyhoursrequiredforBtocopy26papers?Ans:1336.AistwiceefficientthanB.AandBcanbothworktogethertocompleteaworkin7days.Thenfindinhowmanydays,Aalonecancompletethework?Ans:10.537.Afinishtheworkin10days.Bis60%efficientthanA.SohowmanydaysdoBtakestofinishthework?Ans:100/638.Afinishestheworkin10days&Bin8daysindividually.IfAworksforonly6daysthenhowmanydaysshouldBworktocompleteA’swork?Ans:3.2days39.Giventhelengthofthe3sidesofatriangle.Findtheonethatisimpossible?(HINT:sumofsmaller2sidesisgreaterthantheotherone,whichislarger)40.Findthesingularitymatrixfromagivensetofmatrices?(Hintdet(A)==0))41.A2DarrayisdeclaredasA[9,7]andeachelementrequires2byte.IfA[1,1]isstoredin3000.FindthememoryofA[8,5]?Ans:310642.Sumofslopesof2perpendicularst.linesisgiven.Findthepairoflinesfromthegivensetofoptions,whichsatisfytheabovecondition?43.(a)2+3i(b)1+i(c)3-2i(d)1-7i.Findwhichoftheaboveisorthogonal.Ans:a,c44.(Momentum*Velocity)/(Acceleration*distance).Findunits.Ans:mass45.Thenumber362indecimalsystemisgivenby(1362)xintheXSystemofnumbersfindthevalueofXa}5b)6c)7d)8e)946.Given$meansTriplingand%meanschangeofsignthenfindthevalueof$%$6-%$%647.Myflighttakesofat2amfromaplaceat18N10Eandlanded10Hrslaterataplacewithcoordinates36N70W.Whatisthelocaltimewhenmyplanelanded?6:00amb)6:40amc)7:40d)7:00e)8:00(Hint:Every1deglongitudeisequalto4minutes.Ifwesttoeastaddtimeelsesubtracttime)48.Findthehighestprimenumberthatcanbestoredinan8bitComputer?49.WhichofthefollowingsetofnumbershasthehighestStandarddeviation?a)1,0,1,0,1,0b)-1,-1,-1,-1,-1,-1c)1,1,1,1,1,1d)1,1,0,-1,0,-1TCSTipstofaceInterview..(IT)questionsareasfollows..note:important..theirstrategyisstressinterview..theydelibratelyhumiliateyou..askdisintrestingquestionstoputyouunderpressure..iamnotexaggerating..itstrue…BEAWARE,YOUAREWARNED!!!============================pleasebepreparedtofacequestionsfromanysubjectthatisthereinyourcurriculm..evenaccountancyandothersubjectsthatarethereinyourcurriculm..speciallytcspeoplewillaskyouyourareaofintrest..thentheystartaskingquestionsfromsubjects..otherthantheoneyoumentionedasyourareaofintrest..theirargumentisthatyoushouldbeabletoansweranythingfromyourfirstyearfirstsemtolastyearlastsem..hereisalistofcomputerscienceandhrrelatedquestionstheyaskfrequently..whatisacursortypesofcursorsnormalizationnormalformswhisisthebestnormalformwhatisanoswhatexactlyosconsistsofwhatistheshelluworkedoncommandsinunixwhatisxmlanddhtmlTellabouturselffamilybackgroundweaknessandstrengthswheredoustandintheclasssdlccasetoolsumlimportanceofaccountsinurcurriculmbalancesheetentriessharesisshareanassetfunctionoverloadingvirtualfunctionsexplainipaddresstoolsofanetworkexplaingatewayshubsandswitchesTechTalk============whatisoswhatitdoeswhatisdbmssimilaritybetweendbmsandosdifferentiatebetweencndc++useof::(scoperesolutionoperator)whatkindofprojectsaresuitableforcandc++whatisaclass?examplewhathaveudonetoimproveurknowledgeoutsidethecurriculamsdlcandstagesquestionsonprojectsuhavedonewhatistestingtypesoftestingfuntionalpointmodeltypesoftesting================differencebetweenblackboxandwhiteboxwhatisqualityandvariousqualitycertificationswhatisspirallifecyclemodelcohesionandcouplingvirtualmemoryconceptwhatisapagefaultwhatisfragmentaionkindsofoscpushedulingalgorithimsmultitaskingvsmultiprogrammingnormalizationcanwecreateatableinoraclewhichisnotinfirstnormalformdifferencebetweendbmsandrdbmssqlquerieswhydoweneedtestingtypesofindexingAGES=========1)Lastyearpanditwasthricehissister’sage.Nextyearheisonlytwiceherage.After5yearswhatispandit’sage.a)2b)12c)11d)14ans:b2)Jaliaistwiceolderthanqurban.Ifjaliawas4yearsyounger,qurbanwas3yearsoldertherdiff.betweentheiragesis12yearswhatisthesumofthieragesa)67b)57c)36d)noneans:b3)Fathersageis5timeshisson’sage.4yearsbackthefatherwas9timesolderthanson.Findthefathers’presentage.Ans.40years4)Joe’sfatherwillbetwicehisage6yearsfromnow.Hismotherwastwicehisage2yearsbefore.IfJoewillbe24twoyearsfromnow,whatisthedifferencebetweenhisfather’sandmother’sage?a)4b)6c)8d)10ALLIGATION===========1).Inamixture,Ris2parts,Sis1part.InaodertomakeSto25%ofthemixture,howmuchRistobeadded?AVERAGE1)gavaskaraverageinfirst50inningswas50.afterthe51stinningshisaveragewas51howmanyrunshemadeinthe51stinnings2)HansiemadethefollowingamountsinsevengamesofcricketinIndia:Rs.10,Rs.15,Rs.21,Rs.12,Rs.18,Rs.19andRs.17(allfiguresincroresofcourse).Findhisaverageearnings.Ans.Rs.16crore3)Averageof5numberis-10sumof3numbersis16,whatistheaverageofothertwonumbers?answer-334)THREECOMPANIESWORKINGINDEPENDENTLYANDGETSAVINGS10%,20%,25%.IFTHECOMPANIESWORKJUSTOPPOSITETHENWHATWILLBETHENETSAVING?5)IfA,BandCarethemechanismsusedseparatelytoreducethewastageoffuelby30%,20%and10%.Whatwillbethefueleconomyiftheywereusedcombined.Ans20%BOATS========1)Ifamancanswimdownstreamat6kmphandupstreamat2kmph,hisspeedinstillwateris:a.4kmphb.2kmphc.3kmphd.2.5kmphCAR=====1)Acarisfilledwithfourandhalfgallonsofoilforfullroundtrip.Fuelistaken1/4gallonmoreingoingthancoming.Whatisthefuelconsumedincomingup?SolBeforethetrip,carisfilledwith=4:gallonofoilLet?:bethequantityoffuelconsumedforthetripinonedirectionThefuelconsumedwhilegoing=X+:Thefuelconsumedwhilecoming=XTherefore,thefuelconsumedforthetrip=(X++X=4::2X+:=4:=>2X=4:–:=>2X=4:=>X=2gallonsapproxCHAINRULE============1)Acancopy50papersin10hourswhilebothA&Bcancopy70papersin10hours.ThenforhowmanyhoursrequiredforBtocopy26papers?13CHESSBOARD============1)in8*8chessboardwhatisthetotalnumberofsquaresreferodelans:204CODING=======1)THEREISAWORD‘PERLMENTASITION’..IF1STAND2ND,3RD&4THWORDSARECHANGEDANDSOON,THENFINDTHE14THLETTERFROMRIGHTAFTERCHANGE.2)IfTAFJHHiscodedasRBEKGIthenRBDJKcanbecodedas———ansqcckj3)aseriesoflettersaregivenhowmanyWsrfollowedbyFandprecededbyT.12.SURFWCodeistranslatedasSHEET:..thesekindaquesrthere:..4)CodeInterchanging,Awordisgiven:.Lettersarereversed..uraskedtofindthenthletterfromrightorleft:.Eg.DESTABILIZATIONAns-T5)BFGECODEDASCEHDTHENCODEPVHDJANS:QUICK6)FINDTHENO.OFYFOLLOWEDBYWBUTTHATISNOTFOLLOWEDBYZ.YWRUDDYWZ……………7)IfVXUPLVHiswrittenasSURMISE,whatisSHDVD?Ans.PEASA(hint:inthefirstword,thealphabetsofthejumbledoneisthreealphabetsafterthecorrespondingalphabetinthewordSURMISE.S=V-3,similarlyfindtheoneforSHDVD)8)IfDDMUQZMiscodedasCENTRALthenRBDJKcanbecodedas—–Ans.QCEIL(hint:Writeboththejumbledandthecodedwordasatable,findtherelationbetweenthecorrespondingwords,i.eC=D-1,N=M+1&soon9)InthewordECONOMETRICS,ifthefirstandsecond,thirdandforth,forthandfifth,fifthandsixthwordsareinterchangeduptothelastletter,whatwouldbethetenthletterfromright?Ans.wordisCENOMOTEIRSCtenthwordisR10)IfD_MUQZMiscodedasCENTRALthenRBDJKcanbecodedas11)InacertainformatTUBUJPOiscodedasSTATION.ThecodeofwhichstringisFILTER?12)WhatisthecodeformedbyreversingtheFirstandsecondletters,thethirdandfourthlettersandsononofthestringSIMULTANEOUSLY?13)InthewordORGANISATIONAL,ifthefirstandsecond,thirdandforth,forthandfifth,fifthandsixthwordsareinterchangeduptothelastletter,whatwouldbethetenthletterfromright?ANS:I(ROANISATIONALG)COST======1)Apowerunitistherebythebankoftheriverof750meterswidth.Acableismadefrompowerunittopoweraplantoppositetothatoftheriverand1500mtsawayfromthepowerunit.ThecostofthecablebelowwaterisRs.15/-permeterandcostofcableonthebankisRs.12/-permeter.Findthetotaloflayingthecable.Ans1000(24725–cost)20250Ans.Rs.22,500(hint:theplantisontheothersideoftheplanti.e.itisnotonthesamesideastheriver)2)Thecostofonepencil,twopensandfourerasersisRs.22whilethecostoffivepencils,fourpensandtwoerasersisRs.32.Howmuchwillthreepencils,threepensandthreeeraserscost?Ans.273)2oranges,3bananasand4applescostRs.15.3ornages2bananas1applecostsRs10.whatisthecostof3oranges,3bananasand3applesANsRs15.4)AshopkeeperboughtawatchforRs.400andsolditforRs.500.Whatishisprofitpercentage?Ans.25%5)Whatpercentof60is12?Ans.20%6)Threemengoestoahoteltostay,theclerksays$30perroom/daysoallthethreeplanstostayinoneroomsoeachpays$10.Aftersometimetheclerkrealisesthathemadeamistakeofcollecting$30buttheroomcostonly$25,thereforehedecidestoreturn$5tothemsohecallstheroomboyandgiveshim$5askinghimtoreturn.Theroomboykeeps$2withhimandhereturnsonly$3($1foreach).NowTotallyallhavepaid$9each($27)+rommboy$2whichisequalto$27.wheredid$1go,whohasmadethemistake?7)twopencilscost8cents.then5pencilscost?(20cents)8)Aboxof150packetsconsistsof1kgpacketsand2kgpackets.Totalweightofboxis264kg.Howmany2kgpacketsaretherea)96b)67c)100d)114ans:d9)Whichismoreeconomicalofthefollowinga)2kg—30/-b)8kg—160/-c)5kg—80/-10)Satishearns240weekly.12…CSCIndiaInterviewSomeofthequestionsof2006paperconductedathyd1.C#isanativelanguageof:A.JavaB..NetC.VisualBasic2.WhatisIMPinObjectiveCA.ImplementationpointerB.ImportantPointerC.IntendedPointer3.ThewidthinbitsofdoubleprimitivetypeinJavais–.Selecttheonecorrectanswer.1.Thewidthofdoubleisplatformdependent2.643.1284.85.44.Whatwouldhappenwhenthefollowingiscompiledandexecuted.Selecttheonecorrectanswer.1.2.classexample{3.intx;4.inty;5.Stringname;6.publicstaticvoidmain(Stringargs[]){7.examplepnt=newexample();8.System.out.println(“pntis”+pnt.name+9.””+pnt.x+””+pnt.y);10.}11.}12.1.Theprogramdoesnotcompilebecausex,yandnamearenotinitialized.2.Theprogramthrowsaruntimeexceptionasx,y,andnameareusedbeforeinitialization.3.Theprogramprintspntis00.4.Theprogramprintspntisnull00.5.TheprogramprintspntisNULLfalse5.Whichoftheselineswillcompile?Selectallcorrectanswers.1.shorts=20;2.byteb=128;3.charc=32;4.doubled=1.4;;5.floatf=1.4;6.bytee=0;6.Whatiscontainedinthedirectory/proc?:a.Systeminformationb.Administrativeproceduresc.Bootproceduresd.Documentationonyoursytem7.Transactionsperrollbacksegmentisderivedfrom[DBA]a.Db_Block_Bufferb.Processes,c.Shared_Pool_Size,d.Noneoftheabove8.Thesefollowingparametersareoptionalininit.oraparameterfileDB_BLOCK_SIZE,PROCESSESaTrue,bFalseAns:FalseVerizonPlacementPaperandPattern(2005)SectionI–UnixProgramming1)worksasacommandinterpretorA)HardwareB)KernalC)ShellD)CPU2)ThemajornoforafloppydiskdeviceisA)1B)3C)2D)43)chownA)ChangesthemodeofoperationtokernelmodeB)CreatesathreadC)Changestheusersand/orgroupownershipofeachgivenfileD)Createsachildprocess4)liloA)UninstallsthebootloaderB)InstallsthebootloaderC)IsaloginutilityD)Invokesadaemontologoff5)netdeviceA)ProvideslowlevelaccesstoLinuxnetworkdevicesB)ProvideslowlevelaccesstoLinuxstoragedevicesC)ProvidesaninterfacetocommunicatewithgraphicdevicesD)Noneoftheotheroptionlistedforthisquestion6)Theprocesswhichterminatesbeforetheparentprocessexits,iscalledasA)ZombieB)OrphanC)ChildD)Noneoftheotheroptionlistedforthisquestion7)ContextswitchmeansA)Kernelswitchesfromexecutingoneprocesstoanother.B)Processswitchesfromkernelmodetousermode.C)Processswitchesfromusermodetokernelmode.D)Noneoftheotheroptionlistedforthisquestion8)Thefollowingsocketprovidestwoway,sequenced,reliableandunduplicatedflowofdatawithnorecordboundaries.A)SequentialpacketsocketB)DatagramsocketC)StreamsocketD)Rawsocket9)Identifythepoint(s)thatisnottruew.r.t.signalsA)SignalsaresoftwaregeneratedinterruptsthataresenttoaprocesswhenaneventhappensB)Signaldeliveryisanalogoustohardwareinterruptsinthatasignalcanbeblockedfrombeingdeliveredinthefuture.C)Mostsignalsaresynchronousbynature.D)Mostsignalcauseterminationofthereceivingprocessifnoactionistakenbytheprocessinresponsetothesignal.10)Identifythepoint(s)thatistruewrtSemaphoreA)Onlyoneprocessatatimecanupdateasemaphore.B)AlltheotheroptionslistedforthisquestionC)Theyareoftenusedtomonitorandcontroltheavailabilityofsystemresourcessuchassharedmemorysegments.D)Isaprocesswithexclusiveuseofasemaphoreterminatesabnormallyandfailstoundotheoperationorfreethesemaphore,thesemaphorestayslockedinthestatetheprocessleftit.RDBMS1)WhenasingleentityisrelatedtoitselfthentherelationshipistermedasA)ONE-TO-ONEB)ONE-TO-MANYC)RECURSIVED)MANY-TO-MANY2)meansallowingobjectsofdifferenttypestobeconsideredasexamplesofhigherlevelsetA)AGGREGATIONB)SPECIALIZATIONC)GENERALIZATIOND)DECOMPOSITION3)TheprimarycharacteristicofakeyfieldasthatitmustbeA)ANAMEB)TEXTC)UNIQUED)ALLOFTHEOTHEROPTIONLISTEDFORTHISQUESTION4)Whatkindofrelationshipexistbetweencustomersandsalespersonsifeachcustomermayhaveoneormoresalespersons,andeachsalespersonmayhaveoneormorecustomers?A)one-to-oneB)onetomanyC)manytomanyD)manytoone5)ThefollowingisavalidSEToperation.A)JoinB)InsertC)SelectD)Difference6)meansallowingobjectsofdifferenttypestobeconsideredasexampleofahigherlevelset.A)AggregationB)SpecializationC)GeneralizationD)Decomposition7)ArelationRissaidtobeinthe,ifitisinBCNFandtherearenon-trivialmultivalueddependencies.A)1stNFB)2ndNFC)3rdNFD)4thNF8)Aoccurswhenaweakentitydoesnothaveacandidatekeyanditsinstancesareindistinguishablewithoutarelationshipwithanotherentity.A)ExistencedependencyB)IdentifierdependencyC)ReferentialdependencyD)Noneoftheotheroptionlistedforthisquestion9)is/aresample(s)ofdatamodel.A)RelationalB)RationalC)Entity-relationshipD)Noneoftheotheroptionlistedforthisquestion10)Inhierarchicaldatabase,A)ThereisonetomanyrelationshipB)AchildmayhavemorethanoneparentC)AparentmayhavemorethanonechildD)Thereisnorestrictiononthenumberofparentsachildmayhaveorthenumberofchildrenaparentmayhave11)Theterm“innerjoin”refersto:A)Joinsbetweentwotablesinthesameschema.B)Anequalityjoinbasedononecolumnfromeachtable.C)Atablejoinedwithitself.D)ACartesianproductjoin.12)Whichtypeofjoinisusedinthisquery?SELECTlast_name“Name”,hire_date“HireDate”,loc“Location”FROMemployee,departmentWHEREemployee.deptno=department.deptno.A)OuterjoinB)SelfjoinC)EquijoinD)Non-equijoin13)Asalesdatabasehastwotable–SALESPERSONandCUSTOMERSasbelow:SALESPEOPLE——————————————————snumNUMBERsnameVARCHAR2(10)CUSTOMER——————————————————snumNUMBERcnameVARCHAR2(10)Themanagementwantstoknowthemappingofsalespersonstotheircustomerswithoutexcludingthosesalespersonsthatarenotcurrentlyassigned.Whatwouldbethemostappropriatecondition,whichcanbeappliedontheQuerytoaccomplishtheabovetask?A)salespeople.snum(+)=customers.snumB)salespeople.snum=customers.snum(+)C)salespeople.snum=customers.snumD)salespeople.snum(+)=customers.snum(+)14)joinreturnsthoserowsfromatablewhichhavenodirectmatchintheothertable.A)OuterjoinB)innerjoinC)EquijoinD)Selfjoin15)ToproduceameaningfulresultsetwithoutanyCartesianproducts,whatistheminimumnumberofconditionsthatshouldappearintheWHEREclauseofafourtablejoin?A)1B)4C)2D)8FurthertherewerequestionfromMATHS(inaptitudesection),testingtheworkingknowledgeofWINNT(howtochangethepagefilesizeetc),thengeneraltermsrelatedtocomputerslikeWORM,TrojanHorseetc.PL-SQLQuestionsWhatisanAnonymousblock?Anonymousblocksareunnamedblocks.Differentbetween%Typeand%ROWTYPE?Whataretheadvantagesof%ROWTYPE?%Typeisusedtodeclareavariableaccordingtoanotherpreviouslydeclaredvariableordatabasecolumn.%ROWTYPEisusedtodeclareavariableaccordingtoacollectionofcolumnsinadatabasetableorview.Advantagesof%ROWTYPE:-1.Thenumberanddatatypesoftheunderlyingdatabasecolumnsneednotbeknown.2.Thenumberanddatatypesoftheunderlyingdatabasecolumnmaychangeatruntime.3.TheattributeisusefulwhenretrievingarowwiththeSELECT*statement.ISNOTNULLcolumnconstraintappliedtoavariabledeclaredusing%TYPE?NOWhichsectionismandatoryforaPLSQLblock?BeginSectionWhatisMERGEstatement?TheMERGEstatementinsertsorupdatesrowsinonetable,usingdatafromanothertable.Eachrowisinsertedorupdatedinthetargettable,dependinguponanequijoincondition.Syntax:-DECLAREv_empnoEMPLOYEES.EMPLOYEE_ID%TYPE:=100;BEGINMERGEINTOcopy_empcUSINGemployeeseON(e.employee_id=v_empno)WHENMATCHEDTHENUPDATESETc.first_name=e.first_name,c.last_name=e.last_name,c.email=e.email,c.phone_number=e.phone_number,c.hire_date=e.hire_date,c.job_id=e.job_id,c.salary=e.salary,c.commission_pct=e.commission_pct,c.manager_id=e.manager_id,c.department_id=e.department_idWHENNOTMATCHEDTHENINSERTVALUES(e.employee_id,e.first_name,e.last_name,e.email,e.phone_number,e.hire_date,e.job_id,e.salary,e.commission_pct,e.manager_id,e.department_id);END;TypesofCursors?ImplicitCursors:-WheneveryouissueaSQLstatement,theOracleserveropensanareaofmemoryinwhichthecommandisparsedandexecuted.Thisareaiscalledacursor.(OR)APrivateSQLWorkarea.ThesecursorsarecalledImplicitCursors(or)SQLCursors.ThisCursorOraclemaintainsimplicitly,noProgrammerinterventionisrequired.ExplicitCursors:-ExplicitCursorsareexplicitlydeclaredandnamedbytheProgrammer.WhatistheuseofSQLCursorAttributes?ExplainallSQLCursorattributes?UsingSQLcursorattributes,youcantesttheoutcomeofyourSQLstatements.1.SQL%ROWCOUNT:–NumberofrowsaffectedbythemostrecentSQLstatement(anintegervalue)2.SQL%FOUND:-BooleanattributethatevaluatestoTRUEifthemostrecentSQLstatementaffectsoneormorerows.3.SQL%NOTFOUND:–BooleanattributethatevaluatestoTRUEifthemostrecentSQLstatementdoesnotaffectanyrows.4.SQL%ISOPEN:-AlwaysevaluatestoFALSEbecausePL/SQLclosesimplicitcursorsimmediatelyaftertheyareexecuted.WhatisCASEExpressions?GivetheSyntax?CanuwritetheCASEexpressionsintheSQLstatements?ACASEexpressionselectsaresultandreturnsit.Toselecttheresult,theCASEexpressionusesanexpressionwhosevalueisusedtoselectoneofseveralalternatives.Syntax:-CASEselectorWHENexpression1THENresult1WHENexpression2THENresult2…WHENexpressionNTHENresultN[ELSEresultN+1;]END;YeswecanuseCASEExpressionsinSQLStatements.WhatisdifferencebetweenBAISCLOOPandWHILELOOP?ABAISCLOOPallowsexecutionofitsstatementatleastonce,eveniftheconditionisalreadymetuponenteringtheloop.WithouttheEXITstatement,theloopwouldbeinfinite.WhereasintheWHILELOOP,theconditionisevaluatedatthestartofeachiteration.TheloopterminateswhentheconditionisFALSE.IftheconditionisFALSEatthestartoftheloop,thennofurtheriterationsareperformed.10.WhatissignificanceofREVERSEintheFORLOOP?REVERSEcausesthecountertodecrementwitheachiterationfromtheupperboundtothelowerbound.(Notethatthelowerboundisstillreferencedfirst.).WhatisthedifferencebetweenTRIMandDELETEinINDEXBYTable(or)PLSQLTables?TRIMremovesoneelementfromtheendofaPLSQLtable.DELETEremovedallelementsfromaPLSQLTable.Howtocontrolexplicitcursors?1.Declarethecursorbynamingitanddefiningthestructureofthequerytobeperformedwithinit.2.Openthecursor.TheOPENstatementexecutesthequeryandbindsanyvariablesthatarereferenced.Rowsidentifiedbythequeryarecalledtheactivesetandarenowavailableforfetching.3.Fetchdatafromthecursor.Intheflowdiagramshownontheslide,aftereachfetchyoutestthecursorforanyexistingrow.Iftherearenomorerowstoprocess,thenyoumustclosethecursor.4.Closethecursor.TheCLOSEstatementreleasestheactivesetofrows.Itisnowpossibletoreopenthecursortoestablishafreshactiveset.WhichExceptionswillberaisedwhentryingtofetchthedatafromtheclosedcursor?INVALID_CURSORexceptionwillberaised.Explainabout%NOTFOUNDand%ROWCOUNTAttributesinexplicitcursors?Usethe%ROWCOUNTcursorattributetoretrieveanexactnumberofrows.Usethe%NOTFOUNDcursorattributetodeterminewhentoexittheloop.WhatisCursorFORLoop?WhatisitsimportanceinPLSQLblocks?AcursorFORloopprocessesrowsinanexplicitcursor.Itisashortcutbecausethecursorisopened,rowsarefetchedonceforeachiterationintheloop,theloopexitswhenthelastrowisprocessed,andthecursorisclosedautomatically.Theloopitselfisterminatedautomaticallyattheendoftheiterationwherethelastrowisfetched.Syntax:-FORrecord_nameINcursor_nameLOOPstatement1;statement2;...ENDLOOP;record_nameisthenameoftheimplicitlydeclaredrecord.cursor_nameisaPL/SQLidentifierforthepreviouslydeclaredcursor.Whentoomanycursorsareopened,andthosecursorsarenotclosedbytheprogrammers,whichoracleerroristhrowing?Maxopenedcursorsexceed.Canwedeclareexplicitcursorswithparameters?WhatisitsusageinthePLSQLBlock?Yeswecandeclare.Themainusageisthatyoucanopenandcloseanexplicitcursorseveraltimesinablock,returningadifferentactivesetoneachoccasion.Foreachexecution,thepreviouscursorisclosedandre-openedwithanewsetofparameters.Syntax:-CURSORcursor_name[(parameter_namedatatype,…)]ISselect_statement;WhatisWHERECURRENTOFcursor_nameclause?TheWHERECURRENTOFcursor_nameclausetorefertothelatestrowprocessedbytheFETCHstatement.YoucanUpdate/Deleterowsbasedoncriteriafromacursor.18.Howmanytypesofexceptions?Exceptionsare3types1.Predefined:-Oraclebuiltinerrors.Noneedtodeclareandraise.TheseerrorsErrorsareraisedautomatically.2.NonPredefined:-StandardOracleServererror.DeclareinthedeclarativeSection,andoracleserverwillraiseautomatically(i.enoNeedtoraiseexplicitly).3.Userdefined:-Aconditionwhenprogrammerdeterminesisabnormal.Declarewithinthedeclarativesectionandraiseexplicitly.19.Whatisanexception?Howisitraised?Howdoyouhandleit?AnexceptionisanidentifierinPL/SQLthatisraisedduringtheexecutionofablockthatterminatesitsmainbodyofactions.Itisraisedwhen1.Oracleerroroccursand2.YouraiseanexceptionexplicitlybyissuingtheRAISEstatementwithintheblockWecanhandletheexceptionsthroughExceptionblock.WhenNO_DATA_FOUNDexceptionwillberaised?WhennorowsareretrievedfromthedatabaseinaSELECTstatement,thenPL/SQLraisestheexceptionNO_DATA_FOUND.WhenINVALID_NUMBERexceptionwillberaised?WhenConversionofcharacterstringtonumberfails.WhatisSQLCODEandSQLERRM?SQLCODEisafunctionwhichreturnerrorcodewhenexceptionoccurs.SQLERRMisafunctionwhichreturnserrormessagewitherrorcode.WhatisthedifferencebetweenProcedureandaFunction?Aprocedureisatypeofsubprogramthatperformsanaction.Aprocedurecanbestoredinthedatabase,asaschemaobject,forrepeatedexecution.AfunctionisanamedPL/SQLblockthatreturnsavalue.Afunctioncanbestoredinthedatabaseasaschemaobjectforrepeatedexecution.Howmanytypesareparameters(or)argumentsforaprocedure?Thereare3typesofparameters1.INParameter:-Valueispassedintosubprogram2.OUTParameter:-Returnedtocallingenvironment3.INOUTParameter:-Passedintosubprogram;returnedtocallingEnvironment.CanweuseProceduresinSQLStatements?NO.ButwecanuseFunctionsinSQLStatements.WhatisaPackage?GrouplogicallyrelatedPL/SQLtypes,items,andsubprograms.ItcontainsSpecificationandBodyIsaPackageexistswithoutabody?Yes.GenerallyitisusedfordeclaringConstants.WhatisdynamicSQLstatements?CanweuseinPLSQLblocks?IfyesHow?DynamicSQLstatementsareSQLstatementsstoredascharacterstring.Yeswecanuse.Using1.EXECUTEIMMEDIATEstatement2.DBMS_SQLpackage29.whatisdatadictionaryviewtoviewallthePLSQLstoredobjects?USER_OBJECTSdictionaryview.WhatisdifferencebetweenStatementTriggerandRowTrigger?Astatementtriggerisfiredonceonbehalfofthetriggeringevent.ARowtriggerfiresonceforeachrowaffectedbythetriggeringevent.Ifthetriggeringeventaffectsnorowsthenarowtriggerisnotexecutedatall.30.CanweissueCOMMITinaTrigger?NO.butwecanissueinsideastoredProcedureWhatisthedatadictionaryviewtoviewinvalidtriggers?USER_TRIGGERS.Whattypetriggerisoperatedonaview?INSTEADOFTrigger.ThistriggerisbydefaultROWTrigger.WhichDataDictionaryviewisusedtoviewthePLSQLobjectsSourcecode?USER_SOURCE.JAVAthreadsQuestion1WhichofthefollowingmethodsaremembersoftheObjectclass?a.joinb.notifyc.notifyAlld.rune.sleepf.startg.yieldh.wait———————————Question2WhichofthefollowingmethodsarestaticmembersoftheThreadclass?a.joinb.notifyc.notifyAlld.rune.sleepf.startg.yieldh.wait———————————Question3WhichofthefollowingmethodsaredeprecatedmembersoftheThreadclass?a.joinb.notifyc.notifyAlld.resumee.runf.sleepg.starth.stopi.suspendj.yieldk.wait———————————Question4WhichofthefollowingmethodsnametheInterruptedExceptioninitsthrowsclause?a.joinb.notifyc.notifyAlld.rune.sleepf.startg.yieldh.wait———————————Question5Atimeoutargumentcanbepassedtowhichofthefollowingmethods?a.joinb.notifyc.notifyAlld.rune.sleepf.startg.yieldh.wait———————————Question6Whichofthefollowinginstancemethodsshouldonlybecalledbyathreadthatholdsthelockoftheinstanceonwhichthemethodisinvoked?a.joinb.notifyc.notifyAlld.rune.startf.wait———————————Question7Whichofthefollowingisacheckedexception?a.IllegalMonitorStateExceptionb.IllegalThreadStateExceptionc.IllegalArgumentExceptiond.InterruptedExceptione.Noneoftheabove———————————Question8Whichkindofvariablewouldyouprefertosynchronizeon?a.Amembervariableofaprimitivetypeb.Amembervariablethatisanobjectreferencec.Amethodlocalvariablethatisareferencetoaninstancethatiscreatedwithinthemethodd.Noneoftheabove———————————Question9synchronized(expression)blockThesynchronizedstatementhastheformshownabove.Whichofthefollowingaretruestatements?a.Acompile-timeerroroccursiftheexpressionproducesavalueofanyreferencetypeb.Acompile-timeerroroccursiftheexpressionproducesavalueofanyprimitivetypec.Acompile-timeerrordoesnotoccuriftheexpressionisoftypebooleand.Thesychronizedblockmaybeprocessednormallyiftheexpressionisnulle.Ifexecutionoftheblockcompletesnormally,thenthelockisreleasedf.Ifexecutionoftheblockcompletesabruptly,thenthelockisreleasedg.Athreadcanholdmorethanonelockatatimeh.Synchronizedstatementscanbenestedi.Synchronizedstatementswithidenticalexpressionscanbenested———————————Question10Whichofthefollowingisatruestatement?a.Theprocessofexecutingasynchronizedmethodrequiresthethreadtoacquirealockb.Anyoverridingmethodofasynchronizedmethodisimplicitlysynchronizedc.Ifanymethodinaclassissynchronized,thentheclassitselfmustalsobedeclaredusingthesynchronizedmodifierd.IfathreadinvokesastaticsynchronizedmethodonaninstanceofclassA,thenthethreadmustacquirethelockofthatinstanceofclassAe.Noneoftheabove———————————Question11Whichofthefollowingthreadstatetransitionsmodelthelifecycleofathread?a.TheDeadstatetotheReadystateb.TheReadystatetotheNot-Runnablestatec.TheReadystatetotheRunningstated.TheRunningstatetotheNot-Runnablestatee.TheRunningstatetotheReadystatef.TheNot-RunnablestatetotheReadystateg.TheNot-RunnablestatetotheRunningstate———————————Question12Whichofthefollowingaretruestatements?a.TheThread.yieldmethodmightcausethethreadtomovetotheNot-Runnablestateb.TheThread.yieldmethodmightcausethethreadtomovetotheReadystatec.ThesamethreadmightcontinuetorunaftercallingtheThread.yieldmethodd.TheThread.yieldmethodisastaticmethode.ThebehavioroftheThread.yieldmethodisconsistentfromoneplatformtothenextf.TheThread.sleepmethodcausesthethreadtomovetotheNot-Runnablestateg.TheThread.sleepmethodcausesthethreadtomovetotheReadystate———————————Question13WhichofthefollowingwillnotforceathreadtomoveintotheNot-Runnablestate?a.Thread.yieldmethodb.Thread.sleepmethodc.Thread.joinmethodd.Object.waitmethode.ByblockingonI/Of.Unsuccessfullyattemptingtoacquirethelockofanobjectg.Noneoftheabove———————————Question14Whichofthefollowingwillcauseadeadthreadtorestart?a.Thread.yieldmethodb.Thread.joinmethodc.Thread.startmethodd.Thread.resumemethode.Noneoftheabove———————————Question15Whenathreadiscreatedandstarted,whatisitsinitialstate?a.Newb.Readyc.Not-Runnabled.Runnninge.Deadf.Noneoftheabove———————————Question16Whichofthefollowingaretruestatements?a.TheThread.runmethodisusedtostartanewthreadrunningb.TheThread.startmethodcausesanewthreadtogetreadytorunatthediscretionofthethreadschedulerc.TheRunnableinterfacedeclaresthestartmethodd.TheRunnableinterfacedeclarestherunmethode.TheThreadclassimplementstheRunnableinterfacef.IfanObject.notifymethodcallappearsinasynchronizedblock,thenitmustbethelastmethodcallintheblockg.Norestrictionisplacedonthenumberofthreadsthatcanenterasynchronizedmethodh.SomeimplementationsoftheThread.yieldmethodwillnotyieldtoathreadoflowerpriority———————————Question17Whichofthefollowingaretruestatements?a.Thread.MAX_PRIORITY==10b.Thread.MAX_PRIORITY==5c.Thread.NORM_PRIORITY==5d.Thread.NORM_PRIORITY==3e.Thread.NORM_PRIORITY==0f.Thread.MIN_PRIORITY==1g.Thread.MIN_PRIORITY==0h.Thread.MIN_PRIORITY==-5i.Thread.MIN_PRIORITY==-10———————————Question18Whichofthefollowingaretruestatements?a.Aprogramwillterminateonlywhenalldaemonthreadsstoprunningb.Aprogramwillterminateonlywhenalluserthreadsstoprunningc.AdaemonthreadalwaysrunsatThread.MIN_PRIORITYd.Athreadinheritsitsdaemonstatusfromthethreadthatcreatedite.ThedaemonstatusofathreadcanbechangedatanytimeusingtheThread.setDaemonmethodf.TheThread.setDaemonmethodacceptsoneoftwoargumentvaluesdefinedbytheconstantsThread.DAEMONandThread.USER———————————Question19classAextendsThread{publicA(Runnabler){super(r);}publicvoidrun(){System.out.print(“A”);}}classBimplementsRunnable{publicvoidrun(){System.out.print(“B”);}}classC{publicstaticvoidmain(String[]args){newA(newB()).start();}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:Ab.Prints:Bc.Prints:ABd.Prints:BAe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question20classAimplementsRunnable{publicvoidrun(){System.out.print(Thread.currentThread().getName());}}classBimplementsRunnable{publicvoidrun(){newA().run();newThread(newA(),”T2″).run();newThread(newA(),”T3″).start();}}classC{publicstaticvoidmain(String[]args){newThread(newB(),”T1″).start();}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:T1T1T1b.Prints:T1T1T2c.Prints:T1T2T2d.Prints:T1T2T3e.Prints:T1T1T3f.Prints:T1T3T3g.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question21classAnExceptionextendsException{}classAextendsThread{publicvoidrun()throwsAnException{System.out.print(“A”);thrownewAnException();}}classB{publicstaticvoidmain(String[]args){Aa=newA();a.start();System.out.print(“B”);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:Ab.Prints:Bc.Prints:ABd.Prints:BAe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question22classAextendsThread{publicvoidrun(){System.out.print(“A”);}}classB{publicstaticvoidmain(String[]args){Aa=newA();a.start();a.start();//1}}Whatistheresultofattemptingtocompileandruntheprogram?a.Theprogramcompilesandrunswithouterrorb.Thesecondattempttostartthreadt1issuccessfulc.Thesecondattempttostartthreadt1isignoredd.Compile-timeerroratmarker1e.AnIllegalThreadStateExceptionisthrownatrun-timef.NoneoftheaboveNo.AnswerRemark1bchnotifynotifyAllwait2egsleepyield3dhiresumestopsuspendForthepurposesoftheexam,youdon’tneedtomemorizethedeprecatedmethodsoftheThreadclass.Eventhoughaquestionsuchasthiswillnotbeontheexam,everyJavaprogrammershouldknowthatthedeprecatedmethodsshouldnotbeusedinnewprograms.4aehjoinsleepwait5aehjoinsleepwait6bcfnotifynotifyAllwait7dInterruptedExceptionThemethodsObject.wait,Thread.joinandThread.sleepnameInterruptedExceptionintheirthrowsclauses.8bAmembervariablethatisanobjectreferencePrimitivesdon’thavelocks;therefore,theycannotbeusedtosynchronizethreads.Amethodlocalvariablethatisareferencetoaninstancethatiscreatedwithinthemethodshouldnotbeusedtosynchronizethreads,becauseeachthreadhasitsowninstanceoftheobjectandlock.Synchronizationonaninstancethatiscreatedlocallymakesaboutasmuchsenseasplacingonyourdoorstepaboxfullofkeystothedoor.Eachpersonthatcomestoyourdoorwouldhavetheirowncopyofthekey;sothelockwouldprovidenosecurity.9befghiAcompile-timeerroroccursiftheexpressionproducesavalueofanyprimitivetypeIfexecutionoftheblockcompletesnormally,thenthelockisreleasedIfexecutionoftheblockcompletesabruptly,thenthelockisreleasedAthreadcanholdmorethanonelockatatimeSynchronizedstatementscanbenestedSynchronizedstatementswithidenticalexpressionscanbenested10aTheprocessofexecutingasynchronizedmethodrequiresthethreadtoacquirealockThesynchronizedmodifiercannotbeappliedtoaclass.Amethodthatoverridesasynchronizedmethoddoesnothavetobesynchronized.IfathreadinvokesasynchronizedinstancemethodonaninstanceofclassA,thenthethreadmustacquirethelockofthatinstanceofclassA.Thesameisnottrueforsynchronizedstaticmethods.AsynchronizedstaticmethodissynchronizedonthelockfortheClassobjectthatrepresentstheclassforwhichthemethodisamember.11cdefTheReadystatetotheRunningstateTheRunningstatetotheNot-RunnablestateTheRunningstatetotheReadystateTheNot-RunnablestatetotheReadystateAdeadthreadcannotberestarted.12bcdfTheThread.yieldmethodmightcausethethreadtomovetotheReadystateThesamethreadmightcontinuetorunaftercallingtheThread.yieldmethodTheThread.yieldmethodisastaticmethodTheThread.sleepmethodcausesthethreadtomovetotheNot-RunnablestateTheThread.yieldmethodisintendedtocausethecurrentlyexecutingthreadtomovefromtheRunningstatetotheReadystateandofferthethreadscheduleranopportunitytoallowadifferentthreadtoexecutebasedonthediscretionofthethreadscheduler.Thethreadschedulermayselectthesamethreadtorunimmediately,oritmayallowadifferentthreadtorun.TheThread.yieldmethodisanativemethod;sothebehaviorisnotguaranteedtobethesameoneveryplatform.However,atleastsomeimplementationsoftheyieldmethodwillnotyieldtoathreadthathasalowerpriority.13aThread.yieldmethodTheThread.yieldmethodmaycauseathreadtomoveintotheReadystate,butthatstatetransitionisnotguaranteed.TheJLSstatesthattheThread.yieldmethodprovidesahinttothethreadscheduler,buttheschedulerisfreetointerpret–orignore–thehintasitseesfit.NothingintheJLSsuggeststhatthethreadmightmovetotheNot-Runnablestate.14eNoneoftheaboveAdeadthreadcannotberestarted.15bReady16bdehTheThread.startmethodcausesanewthreadtogetreadytorunatthediscretionofthethreadschedulerTheRunnableinterfacedeclarestherunmethodTheThreadclass

Page 6: Daily paragraph editing terminal velocity answers

implementstheRunnableinterfaceSomeimplementationsoftheThread.yieldmethodwillnotyieldtoathreadoflowerpriorityTheObject.notifymethodcanonlybecalledbythethreadthatholdsthelockoftheobjectonwhichthemethodisinvoked.SupposethatthreadT1entersablockthatissynchronizedonanobject,A.Withintheblock,threadT1holdsthelockofA.EvenifthreadT1callsthenotifymethodimmediatelyafterenteringthesynchronizedblock,nootherthreadcangrabthelockofobjectAuntilT1leavesthesynchronizedblock.Forthatreason,thetransferofcontrolfromthreadT1toanywaitingthreadcannotbeacceleratedbymovingthenotifymethodtoanearlierpointinthesynchronizedblock.ThebehaviorofThread.yieldisplatformspecific.However,atleastsomeimplementationsoftheyieldmethodwillnotyieldtoathreadthathasalowerpriority.InvokingtheThread.yieldmethodislikeofferingasuggestiontotheJVMtoallowanotherthreadtorun.Theresponsetothesuggestionisplatformspecific.17acfThread.MAX_PRIORITY==10Thread.NORM_PRIORITY==5Thread.MIN_PRIORITY==118bdAprogramwillterminateonlywhenalluserthreadsstoprunningAthreadinheritsitsdaemonstatusfromthethreadthatcreatedit19aPrints:AIfaRunnabletargetobjectispassedtotheconstructoroftheThreadclass,thentheThread.runmethodwillinvoketherunmethodoftheRunnabletarget.Inthiscase,theThread.runmethodisoverriddenbyA.run.TheA.runmethoddoesnothingmorethanprinttheletterA.TheinvocationoftheA.startmethodinsidethemainmethodresultsintheinvocationofA.run,andtheletterAisprinted.TheB.runmethodisneverinvoked.20ePrints:T1T1T3TheThread.currentThreadmethodreturnsareferencetothecurrentlyexecutingthread.Whentherunmethodisinvokeddirectlyitdoesnotstartanewthread;soT1isprintedtwice.21eCompile-timeerrorTheRunnable.runmethoddoesnothaveathrowsclause;soanyimplementationofruncannotthrowacheckedexception.22eAnIllegalThreadStateExceptionisthrownatrun-timeForthepurposesoftheexam,invokingthestartmethodonathreadthathasalreadybeenstartedwillgenerateanIllegalThreadStateException.Theactualbehaviorofthemethodmightbedifferent.Ifthestartmethodisinvokedonathreadthatisalreadyrunning,thenanIllegalThreadStateExceptionwillprobablybethrown.However,ifthethreadisalreadydeadthenthesecondattempttostartthethreadwillprobablybeignored,andnoexceptionwillbethrown.Forthepurposesoftheexam,theexceptionisalwaysthrowninresponsetothesecondinvocationofthestartmethod.Thisisacasewheretheexamtestsyourknowledgeofthespecificationandignorestheactualbehaviorofthe1.4versionoftheJVM.Question1classAextendsThread{privateinti;publicvoidrun(){i=1;}publicstaticvoidmain(String[]args){Aa=newA();a.start();System.out.print(a.i);}}Whatarethepossibleresultsofattemptingtocompileandruntheprogram?a.Printsnothingb.Prints:0c.Prints:1d.Prints:01e.Prints:10f.Compile-timeerrorg.Run-timeerror———————————Question2classAextendsThread{privateinti;publicvoidrun(){i=1;}publicstaticvoidmain(String[]args){Aa=newA();a.run();System.out.print(a.i);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Printsnothingb.Prints:0c.Prints:1d.Prints:01e.Prints:10f.Compile-timeerrorg.Run-timeerrorh.Noneoftheabove———————————Question3classAextendsThread{publicvoidrun(){try{sleep(10000);}catch(InterruptedExceptionie){}}publicstaticvoidmain(String[]args){Aa1=newA();longstartTime=System.currentTimeMillis();a1.start();System.out.print(System.currentTimeMillis()–startTime);}}Whatarethepossibleresultsofattemptingtocompileandruntheprogram?a.Printsanumbergreaterthanorequalto0b.Thenumberprintedmustalwaysbegreaterthan10000c.Thisprogramwillrunforatleasttensecondsd.Compile-timeerrore.Run-timeerror———————————Question4Whichofthefollowingisusedtoforceeachthreadtoreconcileitsworkingcopyofavariablewiththemastercopyinmainmemory?a.finalb.staticc.synchronizedd.transiente.volatilef.native———————————Question5classAextendsThread{publicvoidrun(){synchronized(this){try{wait(5000);}catch(InterruptedExceptionie){}}}publicstaticvoidmain(String[]args){Aa1=newA();longstartTime=System.currentTimeMillis();a1.start();System.out.print(System.currentTimeMillis()–startTime+“,”);try{a1.join(6000);}catch(InterruptedExceptionie){}System.out.print(System.currentTimeMillis()–startTime);}}Whatarethepossibleresultsofattemptingtocompileandruntheprogram?a.Thefirstnumberprintedisgreaterthanorequalto0b.Thefirstnumberprintedmustalwaysbegreaterthan5000c.Thesecondnumberprintedmustalwaysbegreaterthan5000d.Thesecondnumberprintedmustalwaysbegreaterthan6000e.Thesynchronizedblockinsidetherunmethodisnotnecessaryf.Compile-timeerrorg.Run-timeerror———————————Question6classAextendsThread{String[]sa;publicA(String[]sa){this.sa=sa;}publicvoidrun(){synchronized(sa){System.out.print(sa[0]+sa[1]+sa[2]);}}}classB{privatestaticString[]sa=newString[]{“X”,”Y”,”Z”};publicstaticvoidmain(String[]args){synchronized(sa){Threadt1=newA(sa);t1.start();sa[0]=“A”;sa[1]=“B”;sa[2]=“C”;}}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:XYZb.Prints:AYZc.Prints:ABZd.Prints:ABCe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question7classAextendsThread{String[]sa;publicA(String[]sa){this.sa=sa;}publicvoidrun(){synchronized(sa){while(!sa[0].equals(“Done”)){try{sa.wait();}catch(InterruptedExceptionie){}}}System.out.print(sa[1]+sa[2]+sa[3]);}}classB{privatestaticString[]sa=newString[]{“NotDone”,”X”,”Y”,”Z”};publicstaticvoidmain(String[]args){Threadt1=newA(sa);t1.start();synchronized(sa){sa[0]=“Done”;sa[1]=“A”;sa[2]=“B”;sa[3]=“C”;sa.notify();}}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:XYZb.Prints:AYZc.Prints:ABZd.Prints:ABCe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question8Whichofthefollowingaretruestatements?a.TheThread.joinmethodisstaticb.TheThread.joinmethodisalwaysinvokedonaninstanceofThreadc.TheThread.joinmethodcausesthecurrentthreadtowaitforthereferencedthreadtodied.TheThread.joinmethoddeclaresanInterruptedExceptioninthethrowsclausee.TheThread.joinmethodacceptsatimeoutvalueasanargumentf.Thetimeoutvaluesetstheminimumtimethatthecurrentthreadwillwaitforthedeathofthereferencedthreadg.Thread.joinwillreturnimmediatelyifthetimeoutvalueiszeroh.AtimeoutofzerowillallowThread.jointowaitforeverifnecessary———————————Question9Whichofthefollowingallowsathreadt1tobecometheholderofthelockofobjectobj1.a.ByblockingonI/Ob.Byenteringasynchronizedinstancemethodoftheobj1c.Byinvokingthewaitmethodontheobjectd.Byenteringthebodyofablockthatissynchronizedonobj1e.Byenteringasynchronizedstaticmethodoftheobj1f.Byinvokingthenotifymethodonobj1———————————Question10Afterinvokingthewaitmethodonanobject,obj1,athread,T1,willremaininthewaitsetofobj1untilwhichofthefollowingoccurs?a.Anotherthreadinvokesthenotifymethodontheobject,obj1,andT1isselectedtomoveoutofthewaitsetb.AnotherthreadinvokesthenotifyAllmethodontheobjectc.AnotherthreadinvokestheresumemethodonthreadT1d.AnotherthreadinterruptsthreadT1e.ThepriorityofthreadT1isincreasedf.Aspecifiedtimeoutperiodhaselapsedg.AnotherthreadinvokesthejoinmethodonthreadT1———————————Question11classAimplementsRunnable{publicvoidrun(){}}classB{publicstaticvoidmain(String[]args){Threadt1=newThread();//1Threadt2=newThread(newA());//2Threadt3=newThread(newA(),“A”);//3Threadt4=newThread(“A”);//4}}Acompile-timeerrorisgeneratedatwhichline?a.1b.2c.3d.4e.Noneoftheabove———————————Question12classAimplementsRunnable{publicvoidrun(){}}classB{publicstaticvoidmain(String[]args){Threadt1=newThread();//1Threadt2=newThread(newA());//2Threadt3=newThread(“A”,newA());//3Threadt4=newThread(“A”);//4}}Acompile-timeerrorisgeneratedatwhichline?a.1b.2c.3d.4e.Noneoftheabove———————————Question13classAextendsThread{privatebooleandone;publicvoidsetDone(booleandone){this.done=done;}publicvoidrun(){synchronized(this){while(!done){try{wait();}catch(InterruptedExceptionie){}}}}publicstaticvoidmain(String[]args){Aa1=newA();longstartTime=System.currentTimeMillis();a1.start();System.out.print(System.currentTimeMillis()–startTime);}}Whichisapossibleresultofattemptingtocompileandruntheprogram?a.Thenumberprintedisgreaterthanorequalto0b.Thesynchronizedblockinsidetherunmethodisnotnecessaryc.Thisprogramrunstocompletionaftertheelapsedtimeisprintedd.Compile-timeerrore.Run-timeerrorf.Noneoftheabove———————————Question14classAextendsThread{publicvoidrun(){synchronized(this){try{wait();}catch(InterruptedExceptionie){}}}publicstaticvoidmain(String[]args){Aa1=newA();a1.setDaemon(true);longstartTime=System.currentTimeMillis();a1.start();System.out.print(System.currentTimeMillis()–startTime+“,”);}}Whichisapossibleresultofattemptingtocompileandruntheprogram?a.Thenumberprintedisgreaterthanorequalto0b.Thesynchronizedblockinsidetherunmethodisnotnecessaryc.Threada1waitsforeverandtheprogramrunsforeverd.Compile-timeerrore.Run-timeerrorf.Noneoftheabove———————————Question15classAextendsThread{privateObjectobj;publicA(Objectobj){this.obj=obj;}publicvoidrun(){try{synchronized(obj){obj.wait();}}catch(InterruptedExceptionie){}System.out.print(Thread.currentThread().getName());}}classB{privatevoidm1(){for(inti=0;i<10;i++){At1=newA(this);t1.setName(String.valueOf(i));t1.setDaemon(true);t1.start();}synchronized(this){notifyAll();}}publicstaticvoidmain(String[]args){newB().m1();}}Whatarethepossibleresultsofattemptingtocompileandruntheprogram?a.Allofthenumbers0through9mustalwaysbeprintedb.Someorallofthenumbers0through9couldbeprintedc.Nothingisprintedd.Run-timeerror———————————Question16classCextendsThread{privatestaticString[]sa=newString[]{“NotDone”,”X”,”Y”,”Z”};publicvoidrun(){synchronized(sa){while(!sa[0].equals(“Done”)){try{sa.wait();}catch(InterruptedExceptionie){}}}System.out.print(sa[1]+sa[2]+sa[3]);}publicstaticvoidmain(String[]args){start();synchronized(sa){sa[0]=“Done”;sa[1]=“A”;sa[2]=“B”;sa[3]=“C”;sa.notify();}}}Whichisapossibleresultofattemptingtocompileandruntheprogram?a.Prints:XYZb.Prints:AYZc.Prints:ABZd.Prints:ABCe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question17classCextendsThread{privatestaticString[]sa=newString[]{“NotDone”,”X”,”Y”,”Z”};publicvoidrun(){synchronized(this){while(!sa[0].equals(“Done”)){try{wait();}catch(InterruptedExceptionie){}}}System.out.print(sa[1]+sa[2]+sa[3]);}voidm1(){start();synchronized(this){sa[0]=“Done”;sa[1]=“A”;sa[2]=“B”;sa[3]=“C”;}}publicstaticvoidmain(String[]args){newC().m1();notify();}}Whichisapossibleresultofattemptingtocompileandruntheprogram?a.Prints:XYZb.Prints:AYZc.Prints:ABZd.Prints:ABCe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question18classAextendsThread{publicvoidrun(){longstartTime=System.currentTimeMillis();longendTime=startTime+10000;while(System.currentTimeMillis()<endTime){yield();}}publicstaticvoidmain(String[]args){Aa1=newA();longstartTime=System.currentTimeMillis();a1.start();sleep(1000);a1.interrupt();a1.join();System.out.print(System.currentTimeMillis()–startTime);}}Whichisapossibleresultofattemptingtocompileandruntheprogram?a.Printsanumberthatislessthan1000b.Printsanumberbetween1000and9999c.Printsanumberlargerthan10000d.Compile-timeerrore.Run-timeerrorf.Noneoftheabove———————————Question19classAextendsThread{publicvoidrun(){System.out.print(“A”);}}classB{publicstaticvoidmain(String[]args){Aa=newA();a.start();try{a.join();}catch(InterruptedExceptionie){ie.printStackTrace();}a.start();//1}}Whatistheresultofattemptingtocompileandruntheprogram?a.Theprogramcompilesandrunswithouterrorb.Thesecondattempttostartthreadt1issuccessfulc.Thesecondattempttostartthreadt1isignoredd.Compile-timeerroratmarker1e.AnIllegalThreadStateExceptionisthrownatrun-timef.Noneoftheabove———————————Question20classAextendsThread{privatestaticBb=newB();privateStrings1;publicvoidrun(){System.out.print(b.m1(s1));}A(StringthreadName,Strings1){super(threadName);this.s1=s1;}publicstaticvoidmain(String[]args){Aa=newA(“T1″,”A”),b=newA(“T2″,”B”);a.start();b.start();}}classB{privateStrings1;publicsynchronizedStringm1(Strings){s1=s;try{Thread.sleep(1);}catch(InterruptedExceptionie){}return“[“+Thread.currentThread().getName()+”,”+s1+“]”;}}Whatarethepossibleresultsofattemptingtocompileandruntheprogram?a.Printsnothingb.Prints:[T1,A][T2,B]c.Prints:[T1,B][T2,B]d.Prints:[T2,B][T1,A]e.Prints:[T2,A][T1,A]f.Compile-timeerrorg.Run-timeerror———————————Question21classAextendsThread{staticlongstartTime;publicvoidrun(){for(inti=0;i<99999;i++){Math.sin(i);}Stringname=Thread.currentThread().getName();longtime=System.currentTimeMillis();System.out.println(name+”doneat”+(time–startTime));}publicstaticvoidmain(String[]args){At1=newA();At2=newA();t1.setName(”T1″);t2.setName(”T2″);t1.setPriority(Thread.MIN_PRIORITY);t2.setPriority(Thread.MAX_PRIORITY);startTime=System.currentTimeMillis();t1.start();t2.start();}}Whichofthefollowingisatruestatement?a.ThepriorityassignedtothreadT2isgreaterthanthepriorityassignedtoT1b.JavaguaranteesthatthreadT2willgetmoreCPUtimethanT1c.JavaguarantessthatthreadT2willruntocompletionbeforeT1d.NoneoftheaboveNo.AnswerRemark1bcPrints:0Prints:1Thenewthreadisstartedbeforetheprintstatement,butthereisnoguaranteethatthenewthreadwillrunbeforetheprintstatementisprocessed.Theguaranteecouldbeprovidedbyplacingthemethodinvocationexpressiona.join()beforetheprintstatement,buttheinvocationofthejoinmethoddoesnotappearintheprogram.Ifthenewthreadrunsbeforetheprintstatementisprocessed,then1isprinted.Otherwise,0isprinted.2cPrints:1Thea.run()methodwascalledinsteadofa.start();sotheentireprogramrunsasasinglethread,anda.run()isguaranteedtocompletebeforetheprintstatementiscalled.3acPrintsanumbergreaterthanorequalto0ThisprogramwillrunforatleasttensecondsThreada1willrunforatleasttenseconds,butthemainmethodislikelytoruntocompletionveryquickly.Thestartmethodwillreturnwithoutwaitingforthreada1tocomplete.Sincethreada1immediatelygoestosleepthethreadthatisprocessingthemainmethodhasanopportunitytocompletethemainmethodquickly.Thenumberprintedinthemainmethodcanbeassmallaszero.4evolatileAfieldmightbesharedbetweentwoormorethreads.Eachthreadisallowedtomaintainaworkingcopyofthefield.Ifthethreadsdonotreconciletheworkingcopiestheneachmightbeworkingwithadifferentvalue.Thevolatilemodifierisusedtoforceeachthreadtoreconcileitsworkingcopyofthefieldwiththemastercopyinmainmemory.5acThefirstnumberprintedisgreaterthanorequalto0Thesecondnumberprintedmustalwaysbegreaterthan5000Thenotifymethodisneverinvokedonthreada1;soitwillsleepforatleastfiveseconds.Theinvocationofthejoinmethodforcesthemainthreadtowaitforthecompletionofthreada1.Theargumentof6000willallowthemainthreadtowaitforsixsecondsifnecessary,butweknowthatthreada1willcompleteinonlyfiveseconds.Thefirstnumberprintedwillbegreaterthanorequaltozero,andthesecondnumberwillbegreaterthanorequalto5000.Thesynchronizedblockisnecessary,becauseitisnecessarytoholdthelockofanobjectwhenthewaitmethodisinvoked.6dPrints:ABCTheblockinsidethemainmethodissynchronizedontheStringarrayobjectsa.Insidetheblock,anewthreadt1isstartedandwillrunatthediscretionofthethreadscheduler.TheA.runmethodalsocontainsablockthatissynchronizedontheStringarrayobjectsa.Evenifthethreadschedulermovesthreadt1intotheRunningstate,itwillblockwhileattemptingtoacquirethelockoftheStringarrayobjectsa.Threadt1willcontinuetoblockuntilthesynchronizedblockintheB.mainmethodrunstocompletion.Atthattime,thecontentsoftheStringarrayobjecthaveallbeenupdated.7dPrints:ABCInsidethemainmethod,threadt1isstartedandwillmoveintotheRunningstateatthediscretionofthethreadscheduler.TheA.runmethodinvokesthewaitmethodontheStringarrayobjectsacausingthethreadtoblockuntilanotherthreadinvokesthesa.notifymethod.BeforetheB.mainmethodinvokessa.notify,alloftheelementsoftheStringarrayobjectsahavealreadybeenupdated.8bcdehTheThread.joinmethodisalwaysinvokedonaninstanceofThreadTheThread.joinmethodcausesthecurrentthreadtowaitforthereferencedthreadtodieTheThread.joinmethoddeclaresanInterruptedExceptioninthethrowsclauseTheThread.joinmethodacceptsatimeoutvalueasanargumentAtimeoutofzerowillallowThread.jointowaitforeverifnecessaryTheThread.joinmethodisnotstatic.Thread.joinisalwaysinvokedonaninstanceofThread.Thread.joincausesthecurrentthreadtowaituntilthereferencedthreadhasdied.Themaximumtimelimittowaitforthedeathofthereferencedthreadcanbespecifiedinmillisecondsbyanargument.Thread.joinwillthrowanInterruptedExceptioniftheinterruptmethodisinvokedonthecurrentThread.9bdByenteringasynchronizedinstancemethodoftheobj1Byenteringthebodyofablockthatissynchronizedonobj1BlockingonI/OorinvokingtheThread.sleeporObject.waitmethodcausesathreadtoentertheNot-Runnablestate.Invokingthenotifymethodonanobjectwakesupathreadthatiswaitingontheobject.Thethreadthatinvokeswaitornotifyonanobjectshouldalreadyholdthelockoftheobject.Invokingthewaitornotifymethoddoesnotcausethethreadtoholdthelock.StaticmethodsaresynchronizedonthelockoftheClassobjectoftheclass.Instancemethodsaresynchronizedonthelockoftheinstanceoftheclass.10abdfAnotherthreadinvokesthenotifymethodontheobject,obj1,andT1isselectedtomoveoutofthewaitsetAnotherthreadinvokesthenotifyAllmethodontheobjectAnotherthreadinterruptsthreadT1Aspecifiedtimeoutperiodhaselapsed11eNoneoftheaboveAlloftheclassinstancecreationexpressionsarelegal.TheStringinstanceAisthenameoftheThread.Yes,theexamrequiresyoutomemorizetheThreadconstructorsignatures.12c3Thepositionoftheargumentshavebeenreversedintheconstructoronline3.TheRunnableargumentshouldappearbeforethethreadnameargument.Yes,theexamrequiresyoutomemorizetheThreadconstructorsignatures.13aThenumberprintedisgreaterthanorequalto0Themainthreadinvokesthestartmethodonthreada1.Thereisnowaytopredictwhenthenewthreadwillstarttorun.Atsomepointintime,themainthreadwillproceedtotheprintstatementwherethevalueofthestartTimevariableissubtractedfromthecurrenttime.Thevalueprintedwillbegreaterthanorequaltoone.Atsomepointintime,threada1willbegintorunanditwillinvokethewaitmethod.Sincenootherthreadinvokesthenotifymethodona1,itwillwaitforever,andtheprogramwillneverruntocompletion.14aThenumberprintedisgreaterthanorequalto0Thea1threadisadaemonthread;sotheprogramcanruntocompletionevenifthreada1isstillrunning,waitingorsleeping.Thenotifymethodisneverinvokedonthreada1.Ifthreada1werenotadaemonthread,thentheprogramwouldwaitforever.However,theprogramwillruntocompletionwithoutwaitingfora1.15bcSomeorallofthenumbers0through9couldbeprintedNothingisprintedAllofthethreadsstartedinmethodB.m1aredaemonthreads;sotheprogramcanruntocompletionevenifsomeorallofthedaemonthreadshavenotrun.16eCompile-timeerrorRememberthattheThread.startmethodisaninstancemethodandcannotbeinvokedfromastaticcontext.17eCompile-timeerrorRememberthattheObject.notifymethodisaninstancemethodandcannotbeinvokedfromastaticcontext.Also,thethreadthatinvokesthenotifymethodonanobjectmustholdthelockoftheobject.18dCompile-timeerrorBoththesleepandjoinmethodsdeclareanInterruptedExceptionthatmustbecaughtordeclaredinthethrowsclauseofA.main.19eAnIllegalThreadStateExceptionisthrownatrun-timeForthepurposesoftheexam,invokingthestartmethodonathreadthathasalreadybeenstartedwillgenerateanIllegalThreadStateException.TheactualbehaviorofJavamightbedifferent.Ifthestartmethodisinvokedonathreadthatisalreadyrunning,thenanIllegalThreadStateExceptionwillprobablybethrown.However,ifthethreadisalreadydeadthenthesecondattempttostartthethreadwillprobablybeignored,andnoexceptionwillbethrown.However,forthepurposesoftheexam,theexceptionisalwaysthrowninresponsetothesecondinvocationofthestartmethod.ThisisacasewheretheexamtestsyourknowledgeofthespecificationoftheThread.startmethodandignorestheactualbehaviorofthe1.4versionoftheJVM.TheThread.joinmethodisincludedheretoverifythatthethreadisalreadydeadbeforethestartmethodisinvokedthesecondtime.Ifthiscodeisexecutedusingthe1.4versionoftheJVM,theexceptionwillnotbethrown.However,forthepurposesoftheexam,theexceptionisalwaysthrown.Therealexamquestionwillprobablynotincludetheinvocationofthejoinmethod.20bdPrints:[T1,A][T2,B]Prints:[T2,B][T1,A]Sincemethodm1issynchronized,itisguaranteedthatnomorethanonethreadwillexecutethemethodatanyonetime.EventhoughthestartmethodisinvokedonthreadT1first,thereisnoguaranteethatitwillactuallybegintorunfirst.21aThepriorityassignedtothreadT2isgreaterthanthepriorityassignedtoT1TheJavaLanguageSpecificationsuggeststhathigherprioritythreadsshouldbegivenpreferenceoverlowerprioritythreads,butexplicitlystatesthatthepreferenceisnotaguarantee.Itisveryimportanttorememberthatnoguaranteeexists.Java,GeneralQuestion1Whichofthefollowingarenotmethodsofthejava.lang.Stringclass?a.appendb.concatc.deleted.inserte.replacef.substringg.valueOf———————————Question2WhichofthesemethodsmodifythecontentsoftheStringinstanceonwhichitisinvoked?a.appendb.concatc.deleted.inserte.replacef.substringg.valueOfh.Noneoftheabove.———————————Question3classMWC204{staticvoidm1(StringBuffers1){s1=s1.append(“B”);System.out.print(s1);}staticvoidm2(StringBuffers1){s1.append(“C”);System.out.print(s1);}publicstaticvoidmain(String[]s){StringBuffers1=newStringBuffer(“A”);m1(s1);m2(s1);System.out.print(s1);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:AAAb.Prints:ABAAc.Prints:ABACAd.Prints:ABABABe.Prints:ABABCABf.Prints:ABABCABCg.Prints:ABCABCABCh.Compile-timeerrori.Run-timeerrorj.Noneoftheabove———————————Question4Whichofthesemethodsisastaticmemberofthejava.lang.Stringclass?a.appendb.concatc.deleted.inserte.replacef.substringg.valueOfh.Noneoftheabove.———————————Question5classMWC205{staticvoidm1(StringBuffers1){s1.append(“B”);System.out.print(s1);}staticvoidm2(StringBuffers1){s1=newStringBuffer(“C”);System.out.print(s1);}publicstaticvoidmain(String[]s){StringBuffers1=newStringBuffer(“A”);m1(s1);m2(s1);System.out.print(s1);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:AAAb.Prints:ABCAc.Prints:ABCABd.Prints:ABCABCe.Prints:ABCACf.Prints:ABABCABCg.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question6classMWC106{staticvoidm1(Strings){s=s.trim();s=s.concat(“D”);}publicstaticvoidmain(String[]s){Strings1=“A”,s2=”B“,s3=“C”;m1(s2);System.out.print(s1+s2+s3);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:ABCb.Prints:ABCc.Prints:ABCDd.Prints:ABDCe.Prints:ABCDf.Prints:ABDCg.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question7classMWC107{publicstaticvoidmain(String[]s){Strings1=“A”,s2=”B“,s3=“C”;s2.trim();s3.concat(“D”);System.out.print(s1+s2+s3);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:ABCb.Prints:ABCc.Prints:ABCDd.Prints:ABDCe.Prints:ABCDf.Prints:ABDCg.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question8classMWC108{publicstaticvoidmain(String[]s){Strings1=“A”,s2=”B“,s3=“C”;s2.trim();s3.append(“D”);System.out.print(s1+s2+s3);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:ABCb.Prints:ABCc.Prints:ABCDd.Prints:ABDCe.Prints:ABCDf.Prints:ABDCg.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question9classMWC110{staticvoidm1(Strings1,Strings2){s1.insert(1,“D”);s1=s1+s2;}publicstaticvoidmain(String[]s){Strings1=“A”,s2=“B”;m1(s1,s2);System.out.print(s1+s2);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:ABb.Prints:ABBc.Prints:ADBd.Prints:ADBBe.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question10classMWC111{staticvoidm1(Strings1){s1.replace(‘A’,’Y’);System.out.print(s1);}staticvoidm2(Strings1){s1=s1.replace(‘A’,’Z’);System.out.print(s1);}publicstaticvoidmain(String[]s){Strings1=“A”;m1(s1);m2(s1);System.out.print(s1);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:AAAb.Prints:YZAc.Prints:YAAd.Prints:AZAe.Prints:AZZf.Compile-timeerrorg.Run-timeerrorh.Noneoftheabove———————————Question11classMWC112{staticvoidm1(Strings1){s1=s1.toUpperCase();System.out.print(s1);}staticvoidm2(Strings1){s1.toLowerCase();System.out.print(s1);}publicstaticvoidmain(String[]s){Strings1=“Ab”;m1(s1);m2(s1);System.out.print(s1);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:AbAbAbb.Prints:ABababc.Prints:ABabAbd.Prints:ABAbAbe.Prints:Abababf.Compile-timeerrorg.Run-timeerrorh.Noneoftheabove———————————Question12classMWC113{publicstaticvoidmain(String[]s){Strings1=“1”,s2=“2”,s3=s1+s2;s1+=s2;s3+=s1;System.out.println(s3);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:3b.Prints:6c.Prints:33d.Prints:1212e.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question13classMWC114{publicstaticvoidmain(String[]s){Strings1=newString(“ABCDEFG”),s2=newString(“EFGHIJ”);Strings3=s1.substring(4,7),s4=s2.substring(0,3);System.out.println((s3==s4)+“,”+(s3+s4).equals(s4+s3));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question14classMWC115{publicstaticvoidmain(String[]s){Strings1=newString(“ABCDEFG”),s2=s1.substring(0,3);Strings3=s1.substring(4,6);charc1=s1.charAt(3);System.out.println(s2.concat(String.valueOf(c1)).concat(s3));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:“ABCDEFG”b.Prints:“ABCEFG”c.Prints:“ABCDDEFG”d.Prints:“ABCDEF”e.Prints:“ABCEF”f.Prints:“ABCDDEF”g.Compile-timeerrorh.Run-timeerrori.Noneoftheabove———————————Question15classMWC118{publicstaticvoidmain(String[]args){byte[]b={‘a’,‘b’,‘c’};char[]c={‘a’,‘b’,‘c’};Strings=“abc”;StringBuffersb=newStringBuffer(“abc”);byteb2=‘a’;charc2=‘a’;Strings1=newString(b);//1Strings2=newString(c);//2Strings3=newString(s);//3Strings4=newString(sb);//4Strings5=newString(b2);//5Strings6=newString(c2);//6}}Compile-timeerrorsaregeneratedatwhichlines?a.1b.2c.3d.4e.5f.6———————————Question16classMWC101{publicstaticvoidmain(String[]args){Strings1=“A”,s2=“a”,s3=“b”;s1.toLowerCase();s3.replace(‘b’,’a’);System.out.print((s1.equals(s2))+“,”+(s2.equals(s3)));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question17classMWC200{publicstaticvoidmain(String[]args){Strings1=“ABC”;StringBuffers2=newStringBuffer(s1);System.out.print(s2.equals(s1)+“,”+s1.equals(s2));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question18classMWC102{publicstaticvoidmain(String[]args){Strings1=“ABCDE”;System.out.print(s1.substring(1,2)+s1.substring(3));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:AABCb.Prints:ACDEc.Prints:ABABCd.Prints:ABCDEe.Prints:BABCDf.Prints:BDEg.Prints:BCABCDh.Prints:BCDEi.Compile-timeerrorj.Run-timeerrork.Noneoftheabove———————————Question19classMWC201{publicstaticvoidmain(String[]args){Strings1=newString(“ABC”),s2=newString(“ABC”);StringBuffersb1=newStringBuffer(s1);StringBuffersb2=newStringBuffer(s2);System.out.print(s1.equals(s2)+“,”+sb1.equals(sb2));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question20classMWC104{publicstaticvoidmain(String[]args){char[]c={‘a’,’b’,’c’,’d’};Strings1=newString(c);booleanb=true;for(inti=0;i<s1.length;i++){b&=(c[i]==s1.charAt(i));}System.out.print(b);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:falseb.Prints:truec.Compile-timeerrord.Run-timeerrore.Noneoftheabove———————————Question21classMWC202{publicstaticvoidmain(String[]args){StringBuffersb1=newStringBuffer(“ABC”);StringBuffersb2=newStringBuffer(“ABC”);System.out.print((sb1==sb2)+”,”+sb1.equals(sb2));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question22classMWC203{publicstaticvoidmain(String[]args){Strings1=newString(“ABC”),s2=newString(“ABC”);StringBuffersb1=newStringBuffer(s1);StringBuffersb2=newStringBuffer(s2);booleanb1=s1.hashCode()==s2.hashCode();booleanb2=sb1.hashCode()==sb2.hashCode();System.out.print(b1+“,”+b2);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,falseb.Prints:false,truec.Prints:true,falsed.Prints:true,truee.Compile-timeerrorf.Run-timeerrorg.Noneoftheabove———————————Question23classMWC109{publicstaticvoidmain(Stringargs[]){Stringa=“A”,b=“B”,c=a+b,d=a+b;System.out.print(((a+b)==(a+b))+“,”);System.out.print((c==d)+“,”);System.out.print(c.equals(d));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:false,false,falseb.Prints:false,false,truec.Prints:false,true,falsed.Prints:false,true,truee.Prints:true,false,falsef.Prints:true,false,trueg.Prints:true,true,falseh.Prints:true,true,true———————————Question24classMWC116{publicstaticvoidmain(String[]args){Strings1=”BCDE“;System.out.print(‘A’+s1.trim()+‘F’);}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:ABCDEFb.Prints:ABCDEFc.Prints:ABCDEFd.Prints:ABCDEFe.Prints:ABCDEFf.Compile-timeerrorg.Run-timeerrorh.Noneoftheabove———————————Question25classMWC117{publicstaticvoidmain(String[]args){System.out.print(String.valueOf(1)+String.valueOf(2));Strings1=“S1”;Strings2=s1.toString();System.out.print(“,”+(s1==s2));}}Whatistheresultofattemptingtocompileandruntheprogram?a.Prints:3,falseb.Prints:3,truec.Prints:12,falsed.Prints:12,truee.Compile-timeerrorf.Run-timeerrorg.NoneoftheaboveNo.AnswerRemark1acdappenddeleteinsertTheStringBufferclasshasmethodsnamedappend,deleteandinsert,buttheStringclassdoesnot.AtypicaltrickquestionwillattempttoinvokeStringBuffermethodsonaStringinstance.2hNoneoftheabove.Stringsareimmutable.NomethodoftheofaStringclasswillchangethecontentsofaStringinstance.SomeStringmethodssuchasconcat,replace,substringandtrimwillreturnanewStringwiththedesiredmodifications.TheStringBuffermethodsappend,deleteandinsertarenotmembersofthejava.lang.Stringclass.AtypicaltrickquestionwillattempttoinvokeStringBuffermethodsonaStringinstance.3fPrints:ABABCABCInstancesoftypeStringBufferarenotimmutable.Inmethodm1,themethodinvocationexpressions1.append(“B”)appendstheStringliteral“B”totheStringBufferinstancereferencedbyvariables1.TheappendmethodreturnsareferencetothesameStringBufferinstanceonwhichitisinvoked;sotheassignmentexpressions1=s1.append(“B”)doesnotassignadifferentreferencevaluetovariables1.Thenewvalue,AB,isprintedinmethodm1.Inmethodm2,themethodinvocationexpressions1.append(“C”)appendstheStringliteral“C”totheStringBufferinstancereferencedbyvariables1.Thenewvalue,ABC,isprintedinmethodm2.Inthemainmethod,acopyofthereferencevaluecontainedbythereferencevariables1ispassedasanargumenttomethodsm1andm2.SinceStringBufferinstancesarenotimmutable,methodsm1andm2areabletochangetheoriginalStringBufferinstancethatisdeclaredinthemainmethod.Thenewvalue,ABC,isprintedinthemainmethod.4gvalueOfThevalueOfmethodisstatic.ItreturnsaStringrepresentationoftheargument.TheStringBuffermethodsappend,deleteandinsertarenotmembersofthejava.lang.Stringclass.AtypicaltrickquestionwillattempttoinvokeStringBuffermethodsonaStringinstance.5cPrints:ABCABInstancesoftypeStringBufferarenotimmutable.Inmethodm1,themethodinvocationexpressions1.append(“B”)appendstheStringliteral“B”totheStringBufferinstancereferencedbytheparametervariables1.Thenewvalue,AB,isprintedinmethodm1.Thereferencevariables1declaredinthemainmethodreferstothesamemodifiedStringBufferinstance.Inmethodm2,theclassinstancecreationexpressionnewStringBuffer(“C”)createsanewinstanceoftypeStringBuffercontainingthevalueC.Theassignmentexpressions1=newStringBuffer(“C”)assignsareferencetothenewStringBufferinstancetothemethodparametervariables1.ThevalueCisprintedinmethodm1.Themethodlocalreferencevariables1inthemainmethodremainsunchangedbytheassignmentexpressioncontainedinmethodm2.Inthemainmethod,acopyofthereferencevaluecontainedbythereferencevariables1ispassedasanargumenttomethodsm1andm2.SinceStringBufferinstancesarenotimmutable,methodm1isabletochangetheoriginalinstanceoftheStringBufferdeclaredinthemainmethod.Sincereferencesarepassedbyvalue,methodm2cannotchangethereferencevariabledeclaredinthemainmethod.Regardlessofanythingthathappensinmethodm2,thereferencevariables1thatisdeclaredinthemainmethodwillcontinuetoreferencetheoriginalStringBufferinstance.Sincethecontentoftheoriginalinstancewasmodifiedbymethodm1,thenewvalue,AB,isprintedinthemainmethod.6bPrints:ABCTheStringinstancereferencedbys2ispassedtothem1methodbypassingthevalueofthereference.Thereferencevalueusedinmethodm1isalocalcopyofthereference.Ifthelocalcopyusedinmethodm1ischanged,thentheoriginalreferencevariableinthemainmethodremainsunchanged.7bPrints:ABCStringsareimmutable.NomethodwillchangethecontentsofaStringinstance.SomeStringmethodssuchasconcat,replace,substringandtrimwillreturnanewStringinstancewiththedesiredmodifications.Inthiscase,theStringinstancesreturnedbythemethodstrimandconcatareignored.8gCompile-timeerrorTheStringBufferclasshasanappendmethod,buttheStringclassdoesnot.Acompile-timeerrorisgeneratedduetotheattempttoinvoketheappendmethodonaninstanceoftypeString.9eCompile-timeerrorTheStringBufferclasshasaninsertmethod,buttheStringclassdoesnot.Acompile-timeerrorisgeneratedduetotheattempttoinvoketheinsertmethodonaninstanceoftypeString.10dPrints:AZAInstancesoftypeStringareimmutable.Inmethodm1,thereplacemethodreturnsanewinstanceoftypeStringthatcontainsthevalueY,buttheStringinstancereferencedbys1remainsunchanged.Theoriginalvalue,A,isprintedinmethodm1.Inmethodm2,thereplacemethodreturnsanewinstanceoftypeStringthatcontainsthevalueZ,andareferencetothenewinstanceisassignedtoreferencevariables1.Thenewvalue,Z,isprintedinmethodm2.Inthemainmethod,acopyofthereferencevaluecontainedbythereferencevariables1ispassedasanargumenttomethodsm1andm2.SinceStringinstancesareimmutable,methodsm1andm2cannotchangetheoriginalStringinstancethatisdeclaredinthemainmethod.Sincereferencesarepassedbyvalue,methodsm1andm2cannotchangethereferencevariabledeclaredinthemainmethod.Regardlessofanythingthathappensinmethodsm1andm2,thereferencevariables1thatisdeclaredinthemainmethodwillcontinuetoreferencetheoriginalStringinstancethatcontainsthevalueA.11dPrints:ABAbAbInstancesoftypeStringareimmutable.Inmethodm1,thetoUpperCasemethodreturnsanewinstanceoftypeStringthatcontainsthevalueAB,andareferencetothenewinstanceisassignedtoreferencevariables1.Thenewvalue,AB,isprintedinmethodm1.Inmethodm2,thetoLowerCasemethodreturnsanewinstanceoftypeStringthatcontainsthevalueab,buttheStringinstancereferencedbys1remainsunchanged.Theoriginalvalue,Ab,isprintedinmethodm2.Inthemainmethod,acopyofthereferencevaluecontainedbythereferencevariables1ispassedasanargumenttomethodsm1andm2.SinceStringinstancesareimmutable,methodsm1andm2cannotchangetheoriginalStringinstancethatisdeclaredinthemainmethod.Sincereferencesarepassedbyvalue,methodsm1andm2cannotchangethereferencevariabledeclaredinthemainmethod.Regardlessofanythingthathappensinmethodsm1andm2,thereferencevariables1thatisdeclaredinthemainmethodwillcontinuetoreferencetheoriginalStringinstancethatcontainsthevalueAb.12dPrints:1212Thereferencevariables3isinitializedwithareferencetoaninstanceoftypeStringcontainingthevalue“12”.Theexpressions1+=s2isequivalenttotheexpressions1=s1+s2.Furthersimplificationproducess1=“1”+“2”=“12”.Theexpressions3+=s1isequivalenttotheexpressions3=“12”+“12”=“1212”.13bPrints:false,trueThereferencevariables1isinitializedwithareferencetoaninstanceoftypeStringcontainingthevalue“ABCDEFG”.Thereferencevariables2isinitializedwithareferencetoaninstanceoftypeStringcontainingthevalue“EFGHIJ”.Theexpressions3=s1.substring(4,7)initializesthereferencevariables3withareferencetoauniqueinstanceoftypeStringcontainingthevalue“EFG”.Theexpressions4=s2.substring(0,3)initializesthereferencevariables4withareferencetoauniqueinstanceoftypeStringcontainingthevalue“EFG”.Theexpressions3==s4comparestwouniquereferencevaluesandproducesthevaluefalseeventhoughs3ands4referencetwoStringinstancesthatcontainthesamevalue,“EFG”.Theexpressions3+s4producesauniqueinstanceoftypeStringcontainingthevalue“EFGEFG”.Similarly,theexpressions4+s3producesauniqueinstanceoftypeStringcontainingthevalue“EFGEFG”.Theexpression(s3+s4).equals(s4+s3)comparesthecontentsoftwouniqueinstancesoftypeStringthatcontainthevalue“EFGEFG”.Theresultofthecomparisonistrue.14dPrints:“ABCDEF”Thereferencevariables1isinitializedwithareferencetoaninstanceoftypeStringcontainingthevalue“ABCDEFG”.Theexpressions2=s1.substring(0,3)initializesthereferencevariables2withareferencetoauniqueinstanceoftypeStringcontainingthevalue“ABC”.Theexpressions3=s1.substring(4,6)createsauniqueinstanceoftypeStringcontainingthevalue“EF”.Theexpressionc1=s1.charAt(3)initializestheprimitivevariablec1withthevalue‘D’.TheexpressionString.valueOf(c1)invokesthestaticvalueOfmethodwithanargumentoftypeprimitivecharandvalue‘D’.ThevalueOfmethodcreatesanewinstanceoftypeString.Thevaluecontainedbythenewinstanceis“D”.Theexpressions2.concat(String.valueOf(c1))invokestheconcatmethodontheinstanceoftypeStringreferencedbythevariables2.Theinstancereferencedbys2containsthevalue“ABC”.Thevaluecontainedbytheargumentis“D”.TheresultoftheconcatenationoperationisanewinstanceoftypeStringcontainingthevalue“ABCD”.Theexpressions2.concat(String.valueOf(c1)).concat(s3)invokestheconcatmethodonthepreviouslycreatedinstancecontainingthevalue“ABCD”.Theinstancereferencedbythearguments3containsthevalue“EF”.TheresultoftheconcatenationoperationisanewinstanceoftypeStringcontainingthevalue“ABCDEF”.15ef56TheoverloadedcontructorsfortheStringclassacceptaparameteroftypeStringorStringBufferoranarrayofbyteorchar.Thereisnoconstructorthatwillacceptaprimitivebyteorchar.PleasenotethatifyouwanttoconvertaprimitivetoaStringthenyoucanusethestaticString.valueOfmethod.16aPrints:false,falseStringinstancesareimmutable.StringmethodssuchasString.toLowerCaseandString.replacecreateandreturnanewStringinstance.Theinstanceonwhichthemethodhasbeeninvokedremainsunchanged.Intheprogram,theequalsmethodisinvokedontheoriginalinstancesofs1ands2–notthenewinstances.17aPrints:false,falseStringBuffer.equalsdoesnotoverridetheObject.equalsmethod;soStringBuffer.equalsjustcomparesreferencevalues.Sincethereferencevariabless1ands2refertodifferentobjects,theequalsmethodoftheStringBufferinstances2returnsthevaluefalse.TheString.equalsmethoddoesoverridetheObject.equals,method.TheString.equalsmethodreturnsfalseanytimetheargumentisnotaninstanceoftypeString.Themethodinvocationexpressions1.equals(s2)producesthevaluefalse,becausetheargumentisaninstanceoftypeStringBuffer.18fPrints:BDEThesubstringmethodreturnsanewStringinstancethatisasubstringoftheoriginalStringinstance.ThesingleparameterformofthesubstringmethodcreatesanewStringthatbeginsattheindexspecifiedbytheargumentvalue.Thetwoparameterformcreatesasubstringthatstartsattheindexofthefirstparameterandendsattheindexofthesecondparameter.Thecharacteratthestartindexisincludedinthesubstring,butthecharacterattheendindexisnot.19cPrints:true,falseString.equalsoverridesObject.equals.TheString.equalsmethodcomparesthecontentsoftheStringinstances–notthereferences.Sincethecontentsofs1ands2arethesame,themethodinvocationexpressions1.equals(s2)producesthevaluetrue.TheStringBuffer.equalsmethoddoesnotoverrideObject.equals.TheStringBuffer.equalsmethodcomparesthereferencevalues–notthecontentsoftheStringBufferinstances.Sincethereferencevaluessb1andsb2aredifferent,themethodinvocationexpressionsb1.equals(sb2)producesthevaluefalse.20cCompile-timeerrorAcompile-timeerrorisgeneratedduetotheattempttoaccessthelengthmethodoftheStringclassasthoughitwereavariable.21aPrints:false,falseStringBuffer.equalsdoesnotoverrideObject.equals.TheStringBuffer.equalsmethodcomparesthereferencevalues–notthecontentsoftheStringBufferinstances.Theexpressionssb1==sb2andsb1.equals(sb2)producethesameresults.22cPrints:true,falseTheStringBufferclassdoesnotoverridetheequalsandhashCodemethodsoftheObjectclass.TheObject.equalsmethoddoesnotreturnthevaluetrueunlesstheargumentisareferencetothesameobjectonwhichthemethodisinvoked.Forexample,themethodinvocationexpressionobj1.equals(obj2)onlyproducesthevaluetruewhenobj1==obj2isalsotrue.TheObject.hashCodemethodtendstoreturndistincthashcodevaluesfordistinctobjectsregardlessoftheinternalcontentsoftheobject.Supposethatthereferencevariablessb1andsb2areoftypeStringBuffer.Theexpressionsb1.hashCode()==sb2.hashCode()willnotproducethevaluetrueunlesstheexpressionsb1==sb2isalsotrue.TheStringclassdoesoverridetheequalsandhashCodemethodsoftheObjectclass.TheString.hashCodemethodreturnsahashcodevaluethatiscomputedbasedonthecontentsoftheStringobject.Supposethatthereferencevariabless1ands2areoftypeString.Theexpressions1.hashCode()==s2.hashCode()mustproducethevaluetrueanytimethemethodinvocationexpressions1.equals(s2)producesthevaluetrue.23bPrints:false,false,trueAtrun-time,theexpressiona+bisevaluatedfourtimes.EachevaluationproducesanewStringinstancecontainingthevalue“AB”.Eachofthefourinstanceshasauniquereference.Ifanytwoofthefourinstancesappearastheoperandsoftheequalityoperator,thentheresultisalwaysfalse.Theleftandrightoperandsoftheequalityexpression(a+b)==(a+b)referenceuniqueStringinstances.Sincethetworeferencesarenotthesame,theequalityexpressionproducesthevaluefalse.Similarly,theexpressionc==dproducesthevaluefalse.SincethecontentsoftheStringinstancesreferencedbycanddarethesame,themethodinvocationexpressionc.equals(d)producesthevaluetrue.24ePrints:ABCDEFThetrimmethodcreatesanewStringinstancewiththeleadingandtrailingwhitespaceremoved.25dPrints:12,trueThevalueOfmethodreturnsaStringrepresentationoftheinputparameter.TheinputparametermaybeoftypeObject,char[],oranyprimitivetype.ThetoStringmethodreturnsareferencetotheexistingStringinstance.ItdoesnotcreateanewinstanceoftheString.LDAP,includingJavacodingLightweightDirectoryAccessProtocol(LDAP)INDEX1.INTRODUCTIONTOLDAP2.OVERVIEWOFLDAP3.HOWDIRECTORYSERVICEWORK4.HOWLDAPSERVERSORGANIZEDIRECTORIES5.HOWLDAPCLIENTSANDSERVERWORK6.FUNCTIONALMODEL§Authentication§Interrogation§Update7.LDAPDATAINTERCHANGEFORMAT(LDIF)8.ENVIRONMENT9.LABEXERCISES§AuthenticatinganEntry§AddinganEntry§DeletinganEntry10.ADVANTAGESOFLDAP11.BESTLDAPSERVERS12.ReferencesINTRODUCTIONTOLDAPLDAP(LightweightDirectoryAccessProtocol)istheInternetdirectoryprotocol.DevelopedattheUniversityofMichiganatAnnArborinconjunctionwiththeInternetEngineeringTaskForce,LDAPisaprotocolforaccessingandmanagingdirectoryservicesLightWeightDirectoryAccessProtocol(LDAP)isanopennetworkprotocolstandarddesignedtoprovideaccesstodistributeddirectories.LDAPprovidesamechanismforqueryingandmodifyinginformationthatresidesinadirectoryinformationtree(DIT).Adirectoryinformationtreetypicallycontainsabroadrangeofinformationaboutdifferenttypesofnetworkobjectsincludingusers,printers,applications,andothernetworkresources.LDAPisdescribedthroughfourbasicmodels:Information,Naming,Functional,andSecurity.Thecombinationofthesemodelsintroducesanomenclaturethatdescribesentriesandtheirattributes,andprovidesmethodstoqueryandmanipulatetheirvalues.TheLDAPstandarddefines…ØAnetworkprotocolforaccessinginformationinthedirectoryØAninformationmodeldefiningtheformandcharacteroftheinformationØAnamespacedefininghowinformationisreferencedandorganizedØAnemergingdistributedoperationmodeldefininghowdatamaybedistributedandreferenced(v3)ØBoththeprotocolitselfandtheinformationmodelareextensible.TheLDAPprotocolisthevehicleforaccessingthedirectory…ØItdefinestheoperationsonemayperform…E.g.search,add,delete,modify,changenameØItdefineshowoperationsanddataareconveyedOVERVIEWOFLDAPBeforeknowingwhatareLDAPandLDAPServer?Havealookanoverviewofacustomernetworklooklike.ØTHELEGACYWAY:Previoussoftwarevendorsusetoprovideaserviceintheirapplicationtomanageuserandgroupinformation.Theresultofthisproliferationofdirectoriesisamanagementoverheadforcustomers.Additionaldirectoriesmakelifemorecomplicatedforcustomersanddrainyourdevelopmenttimeandcosts.BeforeNetscape’sDirectoryServerintroduced,thecustomers’networkprobablylookedlikethis:ØTHEBESTWAY:Insteadofaddingmoresystemsmanagementoverhead,youleverageyourcustomers’singlesourceofuser,groupandsecurityinformation.TheNetscapeDirectoryServerprovidesasinglerepositoryforthekindofinformation,whichmakesenterprisesofanysizeruntheirsystemsefficiently.Providingthisintegrationaspartofyourenterprisesolutiongivesyourcustomersmorefeaturesandlessmanagementoverhead.OneormoreLDAPserverscontainthedatathatmakeuptheLDAPdirectory.AnLDAPclientconnectstoanLDAPserverandsubmitsaquerytorequestorupdatedirectoryinformation.Aslongasaccessrightsaregrantedtotheclient,theLDAPserverrespondstothequery.TheLDAPservermayalsoreferthequerytoanotherLDAPserverforresponse.AnLDAPdirectorystoresinformationinobject-orientedhierarchiesofentries.Eachentryisuniquelyidentifiedbyadistinguishedname,orDN.theDNconsistsofthenameoftheentryplusapathofnamestracingtheentrybacktothetopofthedirectoryhierarchy.HOWDIRECTORYSERVICEWORKAdirectoryconsistsofentriescontainingdescriptiveinformation.Forexample,adirectorymightcontainentriesdescribingpeopleornetworkresources,suchasprintersorfaxmachines.Thedescriptiveinformationisstoredintheattributesoftheentry.Eachattributedescribesaspecifictypeofinformation.Forexample,attributesdescribingapersonmightincludetheperson’sname(commonname,orcn),telephonenumber,andemailaddress.TheentryforBarbaraJensenmighthavethefollowingattributes:cn:BarbaraJensenmail:[email protected]:555-1212roomNumber:3995Anattributecanhavemorethanonevalue.Forexample,apersonmighthavetwocommonnames(aformalnameandanickname)ortwotelephonenumbers:cn:JenniferJensencn:JennyJensenmail:[email protected]:555-1213telephoneNumber:555-2059roomNumber:3996Entriesthemselvesare“typed”.ThisisaccomplishedbytheobjectClassattribute…cn:JenniferJensencn:JennyJensenmail:[email protected]:555-1213Objectclass=personAttributescanalsocontainbinarydata.Forexample,attributesofapersonmightincludetheJPEGphotoofthepersonorthevoiceofthepersonrecordedinanaudiofileformat.Though,theremaybeimplementation-dependentlimitationsontheamountofdataofagiventypeyoucanstore.·Differenttypesofdataareheldinattributesofdifferenttypes.·Eachattributetypehasaparticularsyntax.·TheLDAPstandarddescribesarichsetofstandardattributetypesandasyntaxes(basedonX.500’sset).·Plus,youmaydefineyourownattributes,syntaxes,andevenobjectclasses—youcantailoryourdirectorytoyourownsite’sspecificneeds.Entrynamesarethereforeveryflexible,becausetheyarebasedonattributetypesandvalues.Adirectoryserviceisadistributeddatabaseapplicationdesignedtomanagetheentriesandattributesinadirectory.Adirectoryservicealsomakestheentriesandattributesavailabletousersandotherapplications.TheNetscapeDirectoryServerisanexampleofadirectoryservice.Forexample,ausermightusethedirectoryservicetolookupsomeone’stelephonenumber.Anotherapplicationmightusethedirectoryservicetoretrievealistofemailaddresses.LDAPisaprotocoldefiningadirectoryserviceandaccesstothatservice.LDAPisbasedonaclient-servermodel.LDAPserversprovidethedirectoryservice,andLDAPclientsusethedirectoryservicetoaccessentriesandattributes.AnexampleofanLDAPserveristheNetscapeDirectoryServer,whichmanagesandprovidesinformationaboutusersandorganizationalstructuresofusers,suchasgroupsanddepartments.ExamplesofLDAPclientsmightincludetheHTTPgatewaytotheNetscapeDirectoryServer,NetscapeNavigator,andNetscapeCommunicator.Thegatewayusesthedirectoryservicetofind,update,andaddinformationaboutusers.HOWLDAPSERVERSORGANIZEDIRECTORIESBecauseLDAPisintendedtobeaglobaldirectoryservice,dataisorganizedhierarchically,startingatarootandbranchingdownintoindividualentries.Atthetoplevelofthehierarchy,entriesrepresentlargerorganizations.Undertheselargerorganizationsinthehierarchymightbeentriesforsmallerorganizations.Thehierarchymightendwithentriesforindividualpeopleorresources.Figure1.1illustratesanexampleofahierarchyofentriesinanLDAPdirectoryservice.Figure1.1AhierarchyofentriesinthedirectoryEachentryisuniquelyidentifiedbyadistinguishedname.TheDistinguishedNameconsistsofaseriesofRelativeDistinguishedNames(isuniquewithinitscontainer.TheRDNconsistsofanattributetypeandavalue,andisformattedas::==‘=’)andservesasaprimarykeyforanobjectinthedirectoryinformationtree.Eachnamingcomponentrepresentsabranchinthedirectoryinformationtree.ADistinguishedNameisanalogoustotheabsolutepathnametoafileintheWindowsfilesystem,forexample,bjensenandkjensenaredifferentuserIDsthatidentifydifferententriesatthesamelevelandapathofnamesthattracetheentrybacktotherootofthetree.Forexample,thismightbethedistinguishednameforthebjensenentry:uid=bjensen,ou=People,o=Airius.comHere,uidrepresentstheuserIDoftheentry,ourepresentstheorganizationalunitinwhichtheentrybelongs,andorepresentsthelargerorganizationinwhichtheentrybelongs.Thefollowingdiagramshowshowdistinguishednamesareusedtoidentifyentriesuniquelyinthedirectoryhierarchy.Figure1.2AnexampleofadistinguishednameinthedirectoryThedatastoredinadirectorycanbedistributedamongseveralLDAPservers.Forexample,oneLDAPserveratAirius.commightcontainentriesrepresentingNorthAmericanorganizationalunitsandemployees,whileanotherLDAPservermightcontainentriesrepresentingEuropeanorganizationalunitsandemployees.SomeLDAPserversaresetuptoreferrequeststootherLDAPservers.Forexample,iftheLDAPserveratAirius.comreceivesarequestforinformationaboutanemployeeinaPacificRimbranch,thatservercanrefertherequesttotheLDAPserveratthePacificRimbranch.Inthisway,LDAPserverscanappeartobeasinglesourceofdirectoryinformation.EvenifanLDAPserverdoesnotcontaintheinformationyourequest,theservercanreferyoutoanotherserverthatdoescontaintheinformation.HOWLDAPCLIENTSANDSERVERWORKIntheLDAPclient-servermodel,LDAPservers(suchastheNetscapeDirectoryServer)makeinformationaboutpeople,organizations,andresourcesaccessibletoLDAPclients.TheLDAPprotocoldefinesoperationsthatclientsusetosearchandupdatethedirectory.AnLDAPclientcanSearch,Add,Update,DeleteandRenameentriesinadirectory.Forexample,toupdateanentryinthedirectory,anLDAPclientsubmitsthedistinguishednameoftheentrywithupdatedattributeinformationtotheLDAPserver.TheLDAPserverusesthedistinguishednametofindtheentryandperformsamodifyoperationtoupdatetheentryinthedirectory.ToperformanyoftheseLDAPoperations,anLDAPclientneedstoestablishaconnectionwithanLDAPserver.TheLDAPprotocolspecifiestheuseofTCP/IPportnumber389,althoughserversmayrunonotherports.TheLDAPprotocolalsodefinesasimplemethodforauthentication.LDAPserverscanbesetuptorestrictpermissionstothedirectory.BeforeanLDAPclientcanperformanoperationonanLDAPserver,theclientmustauthenticateitselftotheserverbysupplyingadistinguishednameandpassword.Iftheuseridentifiedbythedistinguishednamedoesnothavepermissiontoperformtheoperation,theserverdoesnotexecutetheoperation.FUNCTIONALMODELThefunctionalmodelconsistsofnineoperationsinthreeareas:·AuthenticationallowstheclienttoproveitsidentitytotheDSA.·Interrogationprovidesamethodfortheclienttointerrogatethedirectoryinformationtree.·Updatedefinesamechanismfortheclienttoaddormodifyinformationinthedirectoryinformationtree.AuthenticationTheauthenticationmodelincludesthefollowingoperations:·Open.Thiscommandcreatesandinitializesaconnectionblock,thenopenstheconnectiontotheDSA.·Bind.ThiscommandinitiatesaprotocolsessiontotheDSA.Afterasessionisestablished,amethodofauthenticationisnegotiatedbetweentheDSAandtheclient.WhentheclientisauthenticatedbytheDSA,theDSAreturnsaBindresponsetotheclient.·Unbind.ThiscommandterminatesanLDAPsessionbetweentheclientandtheDSA.InterrogationTheinterrogationmodelincludesthefollowingoperations:·Search.Thisoperationisusedtoselectentriesfromaspecificregionofthedirectoryinformationtreebasedoncustomizedcriteriacalledasearchfilter.Thefollowingargumentsareusedtoperformthesearch:·Searchbase.Thedistinguishednameofthesearchbaseobject.Thisdefinesthelocationinthedirectoryfromwhichtobeginsearching.·Searchscope.Defineshowdeeptosearchwithinthesearchbase.Thefollowingoptionsareavailable:·Baseorzerolevel.Searchesthebaseobjectonly.·Onelevel.Searchesobjectsimmediatelysubordinatetothebaseobject,butexcludesthebaseobject.·Subtree.Searchestheentiresubtreeofwhichthebasedistinguishednameisthetopmostobject,includingthatbaseobject.·Filter.Allowscertainentriesinthesubtreeandexcludesothers.ThefilteroperatorsarelistedinTable1.·Selection.Indicateswhatattributestoreturnfromobjectsthatmatchthefilter.·Optionalcontrols.Theseaffecthowthesearchisprocessed.LDAPsearchfilters,asdefinedinRFC2254,allowyoutodefinespecificsearchcriteria,resultinginmoreefficientsearches.Forexample,youmightbeinterestedinalltheuserswhosesurnameisSmith,oryoumightwanttofindoutalltheteammemberswhoreporttothemanagernamedMaryJones.ThesearchfiltersarerepresentedbyUTF-8strings.Compare.ThisoperationreturnsaBooleanresponsebaseduponacomparisonofanentry’sattributevalue.TableofLDAPFilterOperatorsLDAPFilterOperatorDescription=Equal~=ApproximatelyEqual=Greaterthanorequalto&AND|OR!NOTUpdateTheupdatemodelconsistsofthefollowingoperations:·Add.ThiscommandcreatesanobjectinthedirectoryinformationtreebasedoninformationprovidedbytheclienttotheDSA.TheinformationthatispassedtotheDSAmustmeettheconditionsthatareimposedonentrycreationthroughtheclassesthataredefinedintheschema.·Modify.Thiscommandallowstheclienttomodifyanentry’sattributes.Modificationofattributesincludescreating,modifying,anddeletingtheattributes.·ModifyRDN.Thiscommandprovidesamechanismforanentrytobemovedinthedirectoryinformationtree.BymodifyingtheRDNcomponentsofanentry,theentryiseffectivelymovedtoanewcontainerwithintheDIT.·Delete.Thiscommandprovidesamethodforaclienttoremoveanentryfromthedirectoryinformationtree.Thesuccessofanentrymodificationisdependentontheschema’sconstraintsandtheaccesspermissionoftheclient.LDAPDataInterchangeFormat(LDIF)LDAPDataInterchangeFormat(LDIF)isanInternetstandardthatdefinesafileformattoperformbatchimportandexportoperationsfordirectoriesthatconformtoLDAPstandards.AnLDIFfileconsistsofaseriesofrecordsthataredividedbylineseparators.Arecorddescribeseitherasingledirectoryentryorasetofmodificationstoasingledirectoryentryandconsistsofoneormorelinesinthefile.TheLDAPDataInterchangeFormat(LDIF)(file)formathasacommand-lineutilitycalledLDIFDirectoryExchange(LDIFDE)thatyoucanusetoadd,modify,rename,anddeletedirectoryobjects.Forexample,youcanuseLDIFDEtoextendtheschema,exportActiveDirectoryuserandgroupinformationtootherapplicationsorservices,andtopopulateActiveDirectorywithdatafromotherdirectoryservices.YouruntheLDIFDEcommandENVIRONMENTBeforecompilinganyappletsorapplications,makesuretoaddthefollowingtoyourCLASSPATHenvironmentvariable:Øthepackages/ldapjdk.jarfile,whichcontainsthemainLDAPJavaclassesØthepackages/ldapfilt.jarfile,ifyouplantouseanyoftheLDAPJavafilterclassesØtheclassesdirectory,ifyouplantouseanyoftheLDAPJavaBeanclassesSettingthePath:1.D:\LDAP-SDK\EXAMPLES\JAVA\2.Setpath=%PATH%;D:\jdk1.2.2\bin;D:\jdk1.2.2\lib\tools.jar3.Seeifyoucanrunjavac4.Setclasspath=%CLASSPATH%;LABEXERCISESEXERCISE1:ØWriteaprogramtoAuthenticateaUserintheDirectorySubtree.ØUsingJavaLanguagesavetheprogramwith.java.ØCompiletheprogram,youget.classfile.ØStarttheDirectoryServer.ØRuntheprogram.Note:BeforerunningtheseprogramsandduringtheinstallationitselfwewillspecifytheMGR_DN(“cn=directoryManager”)andMGR_PWD(“secretdog”)SOLUTION1:importnetscape.ldap.*;publicclassauthenticate{publicstaticbooleanauthenticate(Stringuid,Stringpwd){booleanstatus=false;LDAPConnectionld=newLDAPConnection();LDAPEntryfindEntry=null;Stringdn=null;StringMY_HOST=“localhost”;intMY_PORT=389;StringMY_SEARCHBASE=“ou=People,dc=miracle6”;StringMY_FILTER=“uid=”+uid;Try{ld.connect(MY_HOST,MY_PORT);LDAPSearchResultsres=ld.search(MY_SEARCHBASE,LDAPConnection.SCOPE_SUB,MY_FILTER,null,false);if(res.hasMoreElements()){findEntry=res.next();dn=findEntry.getDN();System.out.println(“dnis“+dn);//preventanonymousconnectionsif((dn==“”)||(pwd==“”)){returnfalse;}//nowattempttobindtoserverld.authenticate(dn,pwd);//ifld.authenticatedoesn’tthrowanexceptionwepassedstatus=true;}}catch(LDAPExceptione){System.out.println(e.toString());}catch(Exceptionx){x.printStackTrace();}if((ld!=null)&&ld.isConnected()){try{ld.disconnect();}catch(LDAPExceptione){System.out.println(“Error:”+e.toString());}}returnstatus;}publicstaticvoidmain(Stringargs[]){if(args.length=0){sub=s.substring(i,j);i=j+1;j=s.indexOf(delimiter,i);//Restofsubstrings}sub=s.substring(i);//Lastsubstring}Nextyoucanusethismethodasbyte[]b=getAsciiBytes(s);5.StringTokenizerisoneofthemostpopularlyusedfunctioninJava.ItreallygivestheflexibilityofparsingStringswithparsingcapabilityofmultiplestringlengthdelimiter.ForexampleitcanparseStringsseparatedby“bqr”asdelimiterasfollows,StringTokenizerst=newStringTokenizer(myStr,“bqr”);Butthenthere’salwaysoverheadduringthisoperation.Sincethishastocompareeachcharacter,ifitbelongsinthesetofdelimiters.Insteadyoucanyouthismethod,ifStringsneedtobedelimitedonlybyasinglecharacter,publicstaticvoidmySimpleTokenizer()Strings,Stringdelimiter){Stringsub=null;inti=0;intj=s.indexOf(delimiter);//Firstsubstringwhile(j>=0){sub=s.substring(i,j);i=j+1;j=s.indexOf(delimiter,i);//Restofsubstrings}sub=s.substring(i);//Lastsubstring}OurTestsrevealthattheabovemethodworksalmost4timesfasterthanStringTokenizer,becauseoflessoverhead.Butusethismethodwithcaution,sinceyoumightbeloosingmaintainabilityofyourprogram.6.Don’trepeatthesamefunctioninconditionalstatements.ForExampleinsteadofwritingfor(inti=0;i<s.length;i++){charcc=s.charAt(i);}Writeitas,intj=str.length();for(inti=0;i<j;i++){charcc=s.charAt(i);}DoingthisyouhaveremovedaExtraoverheadonConditionalStatement.7.IntheStringClassprefercharAt()methodinsteadofstartsWith()method.StringclassprovidesthismethodtodecideiftheStringstartsstartswithgivenSubstring.Fromperformanceperspective,startWith()makesquiteafewcomparisonspreparingitselftocompareit’sprefixwithanotherstring.Soinsteadofwriting,if(s.startsWith(“a”)){//Dosomethinghere}writeitas,if(“a”==s.charAt(0)){//Dosomethinghere}8.Insteadofwriting,Strings=”a”;s+=“b”;s+=“c”;declareitas,Strings=”a”+“b”+“c”;SincecompilerisintelligentenoughtoreplaceabovestringwithwithStrings=“abc”insteadofcreatingnewStringobjectandappendingthemtogetherindifferentsteps.9.Don’tcreateobjectsunlessrequired.ForexampledonotdeclareDatemyDate=newDate();if(requiredCondition){//usemyDate}InsteaddeclaretheDateobjectinsidetheifcondition,sothatitisnotinitializediftherequiredConditionisfalse.Sodeclarethecodeas,if(requiredCondition){DatemyDate=newDate();//usemyDate}10.Donotdeclaretheobjectstwice.Forexampleinthefollowingcodesnippet,publicclassx{privateVectorv=newVector();publicx(){v=newVector();}}ThecompilergeneratesthefollowingcodefortheConstructor,publicx(){v=newVector();v=newVector();}Bydefaultanythinginitializedaspublicvariables,thecodeforinitializationismovedtoconstructor.Soifyouhaveinitializedthepublicvariableoutsidethedefaultconstructor,thendonotinitializeitinsidetheConstructor.Sodeclarethecodeas,publicclassx{privateVectorv;publicx(){v=newVector();}}11.Intheconditionalstatements,theconditionsareevaluatedintheordertheyareplaced.Forexampleifwedeclareas,if(cond1||cond2){//Dosomeoperation}thenifthe“cond1”istrue,then“cond2”isneverevaluated.Itiscomparedonlyif“cond1”isfalse.Alwaystrytotakeadvantageofthisone.Forinstructionswhichrequiremoreprocessingtime,placethemattheend.ForExampledeclareitas,booleaneditmode=curStats1&&curStatus2;if(editMode||getDataStatusFromDataBase()){//dosomeoperation}IntheabovestatementgetDataStatusFromDataBase()isnotcalledifeditModeistrue.12.ForLargeScaleenterpriseapplications,itiscommontoaddnewFeaturesandremoveoldfeatures.ifpossible,iftheoldfeaturecodesarenevergoingtobeused,thenremovetheoldcode.Don’ttrytoplaceoldcodein,if(lfOldFeatureRequired){//OldCode.}thismakesthecodelargerandtakesmoremaintenancetime.AlsoItmakesitslowertoloadtheclassatruntime.13.Vectorprovidesthefollowingmethodstoinsertelements.addElementAt(e,index)addElement(e)add(e)add(index,e)Outofthesetrytoavoidusingmethods,addElementAt(e,index)andadd(index,e).Thewaythesemethodsworkis,alltheelementsaremoveddownbetweentheinsertionpointandtheendofthevector,makingspaceforthenewElement.ThesameworksfordeletingelementataParticularindex.Ifpossible,ifthesefeaturesarerequired,thentrytouseadifferentDataStructureifpossible.14.IftheapproximatesizeoftheVectorisknowinitiallythenuseit.InsteadofdeclaringVectoras,Vectorv=newVector();declareitas,Vectorv=newVector(40);orVectorv=newVector(40,25);ThismethodindicatesinitialcapacityofVectoris40andincrementby25elementsperexpansion.ThewaytheVectorisexpandedis,anewVectorofdoublethesizeofcurrentVectoriscreated,alltheElementsintheoldVectoriscopiedtothenewVectorandthentheoldVectorisdiscarded.(DuringGC).Thishasmajoreffectonperformance.SoiftheinitialsizeoftheVectorisknown,useit.SamegoesforthesizeofHashtableandrelatedDatastructures.15.AvoidusingtheEnumerationclass.ThewayEnumerationclassisusedis,for(Enumerationenum=v.elements();enum.hasMoreElements()){s=(String)enum.nextElement();//DoSomeOperation}Inthiscode,enum.hasMoreElements()takeslotofprocessingtime.Alsoforenum.nextElement(),enumerationclasshastodolotofprocessinginternallylikeincrementingtheinternalCounteretc.InsteadforretrievingelementsfromVector,hereisthepreferredway,intsize=v.size();for(inti=0;i<size;i++){s=(String)v.elementAt(i);//DoSomeOperation}16.IfthecodeisexecutinginaSingleThread,thenuseArrayListinsteadofVector.AllthemethodsinVectorareSynchronized.Forexampleforthefollowingmethods,publicObjectelementAt(intindex){returnelementData[index];}IntheVectorclass,theelementAt()methodexplicitlyverifiesthattheinternalarrayindexdoesnotfalloutofbounds.MethodsinArrayListleavesthetasktouserandarenotSynchronized.Thismakestheexecutionfaster.17.CoupleoftimesitbecomesnecessaryincodetoretrieveelementataparticularpositionintheVectorandthenremovethatElement.Codeforthisonewouldbe,e=v.elementAt(index);v.removeElementAt(index);Insuchascenario,usethefollowingcodee=v.remove(index);ThisreturnselementatindexpositionandthenremovesthatelementfromVector.ThissavescalltoelementAt()method.18.InHashtablecoupleoftimeswetrytogetElementwithparticularkeyandifitdoesnotexist,thenwetrytocreatenewElementandinsertthatElementintoHashtable.Sometimescodeiswrittenas,if(htable.containsKey(keyCode)){returnhtable.get(keyCode);}else{MyDatamd=createNewData(keyCode);htable.put(keyCode,md);returnmd;}Here,wemadeperformanceoverheadbycallingthesetwomethodsonthesameHashtable,containsKey()andget().Boththesemethodsdothesamething,exceptcontainsKey()returnstrue/falseandget()returnstheactualElement.IftheHashtableisofconsiderablesizethentheoverheadishigh.Insteadwritethecodeasfollows,if((md=(MyData)htable.get(keyCode)!=null){returnmd;}else{//insertNewElementintoHashtablehere.}19.CacheDataasmuchaspossiblebothontheServerandClientsideasmuchaspossible.ForexampledonotrytogetDatafromDatabaseeverytimewhichishardlygoingtochangeforalongtime.Eitherstoreitinlocaltextorpropertiesfilesorcacheitforapredefinedintervalonceitisread

Page 7: Daily paragraph editing terminal velocity answers

fromDatabase.20.InetAddress.getHostAddress()hasalotofnewoperations.Itcreatesalotofintermediatestringstoreturnthehostaddress.Avoidit,ifpossible.21.java.util.Datehassomeperformanceproblems,particularlywithinternationalization.Ifyoufrequentlyprintoutthecurrenttimeassomethingotherthanthe(longms-since-epoch)thatitisusuallyrepresentedas,youmaybeabletocacheyourrepresentationofthecurrenttimeandthencreateaseparatethreadtoupdatethatrepresentationeveryNseconds(Ndependsonhowaccuratelyyouneedtorepresentthecurrenttime).Youcouldalsodelayconvertingthetimeuntilaclientneedsit,andthecurrentrepresentationisknowntobestale.22.Avoidjava.lang.String.hashCode().IftheString’slengthexceeds16characters,hashCode()samplesonlyaportionoftheString.SoiftheplacesthatasetofStringsdifferindon’tgetsampledyoucanseelotsofsimilarhashvalues.Thiscanturnyourhashtablesintolinkedlists!23.GoodDesignisveryimportantforanyproject.Inmostapplications,goodperformancecomesfromgettingthearchitectureright.Usingtherightdatastructuresfortheproblemyou’resolvingisalotmoreimportantthantweakingStringoperations.Threadarchitectureisalsoimportant.(Trytoavoidwait/notifyoperations–theycancausealotoflockcontentioninsomeVMs.)Andofcourseyoushouldusecachingforyourmostexpensiveoperations.24.Thisisoneofthemostcommonmistakes.Alotofpeopledosomethinglikethefollowing:debug(“DebugComment:”+var1+var1+“CurrentValue”);publicstaticvoiddebug(Strings){System.err.println(s);}Thentheythinkthatthey’veturnedoffdebuggingoverhead.Nope!Ifthereareenoughdebuggingstatements,youcanseealotoftimespentincreatingnewstringstoevaluate“DebugComment:”+var1+var1+“CurrentValue”,whichisthentossedaftercallingdebug.25.UseResourcePoolingforThreads,Database,andNetworkConnectionsAsmentionedearlier,creatinganobjectisarelativelytime-consumingoperationthatshouldbeavoidedwhenpossible.However,creatingthreadscanalsobeslow,andcreatingnetworkconnectionsanddatabaseconnections(whichoftenusenetworkconnections)isusuallyveryslow.Insteadofhavingyourapplicationrepeatedlycreatethesetypesofconnections,youshouldconsiderobtainingorcreatingaresourcepoolmanagerthatallowsyoutoreuseexistingobjects.26.MakeMethodsFinal,Static,orPrivateTounderstandwhyfinal,static,andprivatemethodsexecutemorequicklythanmethodswithoutthosemodifiers,let’sexaminehowJavabehavesinasimplesituation.Supposeyou’regiventhefollowingcode:publicclassTest{publicstaticvoidmain(String[]args){Firsto1=newFirst();Firsto2=newSecond();if(args.length>0){callTest(o1);}else{callTest(o2);}}protectedstaticvoidcallTest(Firstf){f.testMethod();}}classFirst{publicvoidtestMethod(){System.out.println(“FirstImplementation”);}}classSecondextendsFirst{publicvoidtestMethod(){System.out.println(“Secondimplementation”);}}ThiscodedefinestwoclassescalledFirstandSecond,andSecondisasubclassofFirstandoverridestestMethod().TheTestclasscreatesaninstanceofeachofthoseclassesandpassesoneofthemtoitscallTest()methodbasedonwhetheranycommandlineparameterswerespecified.Ifnoparametersarespecified,aninstanceofSecondiscreatedandpassedtocallTest(),whilespecifyingparameterswillresultinaFirstobjectbeingusedinstead.Sinceyou’reprobablyalreadyfamiliarwithinheritanceandmethodoverriding,thebehaviorofthisclassshouldn’tcomeasasurprisetoyou.However,youmaynothavepreviouslyconsideredhowJavaisabletoprovidethisfunctionality.Inparticular,it’sworthexplaininghowJavaisabletodeterminewhichtestMethod()tocallwhenaninstanceofFirstispassedtocallTest().Afterall,theinstanceofFirstcanactuallybeaninstanceofSecond,sincethatclassisasubclassofFirst.Asyoumightexpect,JavadeterminesatexecutiontimewhichimplementationoftestMethod()shouldbeexecuted,whichisnecessarybecausethere’snoreliablewaytoknowatcompiletime.Thisapproach,wherethemethodimplementationisselectedatruntime,isknownasdynamicbinding,andalthoughitprovidesveryusefulfunctionality,itcomesataprice.Specifically,dynamicbindingisslowerthanstaticbinding,wheretheimplementationtoexecuteisselectedatcompiletime.It’ssometimesnotappropriatetodoso,butyoucanallowJavatousestaticbinding(andthusspeedupthemethodcalls)bymakingmethodsfinal,static,and/orprivate.Amethodwithoneormoreofthesemodifierscannotbeoverridden,sothereisnoneedforJavatodetermineatruntimewhichimplementationtoexecute.27.MinimizeSubclassesandMethodOverridingAnalternativeapproachtoreducingtheoverheadassociatedwithbindingistosimplyreducethenumberofsubclassesandoverriddenmethodsthatyourapplicationuses,althoughdoingsomayaffectthereusepotentialofyourcode.Creatingreusablecodeusuallyrequiresthatyoudefineclassesthatarelooselycoupledtooneanotherandcohesive,whichinturntendstopromotethecreationofsmall,focusedclassesandtheimplementationofextrafunctionalitythroughsubclasses.Unfortunately,eachsuperclass“level”thatyouaddincreasestheoverheadassociatedwithdynamicbinding,soyoumayneedtobalanceyourneedforaneffectiveobject-orienteddesignwithyourneedforanapplicationthatexecutesquickly.However,youshouldbeawarethattheoverheadassociatedwithdynamicbindingisrelativelysmall,andonlyinthemostperformance-criticalsituationsshouldyouconsidersacrificingdesignqualityforperformance.28.AvoidAccessors,Arrays,andInstances/ClassVariablesOneofthemostbasicguidelinesofgoodobject-orienteddesignistoprovideaccesstoanobject’spropertiesonlyindirectlythroughaccessormethods.However,aseachmethodcalldoesinvolvesomeoverhead,youmayoccasionallyfinditdesirabletoaccessafielddirectlyinsteadofthroughanaccessor.Thisisparticularlyacceptableifthefieldyou’reaccessingisfinalandimmutable,sinceitsinabilitytochangemakeitsinherentlythread-safe.Althougharraysareconvenientandfrequentlynecessary,thereisasmallamountofoverheadassociatedwiththeiruse,soyoushouldavoidthemifit’spossibletodosoandperformanceisverycritical.Inaddition,youshoulddefineasmanyvariablesaspossibletobelocalvariables(definedonlyinsideamethod),insteadofinstanceorclass(static)variablesasaccesstothesetypesisrelativelyslowincomparisontolocalvariables.29.MethodInliningOnewaytoimproveyourcode’sperformanceistoeliminatemethodcallscompletelybycopyingamethod’scodeintothelocationfromwhichitiscalled.Forexample,supposethatyou’regiventhefollowingtrivialapplication:publicclassInline{publicstaticvoidmain(String[]args){doublevalue=1d;for(inti=0;i<50;i++){value=multiplyByTwo(value);}System.out.println(value);}publicstaticdoublemultiplyByTwo(doublevalue){returnvalue*2;}}ThemultiplyByTwo()methodiscalledforeachiterationoftheloopinmain(),andmethodcallscanincurasignificantamountofoverhead.However,bycopyingthecodeinsidemultiplyByTwo()intomain(),youcaneliminatethatoverhead,andthisisknownasmethodinlining:publicclassInline{publicstaticvoidmain(String[]args){doublevalue=1d;for(inti=0;i<50;i++){value*=2;}System.out.println(value);}}Thistechniquecanimproveyourcode’sperformance,butyoumustbalancethatadvantageagainsttheneedforreadablecode.Inaddition,ifthemethodiscalledfrommorethanonelocation,itmaybenecessarytomakemorethanonecopyofthecodethatwasincludedinthemethodbeingeliminated.(Thiseffectivelymeansthattheinlinedmethodmustbefinal.)Unfortunately,duplicatecodemakesanapplicationmoredifficulttomaintain,andyoushouldbalancethatdisadvantageagainsttheperformancegainmadebymethodinliningaswell.Ifyourcodeisunlikelytoeverbeexaminedormodified,inliningmaybeaworthwhilewaytoimproveitsperformance,butifyourcodeismodifiedfrequently,theperformancebenefitsgainedbyinliningwillprobablybeoutweighedbythedisadvantagesassociatedwithduplicationofcode.Inmanycases,yourcodewillfallsomewherebetweenthetwoextremes(itismodifiedoccasionally),anditwon’tbeobviouswhichchoiceyoushouldmake.Unfortunately,thereisnoreliablewaytopredicthowmuchinliningwillimproveyourapplication’sperformance,sinceitwillpartlydependontheoptimizationalgorithms(ifany)usedbyyourJVM.Therefore,youmaysimplyhavetochoosewhetherornottouseinliningbycomparingtheperformanceoftwoversionsofyourcode:onewithandanotherwithoutinlinedmethods.31.UseCompressiontoImproveNetworkTransmissionTimeIftransferringlargeamountsofdataoveranetwork,itmaybepossibleforyoutocompressthedatabeforeitissentandtodecompressitafteritisreceived.OnewaythatthisiscommonlydoneistopackagecodeanditsassociatedresourcesintoaJARfile,whichcompressesthecontentsandallowsallthefilestobedownloadedsimultaneously.SendinganumberoffilesinaJARfilealsoavoidsthesignificantoverheadofopeningandclosingthenetworkconnectionforeachfile.Thejava.util.zipandjava.util.jarpackagescontainclassesforwritingandreadingtheZIP,GZIP,andJARformats.32.Usenotify()InsteadofnotifyAll()SincenotifyAll()wakesupallthreadsonanobject’swaitlist,thatmethodislessefficientthannotify().Thechoiceofwhichmethodtouseisoftendictatedbythedesignofyourapplication,butwhenit’spossibletouseeithermethodyoushouldusenotify(),sinceitwillexecutemorequickly.33.UseBatchUpdatesandPrefetchinginDatabaseApplicationsSincenetworkcallsincuragreatdealofoverhead,youshouldattempttominimizethenumberofrequeststhataresentacrossthenetwork.OnewaytodothisistouseaJDBC2.x-compliantdriverwithyourdatabaseapplicationandtakeadvantageofResultSet’sprefetchingcapabilitiesandStatement’sbatchupdatefacility.ThesefeaturesaredescribedindetailinChapter13.34.UseintInsteadofOtherPrimitiveTypesOperationsperformedonintprimitivesgenerallyexecutefasterthanforanyotherprimitivetypesupportedbyJava,soyoushoulduseintvalueswheneverpossible;charandshortvaluesarepromotedtointautomaticallybeforearithmeticoperations.35.CachetheResultsofExpensiveMethodCallsSomemethodsareslowbynaturesuchasthosethatcalculatemathematicalvalues,butit’softenpossibleto“cache”theresultsofthosemethodswhenthey’reneededmorethanonce.Forexample,thefollowingcodecallsthesqrt()methodtwice:doublea,b,c,d,e;//…a=b*Math.sqrt(e);c=d*Math.sqrt(e);Sincetheresultofthecalltosqrt()isusedtwice,it’smoreefficienttocachethevaluereturnedbythatmethodandusethecachedvaluetocompletethetwooperationsasshownbelow:doublea,b,c,d,e,f;//…f=Math.sqrt(e);a=b*f;c=d*f;36.EliminateUnnecessaryCodefromLoopBodiesThisisavariationofthepreviousrecommendation,butinsteadofmultiplestatementsusingthevaluereturnedfromamethod,thatmethodmaybecalledrepeatedlywhenexecutedwithinaloop.Forexample,thefollowingcodecallsthesqrt()methodeverytimetheloopisexecuted:double[]a,b;doublec;//…for(inti=0;i<a.length;i++){b[i]=a[i]*Math.sqrt(c);}However,aswasdoneearlier,thevaluereturnedbythesqrt()methodcanbecachedandusedwithintheloopwithoutrecalculatingiteachtime:double[]a,b;doublec,d;//…d=Math.sqrt(c);for(inti=0;i<a.length;i++){b[i]=a[i]*d;}Similarly,youshouldavoiddeclaringvariablesunnecessarilywithinloops.37.UseCompoundAssignmentOperatorsYoumightexpectthata+=b;isidenticaltoa=a+b;whenthetwoarecompiled,butthatisnotthecase.Infact,thesecausedifferentJavabytecodestobegenerated,andthesecondapproachactuallytakeslongertoexecute.Therefore,youcanmakeminorimprovementsinthespeedofyourcodebyusingcompoundoperatorssuchas+=,-=,*=,and/=.38.AvoidThrowingUnnecessaryExceptionsCreatingandthrowinganexceptionisasomewhattime-consumingprocess,soyoushouldavoidthrowingexceptionswhenit’snotnecessarytodoso.Forexample,youmightdefineamethodliketheoneshownherethatreturnsanobjectfromalistuntiltherearenomoreinthelist.Ifthemethodisinvokedwhentherearenoobjectsremaininginthelist,aNoMoreObjectsExceptionisthrown:publicObjectgetNextObject()throwsNoMoreObjectsException{//…}InsteadofthrowingaNoMoreObjectsExceptionwhentherearenoobjectsremaininginthelist,youmightchangethismethodsothatitreturnsanullvalueinstead,whichwillallowyourcodetoexecutemorequicklywhenthatoccurs.39.UseFastMethodsProvidedwithJava’sCoreClassesBybeingfamiliarwiththemethodsprovidedinJava’scoreclasses,youwillbeawareofoptionsthatareavailabletoyouforperformingpotentiallyslowoperations.Forexample,it’scommontoneedtocopyvaluesorobjectreferencesfromonearraytoanother,andyoumightdosousingthefollowingcode:int[]firstArray,secondArray;//…for(inti=0;i<firstArray.length;i++){secondArray[i]=firstArray[i];}However,amuchfasterwaytoaccomplishthesameresultistousethearraycopy()methoddefinedintheSystemclassasshownbelow:int[]firstArray,secondArray;//…System.arraycopy(firstArray,0,secondArray,0,firstArray.length);Sometips:Countingdown(i.e.for(inti=n;i>0;i–))istwiceasfastascountingup:mymachinecancountdownto144millioninasecond,butuptoonly72million.CallingMath.max(a,b)is7timesslowerthan(a>b)?a:b.Thisisthecostofamethodcall.Arraysare15to30timesfasterthanVectors.Hashtablesare2/3asfastasVectors.XMLQuestionsXMLCommonQuestionsPostedby:“koteswararaoBellam”[email protected]_chowTueMay8,20078:36am(PST)1)DifferencesBetweenXMLandHTMLXMLHTMLUserdefinabletagsDefinedsetoftagsdesignedforwebdisplayContentdrivenFormatdrivenEndtagsrequiredforwellformeddocumentsEndtagsnotrequiredQuotesrequiredaroundattributesvaluesQuotesnotrequiredSlashrequiredinemptytagsSlashnotrequired2)Whatisthedifferencebetweenwell-formedandvalidXMLdocument?W3C,intheXMLspecification,hasdefinedcertainrulesthatneedstobefollowedwhilecreatingXMLdocuments.Theexamplesofsuchrulesinclude:havingexactlyonerootelement,havingend-tagforeachstart-tag,usingsingle/doublequotesforattributevalues,andsoon.IfanXMLdocumentfollowsalltheserules,itissaidtobewell-formeddocumentandXMLparserscanbeusedtoparseandprocesssuchdocuments.DocumentTypeDefinitions(DTDs)orXMLSchemascanbeusedtodefinethestructureandcontentofaspecificclassofXMLdocuments.Thisincludestheparent-childrelationshipdetails,attributelists,datatypeinformation,valuerestrictions,etc.Inadditiontothewell-formednessrules,ifanXMLdocumentalsofollowstherulesspecifiedintheassociatedDTD/Schema,itissaidtobeavalidXMLdocument.AllvalidXMLdocumentsarewell-formed;butthereverseisnotalwaystrue,thatis,well-formedXMLdocumentsdonotnecessarilyhavetobevalid.3)WhatisDTDItistodefinethelegalbuildingblocksofanXMLdocument.Itdefinesthedocumentstructurewithalistoflegalelements.ADTDcanbedeclaredinlineinyourXMLdocument,orasanexternalreference.4)WhatistheuseofNamespacesinXML?AsXMLdoesnotpredefineanysetoftags/attributenames.Hence,itisquitepossiblethattwototallydifferentXMLdocuments,definedbytwototallydifferentpeople/companies,usethesametagname/attributename.Ifanapplicationneedstouse(merge,process,etc.)abovetwoXMLdocumentstogether,thiswouldcauseconfusionandweneedawaytodistinguishdeterministicallybetweentagswiththesamename.XMLNamespacesareusedforthispurpose.NamespacesaredefinedusingURI(UniformResourceIdentifier),andthenassociatedwiththeelement/attributenames.Namespacesarealsousedto“group”alogicallyrelatedsetofXMLvocabulary.5)WhatisXHTML?Issimplewords,XHTML,orExtensibleHTML,isHTML4withXMLrulesappliedtoit(eachbegintagmusthaveanendtag,attributevaluesinsingle/doublequotes,etc.).However,theoverallvisionofXHTMLismuchmorethanthat.InadditiontousingXMLsyntaxforHTML,XHTMLalsoenclosesspecificationssuchasXHTMLBasic(minimalsetofmodulesfordevicessuchasPDAs),XForms(representsthenextgenerationofformsfortheWeb,andseparatespresentation,logic,anddata),XMLEvents(providesXMLlanguageswiththeabilitytouniformlyintegrateeventlistenersandassociatedeventhandlers),etc.6)WhatisXPath?XMLPathLanguage(XPath)isaW3CspecificationthatdefinessyntaxforaddressingpartsofXMLdocument.XMLdocumentisconsideredasalogicaltreestructure,andsyntaxbasedonthisconsiderationisusedtoaddresselementsandattributesatanylevelintheXMLdocument.Forexample,consideringtheXMLdocumentdescribedaboveinanswertoquestion2,/abc:Employees/abc:Emp/@EmpIDXPathexpressioncanbeusedtoaccesstheEmpIDattributeunderthe(first)EmpelementundertheEmployeesdocumentelement.XPathisusedinvariousotherspecificationssuchasXSLT.XPath–alanguagefornavigatinginXMLdocuments7.WhatisXSLT?Andwhat’sitsuse?XSLTransformations(XSLT)isyetanotherpopularW3CspecificationthatdefinesXML-basedsyntax,usedtotransformXMLdocumentstoanyothertextformat,suchasHTML,text,XML,etc.XSLTstylesheetscanbeappliedonthesourceXMLdocumenttotransformXMLintosomeotherXML,ortext,HTML,oranyothertextformat.8.WhatisDOM?DocumentObjectModel(DOM)isaW3Cspecificationthatdefinesastandard(abstract)programmingAPItobuild,navigateandupdateXMLdocuments.Itisa“tree-structure-based”interface.AspertheDOMspecification,theXMLparsers(suchasMSXMLorXerces),loadtheentireXMLdocumentintomemory,beforeitcanbeprocessed.XPathisusedtonavigaterandomlyinthedocument,andvariousDOMmethodsareusedtocreateandupdate(addelements,deleteelements,add/removeattributes,etc.)theXMLdocuments.TheDocumentObjectModel(DOM)isaninterfacespecificationmaintainedbytheW3CDOMWorkgroupthatdefinesanapplicationindependentmechanismtoaccess,parse,orupdateXMLdata.InsimpletermsitisahierarchicalmodelthatallowsdeveloperstomanipulateXMLdocumentseasilyAnydeveloperthathasworkedextensivelywithXMLshouldbeabletodiscusstheconceptanduseofDOMobjectsfreely.Additionally,itisnotunreasonabletoexpectadvancedcandidatestothoroughlyunderstanditsinternalworkingsandbeabletoexplainhowDOMdiffersfromanevent-basedinterfacelikeSAX.9.WhatisSAX?SimpleAPIforXMLProcessing(SAX)isanalternativetoDOM,andcanbeusedtoparseXMLdocuments.SAXisbasedonstreamingmodel.TheSAXparserreadsinputXMLstreamandgeneratesvariousparsingeventsthatanapplicationcanhandle.Witheachparsingevent,theparsersendssufficientinformationaboutthenodebeingparsed.UnlikeDOM,SAXdoesnotbuildanin-memoryrepresentationofthesourceXMLdocument,andhenceitisanexcellentalternativewhenparsinglargeXMLdocuments,asSAXdoesnotrequirethatmuchmemory(andresources).UnlikeDOM,SAXisnotdefined/controlledbyW3C.Seect.org/fordetails.10.WhichisthebestAPItoparseahugeXMLdocument,togetpartsofdatafromtheXMLdocument?Iftherequirementisto“look-into”ahugeXMLdocumentforsomechunkofdata,SAXwouldbebetteralternative.DOMload/unloadofhugeXMLdocumentsneedslotofmemoryandotherresources,whereasSAXparsestheXMLcharacter-by-character,andhenceiswellsuitedinthiscase.11.WhatisSOAPandhowdoesitrelatetoXML?TheSimpleObjectAccessProtocol(SOAP)usesXMLtodefineaprotocolfortheexchangeofinformationindistributedcomputingenvironments.SOAPconsistsofthreecomponents:anenvelope,asetofencodingrules,andaconventionforrepresentingremoteprocedurecalls.UnlessexperiencewithSOAPisadirectrequirementfortheopenposition,knowingthespecificsoftheprotocol,orhowitcanbeusedinconjunctionwithHTTP,isnotasimportantasidentifyingitasanaturalapplicationofXML.12.CanyouwalkusthroughthestepsnecessarytoparseXMLdocuments?Superficially,thisisafairlybasicquestion.However,thepointisnottodeterminewhethercandidatesunderstandtheconceptofaparserbutratherhavethemwalkthroughtheprocessofparsingXMLdocumentsstep-by-step.Determiningwhetheranon-validatingorvalidatingparserisneeded,choosingtheappropriateparser,andhandlingerrorsareallimportantaspectstothisprocessthatshouldbeincludedinthecandidate’sresponse.13.GivesomeexamplesofXMLDTDsorschemasthatyouhaveworkedwith.AlthoughXMLdoesnotrequiredatatobevalidatedagainstaDTD,manyofthebenefitsofusingthetechnologyarederivedfrombeingabletovalidateXMLdocumentsagainstbusinessortechnicalarchitecturerules.PollingforthelistofDTDsthatdevelopershaveworkedwithprovidesinsighttotheirgeneralexposuretothetechnology.TheidealcandidatewillhaveknowledgeofseveralofthecommonlyusedDTDssuchasFpML,DocBook,HRML,andRDF,aswellasexperiencedesigningacustomDTDforaparticularprojectwherenostandardexisted.14.UsingXSLT,howwouldyouextractaspecificattributefromanelementinanXMLdocument?SuccessfulcandidatesshouldrecognizethisasoneofthemostbasicapplicationsofXSLT.Iftheyarenotabletoconstructareplysimilartotheexamplebelow,theyshouldatleastbeabletoidentifythecomponentsnecessaryforthisoperation:xsl:templatetomatchtheappropriateXMLelement,xsl:value-oftoselecttheattributevalue,andtheoptionalxsl:apply-templatestocontinueprocessingthedocument.ExtractAttributesfromXMLDataExample1.AttributeValue:WhenconstructinganXMLDTD,howdoyoucreateanexternalentityreferenceinanattributevalue?Everyinterviewsessionshouldhaveatleastonetrickquestion.AlthoughpossiblewhenusingSGML,XMLDTDsdon’tsupportdefiningexternalentityreferencesinattributevalues.It’smoreimportantforthecandidatetorespondtothisquestioninalogicalwaythanthanthecandidateknowthesomewhatobscureanswer.WhatisthedifferencebetweenSAXparserandDOMparser?DOM:createsaninternalrepresentationofanXMLdocument-NiceforsmallerXMLfiles,butbecauseofthewholeXMLfilerepresentationisinmemory,itispossiblenotusefulforverylargedocuments-goodforrepresentationofanXMLdocument.SAX:Eventdriven,soreactingwhenitfindscertainelementsintheXMLcode(e.g.tags,properties,…)goesfromtoptobottom,andifitencounterse.g.begintag,itfiresanevent.e.g.endtag,itfiresandevent.e.g.beginoffile,itfiresaneventTechInterviewscommentbyRevathi1.DOMparser–readsthewholeXMLdocumentandreturnsaDOMtreerepresentationofxmldocument.Itprovidesaconvenientwayforreading,analyzingandmanipulatingXMLfiles.Itisnotwellsuitedforlargexmlfiles,asitalwaysreadsthewholefilebeforeprocessing.SAXparser–worksincrementallyandgenerateeventsthatarepassedtotheapplication.Itdoesnotgeneratedatarepresentationofxmlcontentsosomeprogrammingisrequired.However,itprovidesstreamprocessingandpartialprocessingwhichcannotbedonealonebyDOMparser.WhatisXSL?XSLT–alanguagefortransformingXMLdocumentsXSLTisusedtotransformanXMLdocumentintoanotherXMLdocument,oranothertypeofdocumentthatisrecognizedbyabrowser,likeHTMLandXHTML.NormallyXSLTdoesthisbytransformingeachXMLelementintoan(X)HTMLelement.XSL-FO–alanguageforformattingXMLdocumentsCOMPUTERSCIENCEDataStructuresAptitude1.Whatisdatastructure?Adatastructureisawayoforganizingdatathatconsidersnotonlytheitemsstored,butalsotheirrelationshiptoeachother.Advanceknowledgeabouttherelationshipbetweendataitemsallowsdesigningofefficientalgorithmsforthemanipulationofdata.2.Listouttheareasinwhichdatastructuresareappliedextensively?CompilerDesign,OperatingSystem,DatabaseManagementSystem,Statisticalanalysispackage,NumericalAnalysis,Graphics,ArtificialIntelligence,Simulation3.Whatarethemajordatastructuresusedinthefollowingareas:RDBMS,Networkdatamodel&Hierarchicaldatamodel.RDBMS–Array(i.e.Arrayofstructures)Networkdatamodel–GraphHierarchicaldatamodel–Trees4.IfyouareusingClanguagetoimplementtheheterogeneouslinkedlist,whatpointertypewillyouuse?Theheterogeneouslinkedlistcontainsdifferentdatatypesinitsnodesandweneedalink,pointertoconnectthem.Itisnotpossibletouseordinarypointersforthis.Sowegoforvoidpointer.Voidpointeriscapableofstoringpointertoanytypeasitisagenericpointertype.5.Minimumnumberofqueuesneededtoimplementthepriorityqueue?Two.Onequeueisusedforactualstoringofdataandanotherforstoringpriorities.6.Whatisthedatastructuresusedtoperformrecursion?Stack.BecauseofitsLIFO(LastInFirstOut)propertyitremembersits‘caller’soknowswhomtoreturnwhenthefunctionhastoreturn.Recursionmakesuseofsystemstackforstoringthereturnaddressesofthefunctioncalls.Everyrecursivefunctionhasitsequivalentiterative(non-recursive)function.Evenwhensuchequivalentiterativeproceduresarewritten,explicitstackistobeused.7.WhatarethenotationsusedinEvaluationofArithmeticExpressionsusingprefixandpostfixforms?PolishandReversePolishnotations.8.Converttheexpression((A+B)*C–(D–E)^(F+G))toequivalentPrefixandPostfixnotations.PrefixNotation:^–*+ABC–DE+FGPostfixNotation:AB+C*DE––FG+^9.Sortingisnotpossiblebyusingwhichofthefollowingmethods?(a)Insertion(b)Selection(c)Exchange(d)Deletion(d)Deletion.Usinginsertionwecanperforminsertionsort,usingselectionwecanperformselectionsort,usingexchangewecanperformthebubblesort(andothersimilarsortingmethods).Butnosortingmethodcanbedonejustusingdeletion.10.Abinarytreewith20nodeshasnullbranches?21Letustakeatreewith5nodes(n=5)Itwillhaveonly6(ie,5+1)nullbranches.Ingeneral,Abinarytreewithnnodeshasexactlyn+1nullnodes.11.Whatarethemethodsavailableinstoringsequentialfiles?Straightmerging,Naturalmerging,Polyphasesort,DistributionofInitialruns.12.Howmanydifferenttreesarepossiblewith10nodes?1014Forexample,consideratreewith3nodes(n=3),itwillhavethemaximumcombinationof5different(ie,23–3=5)trees.iiiiiiivvIngeneral:Iftherearennodes,thereexist2n-ndifferenttrees.13.ListoutfewoftheApplicationoftreedata-structure?ThemanipulationofArithmeticexpression,SymbolTableconstruction,Syntaxanalysis.14.ListoutfewoftheapplicationsthatmakeuseofMultilinkedStructures?Sparsematrix,Indexgeneration.15.Intreeconstructionwhichisthesuitableefficientdatastructure?(a)Array(b)Linkedlist(c)Stack(d)Queue(e)none(b)Linkedlist16.Whatisthetypeofthealgorithmusedinsolvingthe8Queensproblem?Backtracking17.InanAVLtree,atwhatconditionthebalancingistobedone?Ifthe‘pivotalvalue’(orthe‘Heightfactor’)isgreaterthan1orlessthan–1.18.Whatisthebucketsize,whentheoverlappingandcollisionoccuratsametime?One.Ifthereisonlyoneentrypossibleinthebucket,whenthecollisionoccurs,thereisnowaytoaccommodatethecollidingvalue.Thisresultsintheoverlappingofvalues.19.TraversethegiventreeusingInorder,PreorderandPostordertraversals.Inorder:DHBEAFCIGJPreorder:ABDHECFGIJPostorder:HDEBFIJGCA20.Thereare8,15,13,14nodesweretherein4differenttrees.Whichofthemcouldhaveformedafullbinarytree?15.Ingeneral:Thereare2n-1nodesinafullbinarytree.Bythemethodofelimination:Fullbinarytreescontainoddnumberofnodes.Sotherecannotbefullbinarytreeswith8or14nodes,sorejected.With13nodesyoucanformacompletebinarytreebutnotafullbinarytree.Sothecorrectansweris15.Note:FullandCompletebinarytreesaredifferent.Allfullbinarytreesarecompletebinarytreesbutnotviceversa.21.Inthegivenbinarytree,usingarrayyoucanstorethenode4atwhichlocation?Atlocation6123––4––5RootLC1RC1LC2RC2LC3RC3LC4RC4whereLCnmeansLeftChildofnodenandRCnmeansRightChildofnoden22.SortthegivenvaluesusingQuickSort?657075808560555045Sortingtakesplacefromthepivotvalue,whichisthefirstvalueofthegivenelements,thisismarkedbold.ThevaluesattheleftpointerandrightpointerareindicatedusingLandRrespectively.6570L75808560555045RSincepivotisnotyetchangedthesameprocessiscontinuedafterinterchangingthevaluesatLandRpositions654575L8085605550R7065455080L856055R75706545505585L60R8075706545505560R85L807570WhentheLandRpointerscrosseachotherthepivotvalueisinterchangedwiththevalueatrightpointer.Ifthepivotischangeditmeansthatthepivothasoccupieditsoriginalpositioninthesortedorder(showninbolditalics)andhencetwodifferentarraysareformed,onefromstartoftheoriginalarraytothepivotposition-1andtheotherfrompivotposition+1toend.60L455055R6585L807570R55L4550R606570R80L758550L45R5560657080L75R85Inthenextpasswegetthesortedformofthearray.45505560657075808523.Forthegivengraph,drawtheDFSandBFS?BFS:AXGHPEMYJDFS:AXHPEYMJG24.ClassifytheHashingFunctionsbasedonthevariousmethodsbywhichthekeyvalueisfound.Directmethod,Subtractionmethod,Modulo-Divisionmethod,Digit-Extractionmethod,Mid-Squaremethod,Foldingmethod,Pseudo-randommethod.25.WhatarethetypesofCollisionResolutionTechniquesandthemethodsusedineachofthetype?Openaddressing(closedhashing),Themethodsusedinclude:Overflowblock,Closedaddressing(openhashing)Themethodsusedinclude:Linkedlist,Binarytree…26.InRDBMS,whatistheefficientdatastructureusedintheinternalstoragerepresentation?B+tree.BecauseinB+tree,allthedataisstoredonlyinleafnodes,thatmakessearchingeasier.Thiscorrespondstotherecordsthatshallbestoredinleafnodes.27.DrawtheB-treeoforder3createdbyinsertingthefollowingdataarrivinginsequence–92246711822451619207828.Ofthefollowingtreestructure,whichis,efficientconsideringspaceandtimecomplexities?(a)IncompleteBinaryTree(b)CompleteBinaryTree(c)FullBinaryTree(b)CompleteBinaryTree.Bythemethodofelimination:Fullbinarytreelosesitsnaturewhenoperationsofinsertionsanddeletionsaredone.Forincompletebinarytrees,extrastorageisrequiredandoverheadofNULLnodecheckingtakesplace.Socompletebinarytreeisthebetteronesincethepropertyofcompletebinarytreeismaintainedevenafteroperationslikeadditionsanddeletionsaredoneonit.29.WhatisaspanningTree?Aspanningtreeisatreeassociatedwithanetwork.Allthenodesofthegraphappearonthetreeonce.Aminimumspanningtreeisaspanningtreeorganizedsothatthetotaledgeweightbetweennodesisminimized.30.Doestheminimumspanningtreeofagraphgivetheshortestdistancebetweenany2specifiednodes?No.Minimalspanningtreeassuresthatthetotalweightofthetreeiskeptatitsminimum.Butitdoesn’tmeanthatthedistancebetweenanytwonodesinvolvedintheminimum-spanningtreeisminimum.31.Convertthegivengraphwithweightededgestominimalspanningtree.theequivalentminimalspanningtreeis:32.Whichisthesimplestfilestructure?(a)Sequential(b)Indexed(c)Random(a)Sequential33.WhetherLinkedListislinearorNon-lineardatastructure?AccordingtoAccessstrategiesLinkedlistisalinearone.AccordingtoStorageLinkedListisaNon-linearone.34.DrawabinaryTreefortheexpression:A*B–(C+D)*(P/Q)35.ForthefollowingCOBOLcode,drawtheBinarytree?01STUDENT_REC.02NAME.03FIRST_NAMEPICX(10).03LAST_NAMEPICX(10).02YEAR_OF_STUDY.03FIRST_SEMPICXX.03SECOND_SEMPICXX.CAptitudeNote:AlltheprogramsaretestedunderTurboC/C++compilers.Itisassumedthat,ProgramsrununderDOSenvironment,Theunderlyingmachineisanx86system,ProgramiscompiledusingTurboC/C++compiler.Theprogramoutputmaydependontheinformationbasedonthisassumptions(forexamplesizeof(int)==2maybeassumed).Predicttheoutputorerror(s)forthefollowing:1.voidmain(){intconst*p=5;printf(“%d”,++(*p));}Answer:Compilererror:Cannotmodifyaconstantvalue.Explanation:pisapointertoa“constantinteger”.Butwetriedtochangethevalueofthe“constantinteger”.2.main(){chars[]=”man”;inti;for(i=0;s[i];i++)printf(“%c%c%c%c”,s[i],*(s+i),*(i+s),i[s]);}Answer:mmmmaaaannnnExplanation:s[i],*(i+s),*(s+i),i[s]arealldifferentwaysofexpressingthesameidea.Generallyarraynameisthebaseaddressforthatarray.Heresisthebaseaddress.iistheindexnumber/displacementfromthebaseaddress.So,indirectingitwith*issameass[i].i[s]maybesurprising.ButinthecaseofCitissameass[i].3.main(){floatme=1.1;doubleyou=1.1;if(me==you)printf(“IloveU”);elseprintf(“IhateU”);}Answer:IhateUExplanation:Forfloatingpointnumbers(float,double,longdouble)thevaluescannotbepredictedexactly.Dependingonthenumberofbytes,theprecessionwithofthevaluerepresentedvaries.Floattakes4bytesandlongdoubletakes10bytes.Sofloatstores0.9withlessprecisionthanlongdouble.RuleofThumb:Nevercompareorat-leastbecautiouswhenusingfloatingpointnumberswithrelationaloperators(==,>,=,!=).4.main(){staticintvar=5;printf(“%d“,var–);if(var)main();}Answer:54321Explanation:Whenstaticstorageclassisgiven,itisinitializedonce.Thechangeinthevalueofastaticvariableisretainedevenbetweenthefunctioncalls.Mainisalsotreatedlikeanyotherordinaryfunction,whichcanbecalledrecursively.5.main(){intc[]={2.8,3.4,4,6.7,5};intj,*p=c,*q=c;for(j=0;j14;printf(“i=%d”,i);}Answer:i=0Explanation:Intheexpression!i>14,NOT(!)operatorhasmoreprecedencethan‘>’symbol.!isaunarylogicaloperator.!i(!10)is0(notoftrueisfalse).0>14isfalse(zero).15.#includemain(){chars[]={‘a’,’b’,’c’,’’,’c’,”};char*p,*str,*str1;p=&s[3];str=p;str1=s;printf(“%d”,++*p+++*str1-32);}Answer:77Explanation:pispointingtocharacter‘’.str1ispointingtocharacter‘a’++*p.“pispointingto‘’andthatisincrementedbyone.”theASCIIvalueof‘’is10,whichisthenincrementedto11.Thevalueof++*pis11.++*str1,str1ispointingto‘a’thatisincrementedby1anditbecomes‘b’.ASCIIvalueof‘b’is98.Nowperforming(11+98–32),weget77(“M”);Sowegettheoutput77::“M”(Asciiis77).16.#includemain(){inta[2][2][2]={{10,2,3,4},{5,6,7,8}};int*p,*q;p=&a[2][2][2];*q=***a;printf(“%d—-%d”,*p,*q);}Answer:SomeGarbageValue—1Explanation:p=&a[2][2][2]youdeclareonlytwo2Darrays,butyouaretryingtoaccessthethird2D(whichyouarenotdeclared)itwillprintgarbagevalues.*q=***astartingaddressofaisassignedintegerpointer.Nowqispointingtostartingaddressofa.Ifyouprint*q,itwillprintfirstelementof3Darray.17.#includemain(){structxx{intx=3;charname[]=”hello”;};structxx*s;printf(“%d”,s->x);printf(“%s”,s->name);}Answer:CompilerErrorExplanation:Youshouldnotinitializevariablesindeclaration18.#includemain(){structxx{intx;structyy{chars;structxx*p;};structyy*q;};}Answer:CompilerErrorExplanation:Thestructureyyisnestedwithinstructurexx.Hence,theelementsareofyyaretobeaccessedthroughtheinstanceofstructurexx,whichneedsaninstanceofyytobeknown.Iftheinstanceiscreatedafterdefiningthestructurethecompilerwillnotknowabouttheinstancerelativetoxx.Hencefornestedstructureyyyouhavetodeclaremember.19.main(){printf(“ab”);printf(“\bsi”);printf(“\rha”);}Answer:haiExplanation:–newline\b–backspace\r–linefeed20.main(){inti=5;printf(“%d%d%d%d%d%d”,i++,i–,++i,–i,i);}Answer:45545Explanation:Theargumentsinafunctioncallarepushedintothestackfromlefttoright.Theevaluationisbypoppingoutfromthestack.andtheevaluationisfromrighttoleft,hencetheresult.21.#definesquare(x)x*xmain(){inti;i=64/square(4);printf(“%d”,i);}Answer:64Explanation:themacrocallsquare(4)willsubstitutedby4*4sotheexpressionbecomesi=64/4*4.Since/and*hasequalprioritytheexpressionwillbeevaluatedas(64/4)*4i.e.16*4=6422.main(){char*p=”haifriends”,*p1;p1=p;while(*p!=”)++*p++;printf(“%s%s”,p,p1);}Answer:ibj!gsjfoetExplanation:++*p++willbeparseinthegivenorder*pthatisvalueatthelocationcurrentlypointedbypwillbetaken++*ptheretrievedvaluewillbeincrementedwhen;isencounteredthelocationwillbeincrementedthatisp++willbeexecutedHence,inthewhileloopinitialvaluepointedbypis‘h’,whichischangedto‘i’byexecuting++*pandpointermovestopoint,‘a’whichissimilarlychangedto‘b’andsoon.Similarlyblankspaceisconvertedto‘!’.Thus,weobtainvalueinpbecomes“ibj!gsjfoet”andsincepreaches‘’andp1pointstopthusp1doesnotprintanything.23.#include#definea10main(){#definea50printf(“%d”,a);}Answer:50Explanation:Thepreprocessordirectivescanberedefinedanywhereintheprogram.Sothemostrecentlyassignedvaluewillbetaken.24.#defineclrscr()100main(){clrscr();printf(“%d”,clrscr());}Answer:100Explanation:Preprocessorexecutesasaseperatepassbeforetheexecutionofthecompiler.Sotextualreplacementofclrscr()to100occurs.Theinputprogramtocompilerlookslikethis:main(){100;printf(“%d”,100);}Note:100;isanexecutablestatementbutwithnoaction.Soitdoesn’tgiveanyproblem25.main(){printf(“%p”,main);}Answer:Someaddresswillbeprinted.Explanation:Functionnamesarejustaddresses(justlikearraynamesareaddresses).main()isalsoafunction.Sotheaddressoffunctionmainwillbeprinted.%pinprintfspecifiesthattheargumentisanaddress.Theyareprintedashexadecimalnumbers.27)main(){clrscr();}clrscr();Answer:Nooutput/errorExplanation:Thefirstclrscr()occursinsideafunction.Soitbecomesafunctioncall.Inthesecondclrscr();isafunctiondeclaration(becauseitisnotinsideanyfunction).28)enumcolors{BLACK,BLUE,GREEN}main(){printf(“%d..%d..%d”,BLACK,BLUE,GREEN);return(1);}Answer:0..1..2Explanation:enumassignsnumbersstartingfrom0,ifnotexplicitlydefined.29)voidmain(){charfar*farther,*farthest;printf(“%d..%d”,sizeof(farther),sizeof(farthest));}Answer:4..2Explanation:thesecondpointerisofchartypeandnotafarpointer30)main(){inti=400,j=300;printf(“%d..%d”);}Answer:400..300Explanation:printftakesthevaluesofthefirsttwoassignmentsoftheprogram.Anynumberofprintf’smaybegiven.Allofthemtakeonlythefirsttwovalues.Ifmorenumberofassignmentsgivenintheprogram,thenprintfwilltakegarbagevalues.31)main(){char*p;p=”Hello”;printf(“%c”,*&*p);}Answer:HExplanation:*isadereferenceoperator&isareferenceoperator.Theycanbeappliedanynumberoftimesprovideditismeaningful.Hereppointstothefirstcharacterinthestring“Hello”.*pdereferencesitandsoitsvalueisH.Again&referencesittoanaddressand*dereferencesittothevalueH.32)main(){inti=1;while(i2)gotohere;i++;}}fun(){here:printf(“PP”);}Answer:Compilererror:Undefinedlabel‘here’infunctionmainExplanation:Labelshavefunctionsscope,inotherwordsThescopeofthelabelsislimitedtofunctions.Thelabel‘here’isavailableinfunctionfun()Henceitisnotvisibleinfunctionmain.33)main(){staticcharnames[5][20]={“pascal”,”ada”,”cobol”,”fortran”,”perl”};inti;char*t;t=names[3];names[3]=names[4];names[4]=t;for(i=0;imain(){inti=1,j=2;switch(i){case1:printf(“GOOD”);break;casej:printf(“BAD”);break;}}Answer:CompilerError:Constantexpressionrequiredinfunctionmain.Explanation:Thecasestatementcanhaveonlyconstantexpressions(thisimpliesthatwecannotusevariablenamesdirectlysoanerror).Note:Enumeratedtypescanbeusedincasestatements.37)main(){inti;printf(“%d”,scanf(“%d”,&i));//value10isgivenasinputhere}Answer:1Explanation:Scanfreturnsnumberofitemssuccessfullyreadandnot1/0.Here10isgivenasinputwhichshouldhavebeenscannedsuccessfully.Sonumberofitemsreadis1.38)#definef(g,g2)g##g2main(){intvar12=100;printf(“%d”,f(var,12));}Answer:10039)main(){inti=0;for(;i++;printf(“%d”,i));printf(“%d”,i);}Answer:1Explanation:beforeenteringintotheforloopthecheckingconditionis“evaluated”.Hereitevaluatesto0(false)andcomesoutoftheloop,andiisincremented(notethesemicolonaftertheforloop).40)#includemain(){chars[]={‘a’,’b’,’c’,’’,’c’,”};char*p,*str,*str1;p=&s[3];str=p;str1=s;printf(“%d”,++*p+++*str1-32);}Answer:MExplanation:pispointingtocharacter‘’.str1ispointingtocharacter‘a’++*pmeAnswer:”pispointingto‘’andthatisincrementedbyone.”theASCIIvalueof‘’is10.thenitisincrementedto11.thevalueof++*pis11.++*str1meAnswer:”str1ispointingto‘a’thatisincrementedby1anditbecomes‘b’.ASCIIvalueof‘b’is98.both11and98isaddedandresultissubtractedfrom32.i.e.(11+98-32)=77(“M”);41)#includemain(){structxx{intx=3;charname[]=”hello”;};structxx*s=malloc(sizeof(structxx));printf(“%d”,s->x);printf(“%s”,s->name);}Answer:CompilerErrorExplanation:Initializationshouldnotbedoneforstructuremembersinsidethestructuredeclaration42)#includemain(){structxx{intx;structyy{chars;structxx*p;};structyy*q;};}Answer:CompilerErrorExplanation:intheendofnestedstructureyyamemberhavetobedeclared.43)main(){externinti;i=20;printf(“%d”,sizeof(i));}Answer:Linkererror:undefinedsymbol‘_i’.Explanation:externdeclarationspecifiesthatthevariableiisdefinedsomewhereelse.Thecompilerpassestheexternalvariabletoberesolvedbythelinker.Socompilerdoesn’tfindanerror.Duringlinkingthelinkersearchesforthedefinitionofi.Sinceitisnotfoundthelinkerflagsanerror.44)main(){printf(“%d”,out);}intout=100;Answer:Compilererror:undefinedsymboloutinfunctionmain.Explanation:Theruleisthatavariableisavailableforusefromthepointofdeclaration.Eventhoughaisaglobalvariable,itisnotavailableformain.Henceanerror.45)main(){externout;printf(“%d”,out);}intout=100;Answer:100Explanation:Thisisthecorrectwayofwritingthepreviousprogram.46)main(){show();}voidshow(){printf(“I’mthegreatest”);}Answer:Compiererror:Typemismatchinredeclarationofshow.Explanation:Whenthecompilerseesthefunctionshowitdoesn’tknowanythingaboutit.Sothedefaultreturntype(ie,int)isassumed.Butwhencompilerseestheactualdefinitionofshowmismatchoccurssinceitisdeclaredasvoid.Hencetheerror.Thesolutionsareasfollows:1.declarevoidshow()inmain().2.defineshow()beforemain().3.declareexternvoidshow()beforetheuseofshow().47)main(){inta[2][3][2]={{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};printf(“%u%u%u%d”,a,*a,**a,***a);printf(“%u%u%u%d”,a+1,*a+1,**a+1,***a+1);}Answer:100,100,100,2114,104,102,3Explanation:Thegivenarrayisa3-Done.Itcanalsobeviewedasa1-Darray.247834222334100102104106108110112114116118120122thus,forthefirstprintfstatementa,*a,**agiveaddressoffirstelement.sincetheindirection***agivesthevalue.Hence,thefirstlineoftheoutput.forthesecondprintfa+1increasesinthethirddimensionthuspointstovalueat114,*a+1incrementsinseconddimensionthuspointsto104,**a+1incrementsthefirstdimensionthuspointsto102and***a+1firstgetsthevalueatfirstlocationandthenincrementsitby1.Hence,theoutput.48)main(){inta[]={10,20,30,40,50},j,*p;for(j=0;j,Explanation:assertsareusedduringdebuggingtomakesurethatcertainconditionsaresatisfied.Ifassertionfails,theprogramwillterminatereportingthesame.Afterdebugginguse,#undefNDEBUGandthiswilldisablealltheassertionsfromthesourcecode.Assertionisagooddebuggingtooltomakeuseof.55)main(){inti=-1;+i;printf(“i=%d,+i=%d”,i,+i);}Answer:i=-1,+i=-1Explanation:Unary+istheonlydummyoperatorinC.Where-everitcomesyoucanjustignoreitjustbecauseithasnoeffectintheexpressions(hencethenamedummyoperator).56)WhatarethefileswhichareautomaticallyopenedwhenaCfileisexecuted?Answer:stdin,stdout,stderr(standardinput,standardoutput,standarderror).57)whatwillbethepositionofthefilemarker?a:fseek(ptr,0,SEEK_SET);b:fseek(ptr,0,SEEK_CUR);Answer:a:TheSEEK_SETsetsthefilepositionmarkertothestartingofthefile.b:TheSEEK_CURsetsthefilepositionmarkertothecurrentpositionofthefile.58)main(){charname[10],s[12];scanf(”\”%[^\”]\””,s);}Howscanfwillexecute?Answer:Firstitchecksfortheleadingwhitespaceanddiscardsit.Thenitmatcheswithaquotationmarkandthenitreadsallcharacteruptoanotherquotationmark.59)Whatistheproblemwiththefollowingcodesegment?while((fgets(receivingarray,50,file_ptr))!=EOF);Answer&Explanation:fgetsreturnsapointer.Sothecorrectendoffilecheckischeckingfor!=NULL.60)main(){main();}Answer:Runtimeerror:Stackoverflow.Explanation:mainfunctioncallsitselfagainandagain.Eachtimethefunctioniscalleditsreturnaddressisstoredinthecallstack.Sincethereisnoconditiontoterminatethefunctioncall,thecallstackoverflowsatruntime.Soitterminatestheprogramandresultsinanerror.61)main(){char*cptr,c;void*vptr,v;c=10;v=0;cptr=&c;vptr=&v;printf(“%c%v”,c,v);}Answer:Compilererror(atlinenumber4):sizeofvisUnknown.Explanation:Youcancreateavariableoftypevoid*butnotoftypevoid,sincevoidisanemptytype.Inthesecondlineyouarecreatingvariablevptroftypevoid*andvoftypevoidhenceanerror.62)main(){char*str1=”abcd”;charstr2[]=”abcd”;printf(“%d%d%d”,sizeof(str1),sizeof(str2),sizeof(“abcd”));}Answer:255Explanation:Infirstsizeof,str1isacharacterpointersoitgivesyouthesizeofthepointervariable.Insecondsizeofthenamestr2indicatesthenameofthearraywhosesizeis5(includingthe”terminationcharacter).Thethirdsizeofissimilartothesecondone.63)main(){charnot;not=!2;printf(“%d”,not);}Answer:0Explanation:!isalogicaloperator.InCthevalue0isconsideredtobethebooleanvalueFALSE,andanynon-zerovalueisconsideredtobethebooleanvalueTRUE.Here2isanon-zerovaluesoTRUE.!TRUEisFALSE(0)soitprints0.64)#defineFALSE-1#defineTRUE1#defineNULL0main(){if(NULL)puts(“NULL”);elseif(FALSE)puts(“TRUE”);elseputs(“FALSE”);}Answer:TRUEExplanation:Theinputprogramtothecompilerafterprocessingbythepreprocessoris,main(){if(0)puts(“NULL”);elseif(-1)puts(“TRUE”);elseputs(“FALSE”);}Preprocessordoesn’treplacethevaluesgiveninsidethedoublequotes.Thecheckbyifconditionisbooleanvaluefalsesoitgoestoelse.Insecondif-1isbooleanvaluetruehence“TRUE”isprinted.65)main(){intk=1;printf(“%d==1is“”%s”,k,k==1?”TRUE”:”FALSE”);}Answer:1==1isTRUEExplanation:Whentwostringsareplacedtogether(orseparatedbywhite-space)theyareconcatenated(thisiscalledas“stringization”operation).Sothestringisasifitisgivenas“%d==1is%s”.Theconditionaloperator(?:)evaluatesto“TRUE”.66)main(){inty;scanf(“%d”,&y);//inputgivenis2000if((y%4==0&&y%100!=0)||y%100==0)printf(“%disaleapyear”);elseprintf(“%disnotaleapyear”);}Answer:2000isaleapyearExplanation:Anordinaryprogramtocheckifleapyearornot.67)#definemax5#defineintarr1[max]main(){typedefchararr2[max];arr1list={0,1,2,3,4};arr2name=”name”;printf(“%d%s”,list[0],name);}Answer:Compilererror(inthelinearr1list={0,1,2,3,4})Explanation:arr2isdeclaredoftypearrayofsize5ofcharacters.Soitcanbeusedtodeclarethevariablenameofthetypearr2.Butitisnotthecaseofarr1.Henceanerror.RuleofThumb:#definesareusedfortextualreplacementwhereastypedefsareusedfordeclaringnewtypes.68)inti=10;main(){externinti;{inti=20;{constvolatileunsignedi=30;printf(“%d”,i);}printf(“%d”,i);}printf(“%d”,i);}Answer:30,20,10Explanation:‘{‘introducesnewblockandthusnewscope.Intheinnermostblockiisdeclaredas,constvolatileunsignedwhichisavaliddeclaration.iisassumedoftypeint.Soprintfprints30.Inthenextblock,ihasvalue20andsoprintfprints20.Intheoutermostblock,iisdeclaredasextern,sonostoragespaceisallocatedforit.Aftercompilationisoverthelinkerresolvesittoglobalvariablei(sinceitistheonlyvariablevisiblethere).Soitprintsi’svalueas10.69)main(){int*j;{inti=10;j=&i;}printf(“%d”,*j);}Answer:10Explanation:Thevariableiisablocklevelvariableandthevisibilityisinsidethatblockonly.Butthelifetimeofiislifetimeofthefunctionsoitlivesuptotheexitofmainfunction.Sincetheiisstillallocatedspace,*jprintsthevaluestoredinisincejpointsi.70)main(){inti=-1;-i;printf(“i=%d,-i=%d”,i,-i);}Answer:i=-1,-i=1Explanation:-iisexecutedandthisexecutiondoesn’taffectthevalueofi.Inprintffirstyoujustprintthevalueofi.Afterthatthevalueoftheexpression-i=-(-1)isprinted.71)#includemain(){constinti=4;floatj;j=++i;printf(“%d%f”,i,++j);}Answer:CompilererrorExplanation:iisaconstant.youcannotchangethevalueofconstant72)#includemain(){inta[2][2][2]={{10,2,3,4},{5,6,7,8}};int*p,*q;p=&a[2][2][2];*q=***a;printf(“%d..%d”,*p,*q);}Answer:garbagevalue..1Explanation:p=&a[2][2][2]youdeclareonlytwo2Darrays.butyouaretryingtoaccessthethird2D(whichyouarenotdeclared)itwillprintgarbagevalues.*q=***astartingaddressofaisassignedintegerpointer.nowqispointingtostartingaddressofa.ifyouprint*qmeAnswer:itwillprintfirstelementof3Darray.73)#includemain(){registeri=5;charj[]=“hello”;printf(“%s%d”,j,i);}Answer:hello5Explanation:ifyoudeclareiasregistercompilerwilltreatitasordinaryintegeranditwilltakeintegervalue.ivaluemaybestoredeitherinregisterorinmemory.74)main(){inti=5,j=6,z;printf(“%d”,i+++j);}Answer:11Explanation:theexpressioni+++jistreatedas(i+++j)76)structaaa{structaaa*prev;inti;structaaa*next;};main(){structaaaabc,def,ghi,jkl;intx=100;abc.i=0;abc.prev=&jkl;abc.next=&def;def.i=1;def.prev=&abc;def.next=&ghi;ghi.i=2;ghi.prev=&def;ghi.next=&jkl;jkl.i=3;jkl.prev=&ghi;jkl.next=&abc;x=abc.next->next->prev->next->i;printf(“%d”,x);}Answer:2Explanation:aboveallstatementsformadoublecircularlinkedlist;abc.next->next->prev->next->ithisonepointsto“ghi”nodethevalueofatparticularnodeis2.77)structpoint{intx;inty;};structpointorigin,*pp;main(){pp=&origin;printf(“originis(%d%d)”,(*pp).x,(*pp).y);printf(“originis(%d%d)”,pp->x,pp->y);}Answer:originis(0,0)originis(0,0)Explanation:ppisapointertostructure.wecanaccesstheelementsofthestructureeitherwitharrowmarkorwithindirectionoperator.Note:Sincestructurepointisgloballydeclaredx&yareinitializedaszeroes78)main(){inti=_l_abc(10);printf(“%d”,–i);}int_l_abc(inti){return(i++);}Answer:9Explanation:return(i++)itwillfirstreturniandthenincrements.i.e.10willbereturned.79)main(){char*p;int*q;long*r;p=q=r=0;p++;q++;r++;printf(“%p…%p…%p”,p,q,r);}Answer:0001…0002…0004Explanation:++operatorwhenappliedtopointersincrementsaddressaccordingtotheircorrespondingdata-types.80)main(){charc=’‘,x,convert(z);getc(c);if((c>=’a’)&&(cintone_d[]={1,2,3};main(){int*ptr;ptr=one_d;ptr+=3;printf(“%d”,*ptr);}Answer:garbagevalueExplanation:ptrpointerispointingtooutofthearrayrangeofone_d.83)#includeaaa(){printf(“hi”);}bbb(){printf(“hello”);}ccc(){printf(“bye”);}main(){int(*ptr[3])();ptr[0]=aaa;ptr[1]=bbb;ptr[2]=ccc;ptr[2]();}Answer:byeExplanation:ptrisarrayofpointerstofunctionsofreturntypeint.ptr[0]isassignedtoaddressofthefunctionaaa.Similarlyptr[1]andptr[2]forbbbandcccrespectively.ptr[2]()isineffectofwritingccc(),sinceptr[2]pointstoccc.85)#includemain(){FILE*ptr;chari;ptr=fopen(“zzz.c”,”r”);while((i=fgetch(ptr))!=EOF)printf(“%c”,i);}Answer:contentsofzzz.cfollowedbyaninfiniteloopExplanation:TheconditionischeckedagainstEOF,itshouldbecheckedagainstNULL.86)main(){inti=0;j=0;if(i&&j++)printf(“%d..%d”,i++,j);printf(“%d..%d,i,j);}Answer:0..0Explanation:Thevalueofiis0.Sincethisinformationisenoughtodeterminethetruthvalueofthebooleanexpression.Sothestatementfollowingtheifstatementisnotexecuted.Thevaluesofiandjremainunchangedandgetprinted.87)main(){inti;i=abc();printf(“%d”,i);}abc(){_AX=1000;}Answer:1000Explanation:Normallythereturnvaluefromthefunctionisthroughtheinformationfromtheaccumulator.Here_AHisthepseudoglobalvariabledenotingtheaccumulator.Hence,thevalueoftheaccumulatorisset1000sothefunctionreturnsvalue1000.88)inti;main(){intt;for(t=4;scanf(“%d”,&i)-t;printf(“%d”,i))printf(“%d–“,t–);}//Iftheinputsare0,1,2,3findtheo/pAnswer:4–03–12–2Explanation:Letusassumesomex=scanf(“%d”,&i)-tthevaluesduringexecutionwillbe,tix40-431-222089)main(){inta=0;intb=20;charx=1;chary=10;if(a,b,x,y)printf(“hello”);}Answer:helloExplanation:Thecommaoperatorhasassociativityfromlefttoright.Onlytherightmostvalueisreturnedandtheothervaluesareevaluatedandignored.Thusthevalueoflastvariableyisreturnedtocheckinif.Sinceitisanonzerovalueifbecomestrueso,“hello”willbeprinted.90)main(){unsignedinti;for(i=1;i>-2;i–)printf(“captitude”);}Explanation:iisanunsignedinteger.Itiscomparedwithasignedvalue.Sincethebothtypesdoesn’tmatch,signedispromotedtounsignedvalue.Theunsignedequivalentof-2isahugevaluesoconditionbecomesfalseandcontrolcomesoutoftheloop.91)Inthefollowingpgmaddastmtinthefunctionfunsuchthattheaddressof‘a’getsstoredin‘j’.main(){int*j;voidfun(int**);fun(&j);}voidfun(int**k){inta=0;/*addastmthere*/}Answer:*k=&aExplanation:Theargumentofthefunctionisapointertoapointer.92)Whatarethefollowingnotationsofdefiningfunctionsknownas?i.intabc(inta,floatb){/*somecode*/}ii.intabc(a,b)inta;floatb;{/*somecode*/}Answer:i.ANSICnotationii.Kernighan&Ritchenotation93)main(){char*p;p=”%d”;p++;p++;printf(p-2,300);}Answer:300Explanation:Thepointerpointsto%sinceitisincrementedtwiceandagaindecrementedby2,itpointsto‘%d’and300isprinted.94)main(){chara[100];a[0]=’a’;a[1]]=’b’;a[2]=’c’;a[4]=’d’;abc(a);}abc(chara[]){a++;printf(“%c”,*a);a++;printf(“%c”,*a);}Explanation:Thebaseaddressismodifiedonlyinfunctionandasaresultapointsto‘b’thenafterincrementingto‘c’sobcwillbeprinted.95)func(a,b)inta,b;{return(a=(a==b));}main(){intprocess(),func();printf(“Thevalueofprocessis%d!“,process(func,3,6));}process(pf,val1,val2)int(*pf)();intval1,val2;{return((*pf)(val1,val2));}Answer:Thevalueifprocessis0!Explanation:Thefunction‘process’has3parameters–1,apointertoanotherfunction2and3,integers.Whenthisfunctionisinvokedfrommain,thefollowingsubstitutionsforformalparameterstakeplace:funcforpf,3forval1and6forval2.Thisfunctionreturnstheresultoftheoperationperformedbythefunction‘func’.Thefunctionfunchastwointegerparameters.Theformalparametersaresubstitutedas3foraand6forb.since3isnotequalto6,a==breturns0.thereforethefunctionreturns0whichinturnisreturnedbythefunction‘process’.96)voidmain(){staticinti=5;if(–i){main();printf(“%d“,i);}}Answer:0000Explanation:Thevariable“I”isdeclaredasstatic,hencememoryforIwillbeallocatedforonlyonce,asitencountersthestatement.Thefunctionmain()willbecalledrecursivelyunlessIbecomesequalto0,andsincemain()isrecursivelycalled,sothevalueofstaticIie.,0willbeprintedeverytimethecontrolisreturned.97)voidmain(){intk=ret(sizeof(float));printf(“herevalueis%d”,++k);}intret(intret){ret+=2.5;return(ret);}Answer:Herevalueis7Explanation:Theintret(intret),ie.,thefunctionnameandtheargumentnamecanbethesame.Firstly,thefunctionret()iscalledinwhichthesizeof(float)ie.,4ispassed,afterthefirstexpressionthevalueinretwillbe6,asretisintegerhencethevaluestoredinretwillhaveimplicittypeconversionfromfloattoint.Theretisreturnedinmain()itisprintedafterandpreincrement.98)voidmain(){chara[]=”12345″;inti=strlen(a);printf(“herein3%d”,++i);}Answer:herein36Explanation:Thechararray‘a’willholdtheinitializedstring,whoselengthwillbecountedfrom0tillthenullcharacter.Hencethe‘I’willholdthevalueequalto5,afterthepre-incrementintheprintfstatement,the6willbeprinted.99)voidmain(){unsignedgiveit=-1;intgotit;printf(“%u“,++giveit);printf(“%u”,gotit=–giveit);}Answer:065535Explanation:100)voidmain(){inti;chara[]=””;if(printf(“%s”,a))printf(“Okhere”);elseprintf(“Forgetit”);}Answer:OkhereExplanation:Printfwillreturnhowmanycharactersdoesitprint.Henceprintinganullcharacterreturns1whichmakestheifstatementtrue,thus“Okhere”isprinted.101)voidmain(){void*v;intinteger=2;int*i=&integer;v=i;printf(“%d”,(int*)*v);}Answer:CompilerError.Wecannotapplyindirectionontypevoid*.Explanation:Voidpointerisagenericpointertype.Nopointerarithmeticcanbedoneonit.Voidpointersarenormallyusedfor,1.Passinggenericpointerstofunctionsandreturningsuchpointers.2.Asaintermediatepointertype.3.Usedwhentheexactpointertypewillbeknownatalaterpointoftime.102)voidmain(){inti=i++,j=j++,k=k++;printf(“%d%d%d”,i,j,k);}Answer:Garbagevalues.Explanation:Anidentifierisavailabletouseinprogramcodefromthepointofitsdeclaration.Soexpressionssuchasi=i++arevalidstatements.Thei,jandkareautomaticvariablesandsotheycontainsomegarbagevalue.Garbageinisgarbageout(GIGO).103)voidmain(){staticinti=i++,j=j++,k=k++;printf(“i=%dj=%dk=%d”,i,j,k);}Answer:i=1j=1k=1Explanation:Sincestaticvariablesareinitializedtozerobydefault.104)voidmain(){while(1){if(printf(“%d”,printf(“%d”)))break;elsecontinue;}}Answer:GarbagevaluesExplanation:Theinnerprintfexecutesfirsttoprintsomegarbagevalue.Theprintfreturnsnoofcharactersprintedandthisvaluealsocannotbepredicted.Stilltheouterprintfprintssomethingandsoreturnsanon-zerovalue.Soitencountersthebreakstatementandcomesoutofthewhilestatement.104)main(){unsignedinti=10;while(i–>=0)printf(“%u“,i);}Answer:1098765432106553565534…..Explanation:Sinceiisanunsignedintegeritcanneverbecomenegative.Sotheexpressioni–>=0willalwaysbetrue,leadingtoaninfiniteloop.105)#includemain(){intx,y=2,z,a;if(x=y%2)z=2;a=2;printf(“%d%d“,z,x);}Answer:Garbage-value0Explanation:Thevalueofy%2is0.Thisvalueisassignedtox.Theconditionreducestoif(x)orinotherwordsif(0)andsozgoesuninitialized.ThumbRule:Checkallcontrolpathstowritebugfreecode.106)main(){inta[10];printf(“%d”,*a+1-*a+3);}Answer:4Explanation:*aand-*acancelsout.Theresultisassimpleas1+3=4!107)#defineprod(a,b)a*bmain(){intx=3,y=4;printf(“%d”,prod(x+2,y-1));}Answer:10Explanation:Themacroexpandsandevaluatestoas:x+2*y-1=>x+(2*y)-1=>10108)main(){unsignedinti=65000;while(i++!=0);printf(“%d”,i);}Answer:1Explanation:Notethesemicolonafterthewhilestatement.Whenthevalueofibecomes0itcomesoutofwhileloop.Duetopost-incrementonithevalueofiwhileprintingis1.109)main(){inti=0;while(+(+i–)!=0)i-=i++;printf(“%d”,i);}Answer:-1Explanation:Unary+istheonlydummyoperatorinC.Soithasnoeffectontheexpressionandnowthewhileloopis,while(i–!=0)whichisfalseandsobreaksoutofwhileloop.Thevalue–1isprintedduetothepost-decrementoperator.113)main(){floatf=5,g=10;enum{i=10,j=20,k=50};printf(“%d”,++k);printf(“%f”,f=0;i++);printf(“%d”,i);}Answer-128ExplanationNoticethesemicolonattheendoftheforloop.THeinitialvalueoftheiissetto0.Theinnerloopexecutestoincrementthevaluefrom0to127(thepositiverangeofchar)andthenitrotatestothenegativevalueof-128.Theconditionintheforloopfailsandsocomesoutoftheforloop.Itprintsthecurrentvalueofithatis-128.113)main(){unsignedchari=0;for(;i>=0;i++);printf(“%d”,i);}AnswerinfiniteloopExplanationThedifferencebetweenthepreviousquestionandthisoneisthatthecharisdeclaredtobeunsigned.Sothei++canneveryieldnegativevalueandi>=0neverbecomesfalsesothatitcancomeoutoftheforloop.114)main(){chari=0;for(;i>=0;i++);printf(“%d”,i);}Answer:Behaviorisimplementationdependent.Explanation:Thedetailifthecharissigned/unsignedbydefaultisimplementationdependent.Iftheimplementationtreatsthechartobesignedbydefaulttheprogramwillprint–128andterminate.Ontheotherhandifitconsiderschartobeunsignedbydefault,itgoestoinfiniteloop.Rule:Youcanwriteprogramsthathaveimplementationdependentbehavior.Butdontwriteprogramsthatdependonsuchbehavior.115)Isthefollowingstatementadeclaration/definition.Findwhatdoesitmean?int(*x)[10];AnswerDefinition.xisapointertoarrayof(size10)integers.Applyclock-wiseruletofindthemeaningofthisdefinition.116).WhatistheoutputfortheprogramgivenbelowtypedefenumerrorType{warning,error,exception,}error;main(){errorg1;g1=1;printf(“%d”,g1);}AnswerCompilererror:MultipledeclarationforerrorExplanationThenameerrorisusedinthetwomeanings.Onemeansthatitisaenumeratorconstantwithvalue1.Theanotheruseisthatitisatypename(duetotypedef)forenumerrorType.Givenasituationthecompilercannotdistinguishthemeaningoferrortoknowinwhatsensetheerrorisused:errorg1;g1=error;//whicherroritrefersineachcase?Whenthecompilercandistinguishbetweenusagesthenitwillnotissueerror(inpuretechnicalterms,namescanonlybeoverloadedindifferentnamespaces).Note:theextracommainthedeclaration,enumerrorType{warning,error,exception,}isnotanerror.Anextracommaisvalidandisprovidedjustforprogrammer’sconvenience.117)typedefstructerror{intwarning,error,exception;}error;main(){errorg1;g1.error=1;printf(“%d”,g1.error);}Answer1ExplanationThethreeusagesofnameerrorscanbedistinguishablebythecompileratanyinstance,sovalid(theyareindifferentnamespaces).Typedefstructerror{intwarning,error,exception;}error;Thiserrorcanbeusedonlybyprecedingtheerrorbystructkaywordasin:structerrorsomeError;typedefstructerror{intwarning,error,exception;}error;Thiscanbeusedonlyafter.(dot)or->(arrow)operatorprecededbythevariablenameasin:g1.error=1;printf(“%d”,g1.error);typedefstructerror{intwarning,error,exception;}error;Thiscanbeusedtodefinevariableswithoutusingtheprecedingstructkeywordasin:errorg1;Sincethecompilercanperfectlydistinguishbetweenthesethreeusages,itisperfectlylegalandvalid.NoteThiscodeisgivenheretojustexplaintheconceptbehind.Inrealprogrammingdon’tusesuchoverloadingofnames.Itreducesthereadabilityofthecode.Possibledoesn’tmeanthatweshoulduseit!118)#ifdefsomethingintsome=0;#endifmain(){intthing=0;printf(“%d%d”,some,thing);}Answer:Compilererror:undefinedsymbolsomeExplanation:Thisisaverysimpleexampleforconditionalcompilation.Thenamesomethingisnotalreadyknowntothecompilermakingthedeclarationintsome=0;effectivelyremovedfromthesourcecode.119)#ifsomething==0intsome=0;#endifmain(){intthing=0;printf(“%d%d”,some,thing);}Answer00ExplanationThiscodeistoshowthatpreprocessorexpressionsarenotthesameastheordinaryexpressions.Ifanameisnotknownthepreprocessortreatsittobeequaltozero.120).Whatistheoutputforthefollowingprogrammain(){intarr2D[3][3];printf(“%d”,((arr2D==*arr2D)&&(*arr2D==arr2D[0])));}Answer1ExplanationThisisduetothecloserelationbetweenthearraysandpointers.Ndimensionalarraysaremadeupof(N-1)dimensionalarrays.arr2Dismadeupofa3singlearraysthatcontains3integerseach.Thenamearr2Dreferstothebeginningofallthe3arrays.*arr2Dreferstothestartofthefirst1Darray(of3integers)thatisthesameaddressasarr2D.Sotheexpression(arr2D==*arr2D)istrue(1).Similarly,*arr2Disnothingbut*(arr2D+0),addingazerodoesn’tchangethevalue/meaning.Againarr2D[0]istheanotherwayoftelling*(arr2D+0).Sotheexpression(*(arr2D+0)==arr2D[0])istrue(1).Sincebothpartsoftheexpressionevaluatestotruetheresultistrue(1)andthesameisprinted.121)voidmain(){if(~0==(unsignedint)-1)printf(“Youcananswerthisifyouknowhowvaluesarerepresentedinmemory”);}AnswerYoucananswerthisifyouknowhowvaluesarerepresentedinmemoryExplanation~(tildeoperatororbit-wisenegationoperator)operateson0toproduceallonestofillthespaceforaninteger.–1isrepresentedinunsignedvalueasall1’sandsobothareequal.122)intswap(int*a,int*b){*a=*a+*b;*b=*a-*b;*a=*a-*b;}main(){intx=10,y=20;swap(&x,&y);printf(“x=%dy=%d”,x,y);}Answerx=20y=10ExplanationThisisonewayofswappingtwovalues.Simplecheckingwillhelpunderstandthis.123)main(){char*p=“ayqm”;printf(“%c”,++*(p++));}Answer:b124)main(){inti=5;printf(“%d”,++i++);}Answer:Compilererror:LvaluerequiredinfunctionmainExplanation:++iyieldsanrvalue.Forpostfix++tooperateanlvalueisrequired.125)main(){char*p=“ayqm”;charc;c=++*p++;printf(“%c”,c);}Answer:bExplanation:Thereisnodifferencebetweentheexpression++*(p++)and++*p++.Parenthesisjustworksasavisualclueforthereadertoseewhichexpressionisfirstevaluated.126)intaaa(){printf(“Hi”);}intbbb(){printf(“hello”);}inyccc(){printf(“bye”);}main(){int(*ptr[3])();ptr[0]=aaa;ptr[1]=bbb;ptr[2]=ccc;ptr[2]();}Answer:byeExplanation:int(*ptr[3])()saysthatptrisanarrayofpointerstofunctionsthattakesnoargumentsandreturnsthetypeint.Bytheassignmentptr[0]=aaa;itmeansthatthefirstfunctionpointerinthearrayisinitializedwiththeaddressofthefunctionaaa.Similarly,theothertwoarrayelementsalsogetinitializedwiththeaddressesofthefunctionsbbbandccc.Sinceptr[2]containstheaddressofthefunctionccc,thecalltothefunctionptr[2]()issameascallingccc().Soitresultsinprinting“bye”.127)main(){inti=5;printf(“%d”,i=++i==6);}Answer:1Explanation:Theexpressioncanbetreatedasi=(++i==6),because==isofhigherprecedencethan=operator.Intheinnerexpression,++iisequalto6yieldingtrue(1).Hencetheresult.128)main(){charp[]=”%d”;p[1]=‘c’;printf(p,65);}Answer:AExplanation:Duetotheassignmentp[1]=‘c’thestringbecomes,“%c”.SincethisstringbecomestheformatstringforprintfandASCIIvalueof65is‘A’,thesamegetsprinted.129)void(*abc(int,void(*def)()))();Answer::abcisaptrtoafunctionwhichtakes2parameters.(a).anintegervariable.(b).aptrtoafuntionwhichreturnsvoid.thereturntypeofthefunctionisvoid.Explanation:Applytheclock-wiseruletofindtheresult.130)main(){while(strcmp(“some”,”some”))printf(“Stringsarenotequal”);}Answer:NooutputExplanation:Endingthestringconstantwithexplicitlymakesnodifference.So“some”and“some”areequivalent.So,strcmpreturns0(false)hencebreakingoutofthewhileloop.131)main(){charstr1[]={‘s’,’o’,’m’,’e’};charstr2[]={‘s’,’o’,’m’,’e’,’’};while(strcmp(str1,str2))printf(“Stringsarenotequal”);}Answer:“Stringsarenotequal”“Stringsarenotequal”….Explanation:Ifastringconstantisinitializedexplicitlywithcharacters,‘’isnotappendedautomaticallytothestring.Sincestr1doesn’thavenulltermination,ittreatswhateverthevaluesthatareinthefollowingpositionsaspartofthestringuntilitrandomlyreachesa‘’.Sostr1andstr2arenotthesame,hencetheresult.132)main(){inti=3;for(;i++=0;)printf(“%d”,i);}Answer:CompilerError:Lvaluerequired.Explanation:Asweknowthatincrementoperatorsreturnrvaluesandhenceitcannotappearonthelefthandsideofanassignmentoperation.133)voidmain(){int*mptr,*cptr;mptr=(int*)malloc(sizeof(int));printf(“%d”,*mptr);int*cptr=(int*)calloc(sizeof(int),1);printf(“%d”,*cptr);}Answer:garbage-value0Explanation:Thememoryspaceallocatedbymallocisuninitialized,whereascallocreturnstheallocatedmemoryspaceinitializedtozeros.134)voidmain(){staticinti;while(i2)?i++:i–;printf(“%d”,i);}Answer:32767Explanation:Sinceiisstaticitisinitializedto0.Insidethewhilelooptheconditionaloperatorevaluatestofalse,executingi–.Thiscontinuestilltheintegervaluerotatestopositivevalue(32767).Thewhileconditionbecomesfalseandhence,comesoutofthewhileloop,printingtheivalue.135)main(){inti=10,j=20;j=i,j?(i,j)?i:j:j;printf(“%d%d”,i,j);}Answer:1010Explanation:TheTernaryoperator(?:)isequivalentforif-then-elsestatement.Sothequestioncanbewrittenas:if(i,j){if(i,j)j=i;elsej=j;}elsej=j;136)1.constchar*a;2.char*consta;3.charconst*a;-Differentiatetheabovedeclarations.Answer:1.‘const’appliestochar*ratherthan‘a’(pointertoaconstantchar)*a=’F’:illegala=”Hi”:legal2.‘const’appliesto‘a’ratherthantothevalueofa(constantpointertochar)*a=’F’:legala=”Hi”:illegal3.Sameas1.137)main(){inti=5,j=10;i=i&=j&&10;printf(“%d%d”,i,j);}Answer:110Explanation:Theexpressioncanbewrittenasi=(i&=(j&&10));Theinnerexpression(j&&10)evaluatesto1becausej==10.iis5.i=5&1is1.Hencetheresult.138)main(){inti=4,j=7;j=j||i++&&printf(“YOUCAN”);printf(“%d%d”,i,j);}Answer:41Explanation:Thebooleanexpressionneedstobeevaluatedonlytillthetruthvalueoftheexpressionisnotknown.jisnotequaltozeroitselfmeansthattheexpression’struthvalueis1.Becauseitisfollowedby||andtrue||(anything)=>truewhere(anything)willnotbeevaluated.Sotheremainingexpressionisnotevaluatedandsothevalueofiremainsthesame.Similarlywhen&&operatorisinvolvedinanexpression,whenanyoftheoperandsbecomefalse,thewholeexpression’struthvaluebecomesfalseandhencetheremainingexpressionwillnotbeevaluated.false&&(anything)=>falsewhere(anything)willnotbeevaluated.139)main(){registerinta=2;printf(“Addressofa=%d”,&a);printf(“Valueofa=%d”,a);}Answer:CompierError:‘&’onregistervariableRuletoRemember:&(addressof)operatorcannotbeappliedonregistervariables.140)main(){floati=1.5;switch(i){case1:printf(“1”);case2:printf(“2”);default:printf(“0”);}}Answer:CompilerError:switchexpressionnotintegralExplanation:Switchstatementscanbeappliedonlytointegraltypes.141)main(){externi;printf(“%d”,i);{inti=20;printf(“%d”,i);}}Answer:LinkerError:UnresolvedexternalsymboliExplanation:Theidentifieriisavailableintheinnerblockandsousingexternhasnouseinresolvingit.142)main(){inta=2,*f1,*f2;f1=f2=&a;*f2+=*f2+=a+=2.5;printf(“%d%d%d”,a,*f1,*f2);}Answer:161616Explanation:f1andf2bothrefertothesamememorylocationa.Sochangesthroughf1andf2ultimatelyaffectsonlythevalueofa.143)main(){char*p=”GOOD”;chara[]=”GOOD”;printf(“sizeof(p)=%d,sizeof(*p)=%d,strlen(p)=%d”,

Page 8: Daily paragraph editing terminal velocity answers

sizeof(p),sizeof(*p),strlen(p));printf(“sizeof(a)=%d,strlen(a)=%d”,sizeof(a),strlen(a));}Answer:sizeof(p)=2,sizeof(*p)=1,strlen(p)=4sizeof(a)=5,strlen(a)=4Explanation:sizeof(p)=>sizeof(char*)=>2sizeof(*p)=>sizeof(char)=>1Similarly,sizeof(a)=>sizeofthecharacterarray=>5Whensizeofoperatorisappliedtoanarrayitreturnsthesizeofthearrayanditisnotthesameasthesizeofthepointervariable.Herethesizeof(a)whereaisthecharacterarrayandthesizeofthearrayis5becausethespacenecessaryfortheterminatingNULLcharactershouldalsobetakenintoaccount.144)#defineDIM(array,type)sizeof(array)/sizeof(type)main(){intarr[10];printf(“Thedimensionofthearrayis%d”,DIM(arr,int));}Answer:10Explanation:Thesizeofintegerarrayof10elementsis10*sizeof(int).Themacroexpandstosizeof(arr)/sizeof(int)=>10*sizeof(int)/sizeof(int)=>10.145)intDIM(intarray[]){returnsizeof(array)/sizeof(int);}main(){intarr[10];printf(“Thedimensionofthearrayis%d”,DIM(arr));}Answer:1Explanation:Arrayscannotbepassedtofunctionsasargumentsandonlythepointerscanbepassed.Sotheargumentisequivalenttoint*array(thisisoneoftheveryfewplaceswhere[]and*usageareequivalent).Thereturnstatementbecomes,sizeof(int*)/sizeof(int)thathappenstobeequalinthiscase.146)main(){staticinta[3][3]={1,2,3,4,5,6,7,8,9};inti,j;static*p[]={a,a+1,a+2};for(i=0;i556.151)#includemain(){char*str=“hello”;char*ptr=str;charleast=127;while(*ptr++)least=(*ptrbval;cout=sizeof(int)+sizeof(int)).4)classbase{public:voidbaseFun(){coutbaseFun();}intmain(){basebaseObject;SomeFunc(&baseObject);derideriObject;SomeFunc(&deriObject);}Answer:frombasefrombaseExplanation:Aswehaveseeninthepreviouscase,SomeFuncexpectsapointertoabaseclass.Sinceapointertoaderivedclassobjectispassed,ittreatstheargumentonlyasabaseclasspointerandthecorrespondingbasefunctioniscalled.5)classbase{public:virtualvoidbaseFun(){coutbaseFun();}intmain(){basebaseObject;SomeFunc(&baseObject);derideriObject;SomeFunc(&deriObject);}Answer:frombasefromderivedExplanation:RememberthatbaseFuncisavirtualfunction.Thatmeansthatitsupportsrun-timepolymorphism.Sothefunctioncorrespondingtothederivedclassobjectiscalled.voidmain(){inta,*pa,&ra;pa=&a;ra=a;coutclassfig2d{intdim1;intdim2;public:fig2d(){dim1=5;dim2=6;}virtualvoidoperatordim1dim2dim3;}*/voidmain(){fig2dobj1;//fig3dobj2;obj1re==rhs.re)&&(this->im==rhs.im))returntrue;elsereturnfalse;}intmain(){complexc1;coutout();}2)JustifytheuseofvirtualconstructorsanddestructorsinC++.3)EachC++objectpossessesthe4memberfns,(whichcanbedeclaredbytheprogrammerexplicitlyorbytheimplementationiftheyarenotavailable).Whatarethose4functions?4)Whatiswrongwiththisclassdeclaration?classsomething{char*str;public:something(){st=newchar[10];}~something(){deletestr;}};5)Inheritanceisalsoknownas——–relationship.Containershipas________relationship.6)Whenisitnecessarytousemember-wiseinitializationlist(alsoknownasheaderinitializationlist)inC++?7)WhichistheonlyoperatorinC++whichcanbeoverloadedbutNOTinherited.8)IsthereanythingwrongwiththisC++classdeclaration?classtemp{intvalue1;mutableintvalue2;public:voidfun(intval)const{((temp*)this)->value1=10;value2=10;}};1.Whatisamodifier?Answer:Amodifier,alsocalledamodifyingfunctionisamemberfunctionthatchangesthevalueofatleastonedatamember.Inotherwords,anoperationthatmodifiesthestateofanobject.Modifiersarealsoknownas‘mutators’.2.Whatisanaccessor?Answer:Anaccessorisaclassoperationthatdoesnotmodifythestateofanobject.Theaccessorfunctionsneedtobedeclaredasconstoperations3.Differentiatebetweenatemplateclassandclasstemplate.Answer:Templateclass:Agenericdefinitionoraparameterizedclassnotinstantiateduntiltheclientprovidestheneededinformation.It’sjargonforplaintemplates.Classtemplate:Aclasstemplatespecifieshowindividualclassescanbeconstructedmuchlikethewayaclassspecifieshowindividualobjectscanbeconstructed.It’sjargonforplainclasses.4.Whendoesanameclashoccur?Answer:Anameclashoccurswhenanameisdefinedinmorethanoneplace.Forexample.,twodifferentclasslibrariescouldgivetwodifferentclassesthesamename.Ifyoutrytousemanyclasslibrariesatthesametime,thereisafairchancethatyouwillbeunabletocompileorlinktheprogrambecauseofnameclashes.5.Definenamespace.Answer:Itisafeatureinc++tominimizenamecollisionsintheglobalnamespace.Thisnamespacekeywordassignsadistinctnametoalibrarythatallowsotherlibrariestousethesameidentifiernameswithoutcreatinganynamecollisions.Furthermore,thecompilerusesthenamespacesignaturefordifferentiatingthedefinitions.6.Whatistheuseof‘using’declaration.Answer:Ausingdeclarationmakesitpossibletouseanamefromanamespacewithoutthescopeoperator.7.WhatisanIteratorclass?Answer:Aclassthatisusedtotraversethroughtheobjectsmaintainedbyacontainerclass.Therearefivecategoriesofiterators:inputiterators,outputiterators,forwarditerators,bidirectionaliterators,randomaccess.Aniteratorisanentitythatgivesaccesstothecontentsofacontainerobjectwithoutviolatingencapsulationconstraints.Accesstothecontentsisgrantedonaone-at-a-timebasisinorder.Theordercanbestorageorder(asinlistsandqueues)orsomearbitraryorder(asinarrayindices)oraccordingtosomeorderingrelation(asinanorderedbinarytree).Theiteratorisaconstruct,whichprovidesaninterfacethat,whencalled,yieldseitherthenextelementinthecontainer,orsomevaluedenotingthefactthattherearenomoreelementstoexamine.Iteratorshidethedetailsofaccesstoandupdateoftheelementsofacontainerclass.Thesimplestandsafestiteratorsarethosethatpermitread-onlyaccesstothecontentsofacontainerclass.Thefollowingcodefragmentshowshowaniteratormightappearincode:cont_iter:=newcont_iterator();x:=cont_iter.next();whilex/=nonedo…s(x);…x:=cont_iter.next();end;Inthisexample,cont_iteristhenameoftheiterator.Itiscreatedonthefirstlinebyinstantiationofcont_iteratorclass,aniteratorclassdefinedtoiterateoversomecontainerclass,cont.Succesiveelementsfromthecontainerarecarriedtox.Theloopterminateswhenxisboundtosomeemptyvalue.(Here,none)Inthemiddleoftheloop,thereiss(x)anoperationonx,thecurrentelementfromthecontainer.Thenextelementofthecontainerisobtainedatthebottomoftheloop.9.ListoutsomeoftheOODBMSavailable.Answer:GEMSTONE/OPALofGemstonesystems.ONTOSofOntos.ObjectivityofObjectivityinc.VersantofVersantobjecttechnology.ObjectstoreofObjectDesign.ARDENTofARDENTsoftware.POETofPOETsoftware.10.Listoutsomeoftheobject-orientedmethodologies.Answer:ObjectOrientedDevelopment(OOD)(Booch1991,1994).ObjectOrientedAnalysisandDesign(OOA/D)(CoadandYourdon1991).ObjectModellingTechniques(OMT)(Rumbaugh1991).ObjectOrientedSoftwareEngineering(Objectory)(Jacobson1992).ObjectOrientedAnalysis(OOA)(ShlaerandMellor1992).TheFusionMethod(Coleman1991).11.Whatisanincompletetype?Answer:Incompletetypesreferstopointersinwhichthereisnonavailabilityoftheimplementationofthereferencedlocationoritpointstosomelocationwhosevalueisnotavailableformodification.Example:int*i=0x400//ipointstoaddress400*i=0;//setthevalueofmemorylocationpointedbyi.Incompletetypesareotherwisecalleduninitializedpointers.12.Whatisadanglingpointer?Answer:Adanglingpointerariseswhenyouusetheaddressofanobjectafteritslifetimeisover.Thismayoccurinsituationslikereturningaddressesoftheautomaticvariablesfromafunctionorusingtheaddressofthememoryblockafteritisfreed.13.Differentiatebetweenthemessageandmethod.Answer:MessageMethodObjectscommunicatebysendingmessagesProvidesresponsetoamessage.toeachother.Amessageissenttoinvokeamethod.Itisanimplementationofanoperation.14.WhatisanadaptorclassorWrapperclass?Answer:Aclassthathasnofunctionalityofitsown.Itsmemberfunctionshidetheuseofathirdpartysoftwarecomponentoranobjectwiththenon-compatibleinterfaceoranon-object-orientedimplementation.15.WhatisaNullobject?Answer:Itisanobjectofsomeclasswhosepurposeistoindicatethatarealobjectofthatclassdoesnotexist.Onecommonuseforanullobjectisareturnvaluefromamemberfunctionthatissupposedtoreturnanobjectwithsomespecifiedpropertiesbutcannotfindsuchanobject.16.Whatisclassinvariant?Answer:Aclassinvariantisaconditionthatdefinesallvalidstatesforanobject.Itisalogicalconditiontoensurethecorrectworkingofaclass.Classinvariantsmustholdwhenanobjectiscreated,andtheymustbepreservedunderalloperationsoftheclass.Inparticularallclassinvariantsarebothpreconditionsandpost-conditionsforalloperationsormemberfunctionsoftheclass.17.WhatdoyoumeanbyStackunwinding?Answer:Itisaprocessduringexceptionhandlingwhenthedestructoriscalledforalllocalobjectsbetweentheplacewheretheexceptionwasthrownandwhereitiscaught.18.Definepreconditionandpost-conditiontoamemberfunction.Answer:Precondition:Apreconditionisaconditionthatmustbetrueonentrytoamemberfunction.Aclassisusedcorrectlyifpreconditionsareneverfalse.Anoperationisnotresponsiblefordoinganythingsensibleifitspreconditionfailstohold.Forexample,theinterfaceinvariantsofstackclasssaynothingaboutpushingyetanotherelementonastackthatisalreadyfull.Wesaythatisful()isapreconditionofthepushoperation.Post-condition:Apost-conditionisaconditionthatmustbetrueonexitfromamemberfunctionifthepreconditionwasvalidonentrytothatfunction.Aclassisimplementedcorrectlyifpost-conditionsareneverfalse.Forexample,afterpushinganelementonthestack,weknowthatisempty()mustnecessarilyhold.Thisisapost-conditionofthepushoperation.19.Whataretheconditionsthathavetobemetforaconditiontobeaninvariantoftheclass?Answer:Theconditionshouldholdattheendofeveryconstructor.Theconditionshouldholdattheendofeverymutator(non-const)operation.20.Whatareproxyobjects?Answer:Objectsthatstandforotherobjectsarecalledproxyobjectsorsurrogates.Example:templateclassArray2D{public:classArray1D{public:T&operator[](intindex);constT&operator[](intindex)const;…};Array1Doperator[](intindex);constArray1Doperator[](intindex)const;…};Thefollowingthenbecomeslegal:Array2Ddata(10,20);……..cout::?:23.Whatisanodeclass?Answer:Anodeclassisaclassthat,reliesonthebaseclassforservicesandimplementation,providesawiderinterfacetoteusersthanitsbaseclass,reliesprimarilyonvirtualfunctionsinitspublicinterfacedependsonallitsdirectandindirectbaseclasscanbeunderstoodonlyinthecontextofthebaseclasscanbeusedasbaseforfurtherderivationcanbeusedtocreateobjects.Anodeclassisaclassthathasaddednewservicesorfunctionalitybeyondtheservicesinheritedfromitsbaseclass.24.Whatisanorthogonalbaseclass?Answer:Iftwobaseclasseshavenooverlappingmethodsordatatheyaresaidtobeindependentof,ororthogonaltoeachother.Orthogonalinthesensemeansthattwoclassesoperateindifferentdimensionsanddonotinterferewitheachotherinanyway.Thesamederivedclassmayinheritsuchclasseswithnodifficulty.25.Whatisacontainerclass?Whatarethetypesofcontainerclasses?Answer:Acontainerclassisaclassthatisusedtoholdobjectsinmemoryorexternalstorage.Acontainerclassactsasagenericholder.Acontainerclasshasapredefinedbehaviorandawell-knowninterface.Acontainerclassisasupportingclasswhosepurposeistohidethetopologyusedformaintainingthelistofobjectsinmemory.Whenacontainerclasscontainsagroupofmixedobjects,thecontaineriscalledaheterogeneouscontainer;whenthecontainerisholdingagroupofobjectsthatareallthesame,thecontaineriscalledahomogeneouscontainer.26.Whatisaprotocolclass?Answer:Anabstractclassisaprotocolclassif:itneithercontainsnorinheritsfromclassesthatcontainmemberdata,non-virtualfunctions,orprivate(orprotected)membersofanykind.ithasanon-inlinevirtualdestructordefinedwithanemptyimplementation,allmemberfunctionsotherthanthedestructorincludinginheritedfunctions,aredeclaredpurevirtualfunctionsandleftundefined.27.Whatisamixinclass?Answer:Aclassthatprovidessomebutnotalloftheimplementationforavirtualbaseclassisoftencalledmixin.Derivationdonejustforthepurposeofredefiningthevirtualfunctionsinthebaseclassesisoftencalledmixininheritance.Mixinclassestypicallydon’tsharecommonbases.28.Whatisaconcreteclass?Answer:Aconcreteclassisusedtodefineausefulobjectthatcanbeinstantiatedasanautomaticvariableontheprogramstack.Theimplementationofaconcreteclassisdefined.Theconcreteclassisnotintendedtobeabaseclassandnoattempttominimizedependencyonotherclassesintheimplementationorbehavioroftheclass.29.Whatisthehandleclass?Answer:Ahandleisaclassthatmaintainsapointertoanobjectthatisprogrammaticallyaccessiblethroughthepublicinterfaceofthehandleclass.Explanation:Incaseofabstractclasses,unlessonemanipulatestheobjectsoftheseclassesthroughpointersandreferences,thebenefitsofthevirtualfunctionsarelost.Usercodemaybecomedependentondetailsofimplementationclassesbecauseanabstracttypecannotbeallocatedstatisticallyoronthestackwithoutitssizebeingknown.Usingpointersorreferencesimpliesthattheburdenofmemorymanagementfallsontheuser.Anotherlimitationofabstractclassobjectisoffixedsize.Classeshoweverareusedtorepresentconceptsthatrequirevaryingamountsofstoragetoimplementthem.Apopulartechniquefordealingwiththeseissuesistoseparatewhatisusedasasingleobjectintwoparts:ahandleprovidingtheuserinterfaceandarepresentationholdingallormostoftheobject’sstate.Theconnectionbetweenthehandleandtherepresentationistypicallyapointerinthehandle.Often,handleshaveabitmoredatathanthesimplerepresentationpointer,butnotmuchmore.Hencethelayoutofthehandleistypicallystable,evenwhentherepresentationchangesandalsothathandlesaresmallenoughtomovearoundrelativelyfreelysothattheuserneedn’tusethepointersandthereferences.30.Whatisanactionclass?Answer:ThesimplestandmostobviouswaytospecifyanactioninC++istowriteafunction.However,iftheactionhastobedelayed,hastobetransmitted‘elsewhere’beforebeingperformed,requiresitsowndata,hastobecombinedwithotheractions,etcthenitoftenbecomesattractivetoprovidetheactionintheformofaclassthatcanexecutethedesiredactionandprovideotherservicesaswell.Manipulatorsusedwithiostreamsisanobviousexample.Explanation:Acommonformofactionclassisasimpleclasscontainingjustonevirtualfunction.classAction{public:virtualintdo_it(int)=0;virtual~Action();}Giventhis,wecanwritecodesayamemberthatcanstoreactionsforlaterexecutionwithoutusingpointerstofunctions,withoutknowinganythingabouttheobjectsinvolved,andwithoutevenknowingthenameoftheoperationitinvokes.Forexample:classwrite_file:publicAction{File&f;public:intdo_it(int){returnfwrite().suceed();}};classerror_message:publicAction{response_boxdb(message.cstr(),”Continue”,”Cancel”,”Retry”);switch(db.getresponse()){case0:return0;case1:abort();case2:current_operation.redo();return1;}};AuseroftheActionclasswillbecompletelyisolatedfromanyknowledgeofderivedclassessuchaswrite_fileanderror_message.31.Whencanyoutellthatamemoryleakwilloccur?Answer:Amemoryleakoccurswhenaprogramlosestheabilitytofreeablockofdynamicallyallocatedmemory.32.Whatisaparameterizedtype?Answer:Atemplateisaparameterizedconstructortypecontaininggenericcodethatcanuseormanipulateanytype.Itiscalledparameterizedbecauseanactualtypeisaparameterofthecodebody.Polymorphismmaybeachievedthroughparameterizedtypes.Thistypeofpolymorphismiscalledparametericpolymorphism.Parametericpolymorphismisthemechanismbywhichthesamecodeisusedondifferenttypespassedasparameters.33.Differentiatebetweenadeepcopyandashallowcopy?Answer:Deepcopyinvolvesusingthecontentsofoneobjecttocreateanotherinstanceofthesameclass.Inadeepcopy,thetwoobjectsmaycontainhtsameinformationbutthetargetobjectwillhaveitsownbuffersandresources.thedestructionofeitherobjectwillnotaffecttheremainingobject.Theoverloadedassignmentoperatorwouldcreateadeepcopyofobjects.Shallowcopyinvolvescopyingthecontentsofoneobjectintoanotherinstanceofthesameclassthuscreatingamirrorimage.Owingtostraightcopyingofreferencesandpointers,thetwoobjectswillsharethesameexternallycontainedcontentsoftheotherobjecttobeunpredictable.Explanation:Usingacopyconstructorwesimplycopythedatavaluesmemberbymember.Thismethodofcopyingiscalledshallowcopy.Iftheobjectisasimpleclass,comprisedofbuiltintypesandnopointersthiswouldbeacceptable.Thisfunctionwouldusethevaluesandtheobjectsanditsbehaviorwouldnotbealteredwithashallowcopy,onlytheaddressesofpointersthataremembersarecopiedandnotthevaluetheaddressispointingto.Thedatavaluesoftheobjectwouldthenbeinadvertentlyalteredbythefunction.Whenthefunctiongoesoutofscope,thecopyoftheobjectwithallitsdataispoppedoffthestack.Iftheobjecthasanypointersadeepcopyneedstobeexecuted.Withthedeepcopyofanobject,memoryisallocatedfortheobjectinfreestoreandtheelementspointedtoarecopied.Adeepcopyisusedforobjectsthatarereturnedfromafunction.34.Whatisanopaquepointer?Answer:Apointerissaidtobeopaqueifthedefinitionofthetypetowhichitpointstoisnotincludedinthecurrenttranslationunit.Atranslationunitistheresultofmerginganimplementationfilewithallitsheadersandheaderfiles.35.Whatisasmartpointer?Answer:Asmartpointerisanobjectthatacts,looksandfeelslikeanormalpointerbutoffersmorefunctionality.InC++,smartpointersareimplementedastemplateclassesthatencapsulateapointerandoverridestandardpointeroperators.Theyhaveanumberofadvantagesoverregularpointers.Theyareguaranteedtobeinitializedaseithernullpointersorpointerstoaheapobject.Indirectionthroughanullpointerischecked.Nodeleteisevernecessary.Objectsareautomaticallyfreedwhenthelastpointertothemhasgoneaway.Onesignificantproblemwiththesesmartpointersisthatunlikeregularpointers,theydon’trespectinheritance.Smartpointersareunattractiveforpolymorphiccode.Givenbelowisanexamplefortheimplementationofsmartpointers.Example:templateclasssmart_pointer{public:smart_pointer();//makesanullpointersmart_pointer(constX&x)//makespointertocopyofxX&operator*();constX&operator*()const;X*operator->()const;smart_pointer(constsmart_pointer&);constsmart_pointer&operator=(constsmart_pointer&);~smart_pointer();private://…};ThisclassimplementasmartpointertoanobjectoftypeX.Theobjectitselfislocatedontheheap.Hereishowtouseit:smart_pointerp=employee(“Harris”,1333);Likeotheroverloadedoperators,pwillbehavelikearegularpointer,coutraise_salary(0.5);36.Whatisreflexiveassociation?Answer:The‘is-a’iscalledareflexiveassociationbecausethereflexiveassociationpermitsclassestobeartheis-aassociationnotonlywiththeirsuper-classesbutalsowiththemselves.Itdiffersfroma‘specializes-from’as‘specializes-from’isusuallyusedtodescribetheassociationbetweenasuper-classandasub-class.Forexample:Printeris-aprinter.37.Whatisslicing?Answer:Slicingmeansthatthedataaddedbyasubclassarediscardedwhenanobjectofthesubclassispassedorreturnedbyvalueorfromafunctionexpectingabaseclassobject.Explanation:Considerthefollowingclassdeclaration:classbase{…base&operator=(constbase&);base(constbase&);}voidfun(){basee=m;e=m;}Asbasecopyfunctionsdon’tknowanythingaboutthederivedonlythebasepartofthederivediscopied.Thisiscommonlyreferredtoasslicing.Onereasontopassobjectsofclassesinahierarchyistoavoidslicing.Otherreasonsaretopreservepolymorphicbehaviorandtogainefficiency.38.Whatisnamemangling?Answer:Namemanglingistheprocessthroughwhichyourc++compilersgiveeachfunctioninyourprogramauniquename.InC++,allprogramshaveat-leastafewfunctionswiththesamename.Namemanglingisaconcessiontothefactthatlinkeralwaysinsistsonallfunctionnamesbeingunique.Example:Ingeneral,membernamesaremadeuniquebyconcatenatingthenameofthememberwiththatoftheclasse.g.giventhedeclaration:classBar{public:intival;…};ivalbecomessomethinglike://apossiblemembernamemanglingival__3BarConsiderthisderivation:classFoo:publicBar{public:intival;…}TheinternalrepresentationofaFooobjectistheconcatenationofitsbaseandderivedclassmembers.//PseudoC++code//InternalrepresentationofFooclassFoo{public:intival__3Bar;intival__3Foo;…};Unambiguousaccessofeitherivalmembersisachievedthroughnamemangling.Memberfunctions,becausetheycanbeoverloaded,requireanextensivemanglingtoprovideeachwithauniquename.Herethecompilergeneratesthesamenameforthetwooverloadedinstances(Theirargumentlistsmaketheirinstancesunique).39.Whatareproxyobjects?Answer:Objectsthatpointstootherobjectsarecalledproxyobjectsorsurrogates.Itsanobjectthatprovidesthesameinterfaceasitsserverobjectbutdoesnothaveanyfunctionality.Duringamethodinvocation,itroutesdatatothetrueserverobjectand40.DifferentiatebetweendeclarationanddefinitioninC++.Answer:Adeclarationintroducesanameintotheprogram;adefinitionprovidesauniquedescriptionofanentity(e.g.type,instance,andfunction).Declarationscanberepeatedinagivenscope,itintroducesanameinagivenscope.Theremustbeexactlyonedefinitionofeveryobject,functionorclassusedinaC++program.Adeclarationisadefinitionunless:itdeclaresafunctionwithoutspecifyingitsbody,itcontainsanexternspecifierandnoinitializerorfunctionbody,itisthedeclarationofastaticclassdatamemberwithoutaclassdefinition,itisaclassnamedefinition,itisatypedefdeclaration.Adefinitionisadeclarationunless:itdefinesastaticclassdatamember,itdefinesanon-inlinememberfunction.41.Whatiscloning?Answer:Anobjectcancarryoutcopyingintwowaysi.e.itcansetitselftobeacopyofanotherobject,oritcanreturnacopyofitself.Thelatterprocessiscalledcloning.42.Describethemaincharacteristicsofstaticfunctions.Answer:Themaincharacteristicsofstaticfunctionsinclude,Itiswithouttheathispointer,Itcan’tdirectlyaccessthenon-staticmembersofitsclassItcan’tbedeclaredconst,volatileorvirtual.Itdoesn’tneedtobeinvokedthroughanobjectofitsclass,althoughforconvenience,itmay.43.Willtheinlinefunctionbecompiledastheinlinefunctionalways?Justify.Answer:Aninlinefunctionisarequestandnotacommand.Henceitwon’tbecompiledasaninlinefunctionalways.Explanation:Inline-expansioncouldfailiftheinlinefunctioncontainsloops,theaddressofaninlinefunctionisused,oraninlinefunctioniscalledinacomplexexpression.Therulesforinliningarecompilerdependent.44.Defineawayotherthanusingthekeywordinlinetomakeafunctioninline.Answer:Thefunctionmustbedefinedinsidetheclass.45.Howcana‘::’operatorbeusedasunaryoperator?Answer:Thescopeoperatorcanbeusedtorefertomembersoftheglobalnamespace.Becausetheglobalnamespacedoesn’thaveaname,thenotation::member-namereferstoamemberoftheglobalnamespace.Thiscanbeusefulforreferringtomembersofglobalnamespacewhosenameshavebeenhiddenbynamesdeclaredinnestedlocalscope.Unlesswespecifytothecompilerinwhichnamespacetosearchforadeclaration,thecompilersimplesearchesthecurrentscope,andanyscopesinwhichthecurrentscopeisnested,tofindthedeclarationforthename.46.Whatisplacementnew?Answer:Whenyouwanttocallaconstructordirectly,youusetheplacementnew.Sometimesyouhavesomerawmemorythat’salreadybeenallocated,andyouneedtoconstructanobjectinthememoryyouhave.Operatornew’sspecialversionplacementnewallowsyoutodoit.classWidget{public:Widget(intwidgetsize);…Widget*Construct_widget_int_buffer(void*buffer,intwidgetsize){returnnew(buffer)Widget(widgetsize);}};ThisfunctionreturnsapointertoaWidgetobjectthat’sconstructedwithinthebufferpassedtothefunction.Suchafunctionmightbeusefulforapplicationsusingsharedmemoryormemory-mappedI/O,becauseobjectsinsuchapplicationsmustbeplacedatspecificaddressesorinmemoryallocatedbyspecialroutines.OOAD1.Whatdoyoumeanbyanalysisanddesign?Analysis:Basically,itistheprocessofdeterminingwhatneedstobedonebeforehowitshouldbedone.Inordertoaccomplishthis,thedeveloperreferstheexistingsystemsanddocuments.So,simplyitisanartofdiscovery.Design:Itistheprocessofadopting/choosingtheoneamongthemany,whichbestaccomplishestheusersneeds.So,simply,itiscompromisingmechanism.2.Whatarethestepsinvolvedindesigning?BeforegettingintothedesignthedesignershouldgothroughtheSRSpreparedbytheSystemAnalyst.ThemaintasksofdesignareArchitecturalDesignandDetailedDesign.InArchitecturalDesignwefindwhatarethemainmodulesintheproblemdomain.InDetailedDesignwefindwhatshouldbedonewithineachmodule.3.Whatarethemainunderlyingconceptsofobjectorientation?Objects,messages,class,inheritanceandpolymorphismarethemainconceptsofobjectorientation.4.Whatdoumeantby“SBI”ofanobject?SBIstandsforState,BehaviorandIdentity.Sinceeveryobjecthastheabovethree.State:Itisjustavaluetotheattributeofanobjectataparticulartime.Behaviour:Itdescribestheactionsandtheirreactionsofthatobject.Identity:Anobjecthasanidentitythatcharacterizesitsownexistence.Theidentitymakesitpossibletodistinguishanyobjectinanunambiguousway,andindependentlyfromitsstate.5.Differentiatepersistent&non-persistentobjects?Persistentreferstoanobject’sabilitytotranscendtimeorspace.Apersistentobjectstores/savesitsstateinapermanentstoragesystemwithoutlosingtheinformationrepresentedbytheobject.Anon-persistentobjectissaidtobetransientorephemeral.Bydefaultobjectsareconsideredasnon-persistent.6.Whatdoyoumeantbyactiveandpassiveobjects?Activeobjectsareonewhichinstigateaninteractionwhichownsathreadandtheyareresponsibleforhandlingcontroltootherobjects.Insimplewordsitcanbereferredasclient.Passiveobjectsareone,whichpassivelywaitsforthemessagetobeprocessed.Itwaitsforanotherobjectthatrequiresitsservices.Insimplewordsitcanbereferredasserver.Diagram:clientserver(Active)(Passive)7.Whatismeantbysoftwaredevelopmentmethod?Softwaredevelopmentmethoddescribeshowtomodelandbuildsoftwaresystemsinareliableandreproducibleway.Toputitsimple,methodsthatareusedtorepresentones’thinkingusinggraphicalnotations.8.Whataremodelsandmetamodels?Model:Itisacompletedescriptionofsomething(i.e.system).Metamodel:Itdescribesthemodelelements,syntaxandsemanticsofthenotationthatallowstheirmanipulation.9.Whatdoyoumeantbystaticanddynamicmodeling?Staticmodelingisusedtospecifystructureoftheobjectsthatexistintheproblemdomain.Theseareexpressedusingclass,objectandUSECASEdiagrams.ButDynamicmodelingrefersrepresentingtheobjectinteractionsduringruntime.Itisrepresentedbysequence,activity,collaborationandstatechartdiagrams.10.Howtorepresenttheinteractionbetweenthemodelingelements?Modelelementisjustanotationtorepresent(Graphically)theentitiesthatexistintheproblemdomain.e.g.formodelingelementisclassnotation,objectnotationetc.Relationshipsareusedtorepresenttheinteractionbetweenthemodelingelements.ThefollowingaretheRelationships.Association:Its’justasemanticconnectiontwoclasses.e.g.:Aggregation:Its’therelationshipbetweentwoclasseswhicharerelatedinthefashionthatmasterandslave.Themastertakesfullrightsthantheslave.Sincetheslaveworksunderthemaster.Itisrepresentedaslinewithdiamondinthemasterarea.ex:carcontainswheels,etc.carContainment:Thisrelationshipisappliedwhenthepartcontainedwithinthewholepart,dieswhenthewholepartdies.Itisrepresentedasdarkeddiamondatthewholepart.example:classA{//somecode};classB{Aaa;//anobjectofclassA;//somecodeforclassB;};IntheaboveexampleweseethatanobjectofclassAisinstantiatedwithintheclassB.sotheobjectclassAdieswhentheobjectclassBdies.wecanrepresntitindiagramlikethis.Generalization:Thisrelationshipusedwhenwewantrepresentsaclass,whichcapturesthecommonstatesofobjectsofdifferentclasses.Itisrepresentedasarrowlinepointedattheclass,whichhascapturedthecommonstates.Dependency:Itistherelationshipbetweendependentandindependentclasses.Anychangeintheindependentclasswillaffectthestatesofthedependentclass.DIAGRAM:classAclassB11.Whygeneralizationisverystrong?EventhoughGeneralizationsatisfiesStructural,Interface,Behaviourproperties.Itismathematicallyverystrong,asitisAntisymmetricandTransitive.Antisymmetric:employeeisaperson,butnotallpersonsareemployees.MathematicallyallAs’areB,butallBs’notA.Transitive:A=>B,B=>cthenA=>c.A.Salesman.B.Employee.C.Person.Note:AlltheotherrelationshipssatisfyallthepropertieslikeStructuralproperties,Interfaceproperties,Behaviourproperties.12.DifferentiateAggregationandcontainment?Aggregationistherelationshipbetweenthewholeandapart.Wecanadd/subtractsomepropertiesinthepart(slave)side.Itwon’taffectthewholepart.BestexampleisCar,whichcontainsthewheelsandsomeextraparts.Eventhoughthepartsarenottherewecancallitascar.But,inthecaseofcontainmentthewholepartisaffectedwhenthepartwithinthatgotaffected.Thehumanbodyisanaptexampleforthisrelationship.Whenthewholebodydiestheparts(heartetc)aredied.13.CanlinkandAssociationappliedinterchangeably?No,YoucannotapplythelinkandAssociationinterchangeably.Sincelinkisusedrepresenttherelationshipbetweenthetwoobjects.ButAssociationisusedrepresenttherelationshipbetweenthetwoclasses.link::student:Abhilashcourse:MCAAssociation::studentcourse14.whatismeantby“method-wars”?Before1994thereweredifferentmethodologieslikeRumbaugh,Booch,Jacobson,Meyeretcwhofollowedtheirownnotationstomodelthesystems.Thedeveloperswereinadilemmatochoosethemethodwhichbestaccomplishestheirneeds.Thisparticularspanwascalledas“method-wars”15.Whetherunifiedmethodandunifiedmodelinglanguagearesameordifferent?UnifiedmethodisconvergenceoftheRumbaughandBooch.Unifiedmodelinglang.isthefusionofRumbaugh,BoochandJacobsonaswellasBetrandMeyer(whosecontributionis“sequencediagram”).Its’thesupersetofallthemethodologies.16.Whowerethethreefamousamigosandwhatwastheircontributiontotheobjectcommunity?TheThreeamigosnamely,JamesRumbaugh(OMT):AveteraninanalysiswhocameupwithanideaabouttheobjectsandtheirRelationships(inparticularAssociations).GradyBooch:Aveteranindesignwhocameupwithanideaaboutpartitioningofsystemsintosubsystems.IvarJacobson(Objectory):ThefatherofUSECASES,whodescribedabouttheuserandsysteminteraction.17.DifferentiatetheclassrepresentationofBooch,RumbaughandUML?IfyoulookattheclassrepresentaitonofRumbaughandUML,Itissomewhatsimilarandbothareveryeasytodraw.Representation:OMTUML.Diagram:Booch:Inthismethodclassesarerepresentedas“Clouds”whicharenotveryeasytodrawasforasthedeveloper’sviewisconcern.Diagram:18.WhatisanUSECASE?Whyitisneeded?AUseCaseisadescriptionofasetofsequenceofactionsthatasystemperformsthatyieldsanobservableresultofvaluetoaparticularaction.InSSADprocessInOOADUSECASE.Itisrepresentedelliptically.Representation:19.WhoisanActor?AnActorissomeoneorsomethingthatmustinteractwiththesystem.InadditiontothatanActorinitiatestheprocess(thatisUSECASE).Itisrepresentedasastickmanlikethis.Diagram:20.Whatisguardcondition?Guardconditionisone,whichactsasafirewall.Theaccessfromaparticularobjectcanbemadeonlywhentheparticularconditionismet.ForExample,customercheckcustomernumberATM.HeretheobjectonthecustomeraccessestheATMfacilityonlywhentheguardconditionismet.21.Differentiatethefollowingnotations?I::obj1:obj2II::obj1:obj2IntheaboverepresentationI,obj1sendsmessagetoobj2.ButinthecaseofIIthedataistransferredfromobj1toobj2.22.USECASEisanimplementationindependentnotation.HowwillthedesignergivetheimplementationdetailsofaparticularUSECASEtotheprogrammer?Thiscanbeaccomplishedbyspecifyingtherelationshipcalled“refinement”whichtalksaboutthetwodifferentabstractionofthesamething.Orexample,calculatepaycalculateclass1class2class323.SupposeaclassactsanActorintheproblemdomain,howtorepresentitinthestaticmodel?Inthisscenarioyoucanuse“stereotype”.Sincestereotypeisjustastringthatgivesextrasemantictotheparticularentity/modelelement.Itisgivenwithinthe>.classA>attributesmethods.24.Whydoesthefunctionargumentsarecalledas“signatures”?Theargumentsdistinguishfunctionswiththesamename(functionalpolymorphism).Thenamealonedoesnotnecessarilyidentifyauniquefunction.However,thenameanditsarguments(signatures)willuniquelyidentifyafunction.Inreallifeweseesuppose,inclasstherearetwoguyswithsamename,buttheycanbeeasilyidentifiedbytheirsignatures.Thesameconceptisappliedhere.ex:classperson{public:chargetsex();voidsetsex(char);voidsetsex(int);};Intheaboveexampleweseethatthereisafunctionsetsex()withsamenamebutwithdifferentsignature.QuantitativeAptitudeExercise1Solvethefollowingandcheckwiththeanswersgivenattheend.1.Itwascalculatedthat75mencouldcompleteapieceofworkin20days.Whenworkwasscheduledtocommence,itwasfoundnecessarytosend25mentoanotherproject.Howmuchlongerwillittaketocompletethework?2.Astudentdividedanumberby2/3whenherequiredtomultiplyby3/2.Calculatethepercentageoferrorinhisresult.3.Adishonestshopkeeperprofessestosellpulsesatthecostprice,butheusesafalseweightof950gm.forakg.Hisgainis…%.4.Asoftwareengineerhasthecapabilityofthinking100linesofcodeinfiveminutesandcantype100linesofcodein10minutes.Hetakesabreakforfiveminutesaftereverytenminutes.Howmanylinesofcodeswillhecompletetypingafteranhour?5.Amanwasengagedonajobfor30daysontheconditionthathewouldgetawageofRs.10forthedayheworks,buthehavetopayafineofRs.2foreachdayofhisabsence.IfhegetsRs.216attheend,hewasabsentforworkfor…days.6.Acontractoragreeingtofinishaworkin150days,employed75meneachworking8hoursdaily.After90days,only2/7oftheworkwascompleted.Increasingthenumberofmenby________eachworkingnowfor10hoursdaily,theworkcanbecompletedintime.7.whatisapercentofbdividedbybpercentofa?(a)a(b)b(c)1(d)10(d)1008.Amanboughtahorseandacart.Ifhesoldthehorseat10%lossandthecartat20%gain,hewouldnotloseanything;butifhesoldthehorseat5%lossandthecartat5%gain,hewouldloseRs.10inthebargain.TheamountpaidbyhimwasRs._______forthehorseandRs.________forthecart.9.Atennismarkeristryingtoputtogetherateamoffourplayersforatennistournamentoutofsevenavailable.males–a,bandc;females–m,n,oandp.Allplayersareofequalabilityandtheremustbeatleasttwomalesintheteam.Forateamoffour,allplayersmustbeabletoplaywitheachotherunderthefollowingrestrictions:bshouldnotplaywithm,cshouldnotplaywithp,andashouldnotplaywitho.Whichofthefollowingstatementsmustbefalse?1.bandpcannotbeselectedtogether2.candocannotbeselectedtogether3.candncannotbeselectedtogether.10-12.Thefollowingfiguredepictsthreeviewsofacube.Basedonthis,answerquestions10-12.6541223610.Thenumberonthefaceoppositetothefacecarrying1is_______.11.Thenumberonthefacesadjacenttothefacemarked5are_______.12.Whichofthefollowingpairsdoesnotcorrectlygivethenumbersontheoppositefaces.(1)6,5(2)4,1(3)1,3(4)4,213.Fivefarmershave7,9,11,13&14appletrees,respectivelyintheirorchards.Lastyear,eachofthemdiscoveredthateverytreeintheirownorchardboreexactlythesamenumberofapples.Further,ifthethirdfarmergivesoneappletothefirst,andthefifthgivesthreetoeachofthesecondandthefourth,theywouldallhaveexactlythesamenumberofapples.Whatweretheyieldspertreeintheorchardsofthethirdandfourthfarmers?14.Fiveboyswereclimbingahill.JwasfollowingH.RwasjustaheadofG.KwasbetweenG&H.Theywereclimbingupinacolumn.Whowasthesecond?15-18Johnisundecidedwhichofthefournovelstobuy.Heisconsideringaspythriller,aMurdermystery,aGothicromanceandasciencefictionnovel.ThebooksarewrittenbyRothko,Gorky,BurchfieldandHopper,notnecessaryinthatorder,andpublishedbyHeron,Piegon,Bluejaandsparrow,notnecessaryinthatorder.(1)ThebookbyRothkoispublishedbySparrow.(2)TheSpythrillerispublishedbyHeron.(3)ThesciencefictionnovelisbyBurchfieldandisnotpublishedbyBlueja.(4)TheGothicromanceisbyHopper.15.Pigeonpublishes____________.16.ThenovelbyGorky________________.17.Johnpurchasesbooksbytheauthorswhosenamescomefirstandthirdinalphabeticalorder.Hedoesnotbuythebooks______.18.Onthebasisofthefirstparagraphandstatement(2),(3)and(4)only,itispossibletodeducethat1.Rothkowrotethemurdermysteryorthespythriller2.Sparrowpublishedthemurdermysteryorthespythriller3.ThebookbyBurchfieldispublishedbySparrow.19.Ifalightflashesevery6seconds,howmanytimeswillitflashin¾ofanhour?20.IfpointPisonlinesegmentAB,thenwhichofthefollowingisalwaystrue?(1)AP=PB(2)AP>PB(3)PB>AP(4)AB>AP(5)AB>AP+PB21.Allmenarevertebrates.Somemammalsarevertebrates.Whichofthefollowingconclusionsdrawnfromtheabovestatementiscorrect.AllmenaremammalsAllmammalsaremenSomevertebratesaremammals.None22.Whichofthefollowingstatementsdrawnfromthegivenstatementsarecorrect?Given:Allwatchessoldinthatshopareofhighstandard.SomeoftheHMTwatchesaresoldinthatshop.a)AllwatchesofhighstandardweremanufacturedbyHMT.b)SomeoftheHMTwatchesareofhighstandard.c)NoneoftheHMTwatchesisofhighstandard.d)SomeoftheHMTwatchesofhighstandardaresoldinthatshop.23-27.1.AshlandisnorthofEastLiverpoolandwestofCoshocton.2.BowlinggreenisnorthofAshlandandwestofFredericktown.3.DoverissouthandeastofAshland.4.EastLiverpoolisnorthofFredericktownandeastofDover.5.FredericktownisnorthofDoverandwestofAshland.6.CoshoctonissouthofFredericktownandwestofDover.23.Whichofthetownsmentionedisfurthestofthenorth–west(a)Ashland(b)Bowlinggreen(c)Coshocton(d)EastLiverpool(e)Fredericktown24.WhichofthefollowingmustbebothnorthandeastofFredericktown?(a)Ashland(b)Coshocton(c)EastLiverpoolIaonlyIIbonlyIIIconlyIVa&bVa&c25.Whichofthefollowingtownsmustbesituatedbothsouthandwestofatleastoneothertown?A.AshlandonlyB.AshlandandFredericktownC.DoverandFredericktownD.Dover,CoshoctonandFredericktownE.Coshocton,DoverandEastLiverpool.26.Whichofthefollowingstatements,iftrue,wouldmaketheinformationinthenumberedstatementsmorespecific?(a)CoshoctonisnorthofDover.(b)EastLiverpoolisnorthofDover(c)AshlandiseastofBowlinggreen.(d)CoshoctoniseastofFredericktown(e)BowlinggreenisnorthofFredericktown27.Whichofthenumberedstatementsgivesinformationthatcanbededucedfromoneormoreoftheotherstatements?(A)1(B)2(C)3(D)4(E)628.EightfriendsHarsha,Fakis,Balaji,Eswar,Dhinesh,Chandra,Geetha,andAhmedaresittinginacirclefacingthecenter.BalajiissittingbetweenGeethaandDhinesh.HarshaisthirdtotheleftofBalajiandsecondtotherightofAhmed.ChandraissittingbetweenAhmedandGeethaandBalajiandEshwararenotsittingoppositetoeachother.WhoisthirdtotheleftofDhinesh?29.IfeveryalternativeletterstartingfromBoftheEnglishalphabetiswritteninsmallletter,restallarewrittenincapitalletters,howthemonth“September”bewritten.(1)SeptEMbEr(2)SEpTeMBEr(3)SeptembeR(4)SepteMber(5)Noneoftheabove.30.Thelengthofthesideofasquareisrepresentedbyx+2.Thelengthofthesideofanequilateraltriangleis2x.Ifthesquareandtheequilateraltrianglehaveequalperimeter,thenthevalueofxis_______.31.IttakesMr.Karthikyhourstocompletetypingamanuscript.After2hours,hewascalledaway.Whatfractionalpartoftheassignmentwasleftincomplete?32.Whichofthefollowingislargerthan3/5?(1)½(2)39/50(3)7/25(4)3/10(5)59/10033.Thenumberthatdoesnothaveareciprocalis____________.34.Thereare3personsSudhir,Arvind,andGauri.SudhirlentcarstoArvindandGauriasmanyastheyhadalready.AftersometimeArvindgaveasmanycarstoSudhirandGauriasmanyastheyhave.AftersometimeGaurididthesamething.Attheendofthistransactioneachoneofthemhad24.Findthecarseachoriginallyhad.35.Amanboughtahorseandacart.Ifhesoldthehorseat10%lossandthecartat20%gain,hewouldnotloseanything;butifhesoldthehorseat5%lossandthecartat5%gain,hewouldloseRs.10inthebargain.TheamountpaidbyhimwasRs._______forthehorseandRs.________forthecart.Answers:1.Answer:30days.Explanation:Before:Onedaywork=1/20Oneman’sonedaywork=1/(20*75)Now:No.Ofworkers=50Onedaywork=50*1/(20*75)Thetotalno.ofdaysrequiredtocompletethework=(75*20)/50=302.Answer:0%Explanation:Since3x/2=x/(2/3)3.Answer:5.3%Explanation:Hesells950gramsofpulsesandgains50grams.Ifhesells100gramsofpulsesthenhewillgain(50/950)*100=5.264.Answer:250linesofcodes5.Answer:7daysExplanation:Theequationportrayingthegivenproblemis:10*x–2*(30–x)=216wherexisthenumberofworkingdays.Solvingthiswegetx=23Numberofdayshewasabsentwas7(30-23)days.6.Answer:150men.Explanation:Oneday’swork=2/(7*90)Onehour’swork=2/(7*90*8)Oneman’swork=2/(7*90*8*75)Theremainingwork(5/7)hastobecompletedwithin60days,becausethetotalnumberofdaysallottedfortheprojectis150days.Sowegettheequation(2*10*x*60)/(7*90*8*75)=5/7wherexisthenumberofmenworkingafterthe90thday.Wegetx=225Sincewehave75menalready,itisenoughtoaddonly150men.7.Answer:(c)1Explanation:apercentofb:(a/100)*bbpercentofa:(b/100)*aapercentofbdividedbybpercentofa:((a/100)*b)/(b/100)*a))=18.Answer:Costpriceofhorse=Rs.400&thecostpriceofcart=200.Explanation:-Letxbethecostpriceofthehorseandybethecostpriceofthecart.Inthefirstsalethereisnolossorprofit.(i.e.)Thelossobtainedisequaltothegain.Therefore(10/100)*x=(20/100)*yX=2*y—————–(1)Inthesecondsale,helostRs.10.(i.e.)ThelossisgreaterthantheprofitbyRs.10.Therefore(5/100)*x=(5/100)*y+10——-(2)Substituting(1)in(2)weget(10/100)*y=(5/100)*y+10(5/100)*y=10y=200From(1)2*200=x=4009.Answer:3.Explanation:Sinceinclusionofanymaleplayerwillrejectafemalefromtheteam.Sincethereshouldbefourmemberintheteamandonlythreemalesareavailable,thegirl,nshouldincludedintheteamalwaysirrespectiveofothersselection.10.Answer:511.Answer:1,2,3&412.Answer:B13.Answer:11&9applespertree.Explanation:Leta,b,c,d&ebethetotalnumberofapplesboredperyearinA,B,C,D&E‘sorchard.Giventhata+1=b+3=c–1=d+3=e–6ButthequestionistofindthenumberofapplesboredpertreeinCandD‘sorchard.Ifisenoughtoconsiderc–1=d+3.SincethenumberoftreesinC’sorchardis11andthatofD’sorchardis13.LetxandybethenumberofapplesboredpertreeinC&d‘sorchardrespectively.Therefore11x–1=13y+3Bytrialanderrormethod,wegetthevalueforxandyas11and914.Answer:G.Explanation:TheorderinwhichtheyareclimbingisR–G–K–H–J15–18Answer:NovelNameAuthorPublisherSpythrillerRathkoHeronMurdermysteryGorkyPiegonGothicromanceBurchfieldBluejaSciencefictionHopperSparrowExplanation:GivenNovelNameAuthorPublisherSpythrillerRathkoHeronMurdermysteryGorkyPiegonGothicromanceBurchfieldBluejaSciencefictionHopperSparrowSinceBluejadoesn’tpublishthenovelbyBurchfieldandHeronpublishesthenovelspythriller,PiegonpublishesthenovelbyBurchfield.SinceHopperwritesGothicromanceandHeronpublishesthenovelspythriller,BluejapublishesthenovelbyHopper.SinceHeronpublishesthenovelspythrillerandHeronpublishesthenovelbyGorky,GorkywritesSpythrillerandRathkowritesMurdermystery.19.Answer:451times.Explanation:Thereare60minutesinanhour.In¾ofanhourthereare(60*¾)minutes=45minutes.In¾ofanhourthereare(60*45)seconds=2700seconds.Lightflashedforevery6seconds.In2700seconds2700/6=450times.Thecountstartafterthefirstflash,thelightwillflashes451timesin¾ofanhour.20.Answer:(4)Explanation:PABSincepisapointonthelinesegmentAB,AB>AP21.Answer:(c)22.Answer:(b)&(d).Ahmed23–27.Answer:FakisChandra28.Answer:FakisExplanation:HarshaGeethaEswarBalajiDhinesh29.Answer:(5).Explanation:SinceeveryalternativeletterstartingfromBoftheEnglishalphabetiswritteninsmallletter,theletterswritteninsmallletterareb,d,f…InthefirsttwoanswerstheletterEiswritteninbothsmall&capitalletters,sotheyarenotthecorrectanswers.Butinthirdandfourthanswerstheletteriswritteninsmallletterinsteadcapitalletter,sotheyarenottheanswers.30.Answer:x=4Explanation:Sincethesideofthesquareisx+2,itsperimeter=4(x+2)=4x+8Sincethesideoftheequilateraltriangleis2x,itsperimeter=3*2x=6xAlso,theperimetersofbothareequal.(i.e.)4x+8=6x(i.e.)2x=8x=4.31.Answer:(y–2)/y.Explanation:Totypeamanuscriptkarthiktookyhours.Thereforehisspeedintyping=1/y.Hewascalledawayafter2hoursoftyping.Thereforetheworkcompleted=1/y*2.Thereforetheremainingworktobecompleted=1–2/y.(i.e.)worktobecompleted=(y-2)/y32.Answer:(2)33.Answer:1Explanation:Oneistheonlynumberexistswithoutreciprocalbecausethereciprocalofoneisoneitself.34.Answer:Sudhirhad39cars,Arvindhad21carsandGaurihad12cars.Explanation:SudhirArvindGauriFinally242424BeforeGauri’stransaction121248BeforeArvind’stransaction64224BeforeSudhir’stransaction39211235.Answer:Costpriceofhorse:Rs.400&Costpriceofcart:Rs.200Explanation:Letxbethecostofhorse&ybethecostofthecart.10%oflossinsellinghorse=20%ofgaininsellingthecartTherefore(10/100)*x=(20*100)*yx=2y———–(1)5%oflossinsellingthehorseis10morethanthe5%gaininsellingthecart.Therefore(5/100)*x–10=(5/100)*y5x–1000=5ySubstituting(1)10y–1000=5y5y=1000y=200x=400from(1)Exercise2.1Forthefollowing,findthenexttermintheseries1.6,24,60,120,210a)336b)366c)330d)660Answer:a)336Explanation:Theseriesis1.2.3,2.3.4,3.4.5,4.5.6,5.6.7,…..(‘.’meansproduct)2.1,5,13,25Answer:41Explanation:Theseriesisoftheform0^2+1^2,1^2+2^2,…3.0,5,8,17Answer:24Explanation:1^2-1,2^2+1,3^2-1,4^2+1,5^2-14.1,8,9,64,25(Hint:Everysuccessivetermsarerelated)Answer:216Explanation:1^2,2^3,3^2,4^3,5^2,6^35.8,24,12,36,18,54Answer:276.71,76,69,74,67,72Answer:677.5,9,16,29,54Answer:103Explanation:5*2-1=9;9*2-2=16;16*2-3=29;29*2-4=54;54*2-5=1038.1,2,4,10,16,40,64(Successivetermsarerelated)Answer:200Explanation:Theseriesispowersof2(2^0,2^1,..).Alldigitsarelessthan8.Everysecondnumberisinoctalnumbersystem.128shouldfollow64.128base10=200base8.Exercise2.2Findtheoddmanout.1.3,5,7,12,13,17,19Answer:12Explanation:Allbut12areoddnumbers2.2,5,10,17,26,37,50,64Answer:64Explanation:2+3=5;5+5=10;10+7=17;17+9=26;26+11=37;37+13=50;50+15=65;3.105,85,60,30,0,-45,-90Answer:0Explanation:105-20=85;85-25=60;60-30=30;30-35=-5;-5-40=-45;-45-45=-90;Exercise3Solvethefollowing.1.Whatisthenumberofzerosattheendoftheproductofthenumbersfrom1to100?Answer:1272.Afasttypistcantypesomematterin2hoursandaslowtypistcantypethesamein3hours.Ifbothtypecombinely,inhowmuchtimewilltheyfinish?Answer:1hr12minExplanation:Thefasttypist’sworkdonein1hr=1/2Theslowtypist’sworkdonein1hr=1/3Iftheyworkcombinely,workdonein1hr=1/2+1/3=5/6So,theworkwillbecompletedin6/5hours.i.e.,1+1/5hours=1hr12min3.Gavaskar’saverageinhisfirst50inningswas50.Afterthe51stinnings,hisaveragewas51.Howmanyrunsdidhescoreinhis51stinnings.(supposingthathelosthiswicketinhis51stinnings)Answer:101Explanation:Totalscoreafter50innings=50*50=2500Totalscoreafter51innings=51*51=2601So,runsmadeinthe51stinnings=2601-2500=101Ifhehadnotlosthiswicketinhis51stinnings,hewouldhavescoredanunbeaten50inhis51stinnings.4.Outof80coins,oneiscounterfeit.Whatistheminimumnumberofweighingsneededtofindoutthecounterfeitcoin?Answer:45.Whatcanyouconcludefromthestatement:Allgreenareblue,allbluearered.?(i)somebluearegreen(ii)someredaregreen(iii)somegreenarenotred(iv)allredareblue(a)ioriibutnotboth(b)i&iionly(c)iiiorivbutnotboth(d)iii&ivAnswer:(b)6.Arectangularplatewithlength8inches,breadth11inchesandthickness2inchesisavailable.Whatisthelengthofthecircularrodwithdiameter8inchesandequaltothevolumeoftherectangularplate?Answer:3.5inchesExplanation:Volumeofthecircularrod(cylinder)=Volumeoftherectangularplate(22/7)*4*4*h=8*11*2h=7/2=3.57.Whatisthesumofallnumbersbetween100and1000whicharedivisibleby14?Answer:35392Explanation:Thenumberclosestto100whichisgreaterthan100anddivisibleby14is112,whichisthefirsttermoftheserieswhichhastobesummed.Thenumberclosestto1000whichislessthan1000anddivisibleby14is994,whichisthelasttermoftheseries.112+126+….+994=14(8+9+…+71)=353928.Ifs(a)denotessquarerootofa,findthevalueofs(12+s(12+s(12+……uptoinfinity.Answer:4Explanation:Letx=s(12+s(12+s(12+…..Wecanwritex=s(12+x).i.e.,x^2=12+x.Solvingthisquadraticequation,wegetx=-3orx=4.Sumcannotbe-veandhencesum=4.9.Acylindricalcontainerhasaradiusofeightincheswithaheightofthreeinches.Computehowmanyinchesshouldbeaddedtoeithertheradiusorheighttogivethesameincreaseinvolume?Answer:16/3inchesExplanation:Letxbetheamountofincrease.Thevolumewillincreasebythesameamountiftheradiusincreasedortheheightisincreased.So,theeffectonincreasingheightisequaltotheeffectonincreasingtheradius.i.e.,(22/7)*8*8*(3+x)=(22/7)*(8+x)*(8+x)*3Solvingthequadraticequationwegetthex=0or16/3.Thepossibleincreasewouldbeby16/3inches.10.Withjustsixweightsandabalancescale,youcanweighanyunitnumberofkgsfrom1to364.Whatcouldbethesixweights?Answer:1,3,9,27,81,243(Allpowersof3)11.Diophantuspassedonesixthofhislifeinchildhood,onetwelfthinyouth,andoneseventhmoreasabachelor;fiveyearsafterhismarriageasonwasbornwhodiedfouryearsbeforehisfatherathalfhisfinalage.HowoldisDiophantus?Answer:84yearsExplanation:x/6+x/12+x/7+5+x/2+4=x12.Iftimeatthismomentis9P.M.,whatwillbethetime23999999992hourslater?Answer:1P.M.Explanation:24billionhourslater,itwouldbe9P.M.and8hoursbeforethatitwouldbe1P.M.13.Howbigwillanangleofoneandahalfdegreelookthroughaglassthatmagnifiesthingsthreetimes?Answer:11/2degreesExplanation:Themagnifyingglasscannotincreasethemagnitudeofanangle.14.Divide45intofourpartssuchthatwhen2isaddedtothefirstpart,2issubtractedfromthesecondpart,2ismultipliedbythethirdpartandthefourthpartisdividedbytwo,allresultinthesamenumber.Answer:8,12,5,20Explanation:a+b+c+d=45;a+2=b-2=2c=d/2;a=b-4;c=(b-2)/2;d=2(b-2);b-4+b+(b-2)/2+2(b-2)=45;15.Idrove60kmat30kmphandthenanadditional60kmat50kmph.Computemyaveragespeedovermy120km.Answer:371/2Explanation:Timereqdforthefirst60km=120min.;Timereqdforthesecond60km=72min.;Totaltimereqd=192minAvgspeed=(60*120)/192=371/2Questions16and17arebasedonthefollowing:FiveexecutivesofEuropeanCorporationholdaConferenceinRomeMr.AconversesinSpanish&ItalianMr.B,aspaniard,knowsEnglishalsoMr.CknowsEnglishandbelongstoItalyMr.DconversesinFrenchandSpanishMr.E,anativeofItalyknowsFrench16.WhichofthefollowingcanactasinterpreterifMr.C&Mr.Dwishtoconversea)onlyMr.Ab)OnlyMr.Bc)Mr.A&Mr.Bd)AnyoftheotherthreeAnswer:d)Anyoftheotherthree.Explanation:Fromthedatagiven,wecaninferthefollowing.AknowsSpanish,ItalianBknowsSpanish,EnglishCknowsItalian,EnglishDknowsSpanish,FrenchEknowsItalian,FrenchToactasaninterpreterbetweenCandD,apersonhastoknowoneofthecombinationsItalian&Spanish,Italian&French,English&Spanish,English&FrenchA,B,andEknowatleastoneofthecombinations.17.Ifa6thexecutiveisbroughtin,tobeunderstoodbymaximumnumberoforiginalfiveheshouldbefluentina)English&Frenchb)Italian&Spanishc)English&Frenchd)French&ItalianAnswer:b)Italian&SpanishExplanation:Noofexecutiveswhoknowi)Englishis2ii)Spanishis3iii)Italianis3iv)Frenchis2Italian&Spanisharespokenbythemaximumnoofexecutives.So,ifthe6thexecutiveisfluentinItalian&Spanish,hecancommunicatewithalltheoriginalfivebecauseeverybodyknowseitherSpanishorItalian.18.Whatisthesumofthefirst25naturaloddnumbers?Answer:625Explanation:Thesumofthefirstnnaturaloddnosissquare(n).1+3=4=square(2)1+3+5=9=square(3)19.Thesumofanysevenconsecutivenumbersisdivisiblebya)2b)7c)3d)11Exercise3Trythefollowing.1.Thereareseventyclerksworkinginacompany,ofwhich30arefemales.Also,30clerksaremarried;24clerksareabove25yearsofage;19marriedclerksareabove25years,ofwhich7aremales;12malesareabove25yearsofage;and15malesaremarried.Howmanybachelorgirlsarethereandhowmanyoftheseareabove25?2.AmansailedofffromtheNorthPole.Aftercovering2,000milesinonedirectionheturnedWest,sailed2,000miles,turnedNorthandsailedaheadanother2,000milestillhemethisfriend.HowfarwashefromtheNorthPoleandinwhatdirection?3.HereisaseriesofcommentsontheagesofthreepersonsJ,R,Sbythemselves.S:ThedifferencebetweenR’sageandmineisthreeyears.J:Ristheyoungest.R:EitherIam24yearsoldorJ25orS26.J:Allareabove24yearsofage.S:IamtheeldestifandonlyifRisnottheyoungest.R:Siseldertome.J:Iamtheeldest.R:Sisnot27yearsold.S:ThesumofmyageandJ’sistwomorethantwiceR’sage.Oneofthethreehadbeentellingaliethroughoutwhereasothershadspokenthetruth.DeterminetheagesofS,J,R.4.Inagroupoffivepeople,whatistheprobabilityoffindingtwopersonswiththesamemonthofbirth?5.Afatherandhissongooutfora‘walk-and-run’everymorningaroundatrackformedbyanequilateraltriangle.Thefather’swalkingspeedis2mphandhisrunningspeedis5mph.Theson’swalkingandrunningspeedsaretwicethatofhisfather.Bothstarttogetherfromoneapexofthetriangle,thesongoingclockwiseandthefatheranti-clockwise.Initiallythefatherrunsandthesonwalksforacertainperiodoftime.Thereafter,assoonasthefatherstartswalking,thesonstartsrunning.Bothcompletethecoursein45minutes.Forhowlongdoesthefatherrun?Wheredothetwocrosseachother?6.TheDirectorofMedicalServiceswasonhisannualvisittotheENTHospital.Whilegoingthroughtheoutpatients’recordshecameacrossthefollowingdataforaparticularday:”Earconsultations45;Nose50;Throat70;EarandNose30;NoseandThroat20;EarandThroat30;Ear,NoseandThroat10;Totalpatients100.”Thenhecametotheconclusionthattherecordswerebogus.Washeright?7.AmongstRam,ShamandGobindareadoctor,alawyerandapoliceofficer.TheyaremarriedtoRadha,GitaandSita(notinorder).Eachofthewiveshaveaprofession.Gobind’swifeisanartist.RamisnotmarriedtoGita.Thelawyer’swifeisateacher.Radhaismarriedtothepoliceofficer.Sitaisanexpertcook.Who’swho?8.Whatshouldcomenext?1,2,4,10,16,40,64,Questions9-12arebasedonthefollowing:Threeadults–Roberto,SarahandVicky–willbetravelinginavanwithfivechildren–Freddy,Hillary,Jonathan,Lupe,andMarta.Thevanhasadriver’sseatandonepassengerseatinthefront,andtwobenchesbehindthefrontseats,onebeachbehindtheother.Eachbenchhasroomforexactlythreepeople.Everyonemustsitinaseatoronabench,andseatingissubjecttothefollowingrestrictions:Anadultmustsitoneachbench.EitherRobertoorSarahmustsitinthedriver’sseat.JonathanmustsitimmediatelybesideMarta.9.Ofthefollowing,whocansitinthefrontpassengerseat?(a)Jonathan(b)Lupe(c)Roberto(d)Sarah(e)Vicky10.Whichofthefollowinggroupsofthreecansittogetheronabench?(a)Freddy,JonathanandMarta(b)Freddy,JonathanandVicky(c)Freddy,SarahandVicky(d)Hillary,LupeandSarah(e)Lupe,MartaandRoberto11.IfFreddysitsimmediatelybesideVicky,whichofthefollowingcannotbetrue?a.JonathansitsimmediatelybesideSarahb.LupesitsimmediatelybesideVickyc.Hillarysitsinthefrontpassengerseatd.FreddysitsonthesamebenchasHillarye.HillarysitsonthesamebenchasRoberto12.IfSarahsitsonabenchthatisbehindwhereJonathanissitting,whichofthefollowingmustbetrue?a.HillarysitsinaseatoronabenchthatisinfrontofwhereMartaissittingb.LupesitsinaseatoronabenchthatisinfrontofwhereFreddyissittingc.FreddysitsonthesamebenchasHillaryd.LupesitsonthesamebenchasSarahe.MartasitsonthesamebenchasVicky13.Makesixsquaresofthesamesizeusingtwelvematch-sticks.(Hint:Youwillneedanadhesivetoarrangetherequiredfigure)14.Afarmerhastworectangularfields.Thelargerfieldhastwicethelengthand4timesthewidthofthesmallerfield.IfthesmallerfieldhasareaK,thentheareofthelargerfieldisgreaterthantheareaofthesmallerfieldbywhatamount?(a)6K(b)8K(c)12K(d)7K15.Nineequalcirclesareenclosedinasquarewhoseareais36squnits.Findtheareaofeachcircle.16.Thereare9cards.Arrangethemina3*3matrix.Cardsareof4colors.Theyarered,yellow,blue,green.Conditionsforarrangement:oneredcardmustbeinfirstroworsecondrow.2greencardsshouldbein3rdcolumn.Yellowcardsmustbeinthe3cornersonly.Twobluecardsmustbeinthe2ndrow.Atleastonegreencardineachrow.17.Iszlessthanw?zandwarerealnumbers.(I)z2=25(II)w=9Toanswerthequestion,a)EitherIorIIissufficientb)BothIandIIaresufficientbutneitherofthemisalonesufficientc)I&IIaresufficientd)Botharenotsufficient18.Aspeakstruth70%ofthetime;Bspeakstruth80%ofthetime.Whatistheprobabilitythatbotharecontradictingeachother?19.Inafamily7childrendon’teatspinach,6don’teatcarrot,5don’teatbeans,4don’teatspinach&carrots,3don’teatcarrot&beans,2don’teatbeans&spinach.Onedoesn’teatall3.Findtheno.ofchildren.20.Anna,Bena,CatherinaandDianaareattheirmonthlybusinessmeeting.Theiroccupationsareauthor,biologist,chemistanddoctor,butnotnecessarilyinthatorder.Dianajusttoldtheneighbour,whoisabiologistthatCatherinawasonherwaywithdoughnuts.Annaissittingacrossfromthedoctorandnexttothechemist.ThedoctorwasthinkingthatBenawasagoodnameforparent’stochoose,butdidn’tsayanything.Whatiseachperson’soccupation?UNIXConceptsSECTION–IFILEMANAGEMENTINUNIX1.HowaredevicesrepresentedinUNIX?Alldevicesarerepresentedbyfilescalledspecialfilesthatarelocatedin/devdirectory.Thus,devicefilesandotherfilesarenamedandaccessedinthesameway.A‘regularfile’isjustanordinarydatafileinthedisk.A‘blockspecialfile’representsadevicewithcharacteristicssimilartoadisk(datatransferintermsofblocks).A‘characterspecialfile’representsadevicewithcharacteristicssimilartoakeyboard(datatransferisbystreamofbitsinsequentialorder).2.Whatis‘inode’?AllUNIXfileshaveitsdescriptionstoredinastructurecalled‘inode’.Theinodecontainsinfoaboutthefile-size,itslocation,timeoflastaccess,timeoflastmodification,permissionandsoon.Directoriesarealsorepresentedasfilesandhaveanassociatedinode.Inadditiontodescriptionsaboutthefile,theinodecontainspointerstothedatablocksofthefile.Ifthefileislarge,inodehasindirectpointertoablockofpointerstoadditionaldatablocks(thisfurtheraggregatesforlargerfiles).Ablockistypically8k.Inodeconsistsofthefollowingfields:FileowneridentifierFiletypeFileaccesspermissionsFileaccesstimesNumberoflinksFilesizeLocationofthefiledata3.BriefaboutthedirectoryrepresentationinUNIXAUnixdirectoryisafilecontainingacorrespondencebetweenfilenamesandinodes.Adirectoryisaspecialfilethatthekernelmaintains.Onlykernelmodifiesdirectories,butprocessescanreaddirectories.Thecontentsofadirectoryarealistoffilenameandinodenumberpairs.Whennewdirectoriesarecreated,kernelmakestwoentriesnamed‘.’(referstothedirectoryitself)and‘..’(referstoparentdirectory).Systemcallforcreatingdirectoryismkdir(pathname,mode).4.WhataretheUnixsystemcallsforI/O?open(pathname,flag,mode)–openfilecreat(pathname,mode)–createfileclose(filedes)–closeanopenfileread(filedes,buffer,bytes)–readdatafromanopenfilewrite(filedes,buffer,bytes)–writedatatoanopenfilelseek(filedes,offset,from)–positionanopenfiledup(filedes)–duplicateanexistingfiledescriptordup2(oldfd,newfd)–duplicatetoadesiredfiledescriptorfcntl(filedes,cmd,arg)–changepropertiesofanopenfileioctl(filedes,request,arg)–changethebehaviourofanopenfileThedifferencebetweenfcntlanfioctlisthattheformerisintendedforanyopenfile,whilethelatterisfordevice-specificoperations.5.HowdoyouchangeFileAccessPermissions?Everyfilehasfollowingattributes:owner’suserID(16bitinteger)owner’sgroupID(16bitinteger)Fileaccessmodeword‘rwx-rwx-rwx’(userpermission-grouppermission-otherspermission)r-read,w-write,x-executeTochangetheaccessmode,weusechmod(filename,mode).Example1:Tochangemodeofmyfileto‘rw-rw-r–‘(ie.read,writepermissionforuser–read,writepermissionforgroup–onlyreadpermissionforothers)wegivetheargsas:chmod(myfile,0664).Eachoperationisrepresentedbydiscretevalues‘r’is4‘w’is2‘x’is1Therefore,for‘rw’thevalueis6(4+2).Example2:Tochangemodeofmyfileto‘rwxr–r–‘wegivetheargsas:chmod(myfile,0744).6.WhatarelinksandsymboliclinksinUNIXfilesystem?Alinkisasecondname(notafile)forafile.Linkscanbeusedtoassignmorethanonenametoafile,butcannotbeusedtoassignadirectorymorethanonenameorlinkfilenamesondifferentcomputers.Symboliclink‘is’afilethatonlycontainsthenameofanotherfile.Operationonthesymboliclinkisdirectedtothefilepointedbytheit.Boththelimitationsoflinksareeliminatedinsymboliclinks.Commandsforlinkingfilesare:Linklnfilename1filename2Symboliclinkln-sfilename1filename27.WhatisaFIFO?FIFOareotherwisecalledas‘namedpipes’.FIFO(first-in-first-out)isaspecialfilewhichissaidtobedatatransient.Oncedataisreadfromnamedpipe,itcannotbereadagain.Also,datacanbereadonlyintheorderwritten.Itisusedininterprocesscommunicationwhereaprocesswritestooneendofthepipe(producer)andtheotherreadsfromtheotherend(consumer).8.Howdoyoucreatespecialfileslikenamedpipesanddevicefiles?Thesystemcallmknodcreatesspecialfilesinthefollowingsequence.1.kernelassignsnewinode,2.setsthefiletypetoindicatethatthefileisapipe,directoryorspecialfile,3.Ifitisadevicefile,itmakestheotherentrieslikemajor,minordevicenumbers.Forexample:Ifthedeviceisadisk,majordevicenumberreferstothediskcontrollerandminordevicenumberisthedisk.9.DiscussthemountandunmountsystemcallsTheprivilegedmountsystemcallisusedtoattachafilesystemtoadirectoryofanotherfilesystem;theunmountsystemcalldetachesafilesystem.Whenyoumountanotherfilesystemontoyourdirectory,youareessentiallysplicingonedirectorytreeontoabranchinanotherdirectorytree.Thefirstargumenttomountcallisthemountpoint,thatis,adirectoryinthecurrentfilenamingsystem.Thesecondargumentisthefilesystemtomounttothatpoint.Whenyouinsertacdromtoyourunixsystem’sdrive,thefilesysteminthecdromautomaticallymountsto/dev/cdrominyoursystem.10.Howdoestheinodemaptodatablockofafile?Inodehas13blockaddresses.Thefirst10aredirectblockaddressesofthefirst10datablocksinthefile.The11thaddresspointstoaone-levelindexblock.The12thaddresspointstoatwo-level(doublein-direction)indexblock.The13thaddresspointstoathree-level(triplein-direction)indexblock.Thisprovidesaverylargemaximumfilesizewithefficientaccesstolargefiles,butalsosmallfilesareaccesseddirectlyinonediskread.11.Whatisashell?Ashellisaninteractiveuserinterfacetoanoperatingsystemservicesthatallowsanusertoentercommandsascharacterstringsorthroughagraphicaluserinterface.TheshellconvertsthemtosystemcallstotheOSorforksoffaprocesstoexecutethecommand.SystemcallresultsandotherinformationfromtheOSarepresentedtotheuserthroughaninteractiveinterface.Commonlyusedshellsaresh,csh,ksetc.SECTION–IIPROCESSMODELandIPC1.Briefabouttheinitialprocesssequencewhilethesystembootsup.Whilebooting,specialprocesscalledthe‘swapper’or‘scheduler’iscreatedwithProcess-ID0.TheswappermanagesmemoryallocationforprocessesandinfluencesCPUallocation.Theswapperinturncreates3children:theprocessdispatcher,vhandanddbflushwithIDs1,2and3respectively.Thisisdonebyexecutingthefile/etc/init.Processdispatchergivesbirthtotheshell.UnixkeepstrackofalltheprocessesinaninternaldatastructurecalledtheProcessTable(listingcommandisps-el).2.WhatarevariousIDsassociatedwithaprocess?UnixidentifieseachprocesswithauniqueintegercalledProcessID.Theprocessthatexecutestherequestforcreationofaprocessiscalledthe‘parentprocess’whosePIDis‘ParentProcessID’.Everyprocessisassociatedwithaparticularusercalledthe‘owner’whohasprivilegesovertheprocess.Theidentificationfortheuseris‘UserID’.Owneristheuserwhoexecutestheprocess.Processalsohas‘EffectiveUserID’whichdeterminestheaccessprivilegesforaccessingresourceslikefiles.getpid()-processidgetppid()-parentprocessidgetuid()-useridgeteuid()-effectiveuserid3.Explainfork()systemcall.The`fork()’usedtocreateanewprocessfromanexistingprocess.Thenewprocessiscalledthechildprocess,andtheexistingprocessiscalledtheparent.Wecantellwhichiswhichbycheckingthereturnvaluefrom`fork()’.Theparentgetsthechild’spidreturnedtohim,butthechildgets0returnedtohim.4.Predicttheoutputofthefollowingprogramcodemain(){fork();printf(“HelloWorld!”);}Answer:HelloWorld!HelloWorld!Explanation:Theforkcreatesachildthatisaduplicateoftheparentprocess.Thechildbeginsfromthefork().Allthestatementsafterthecalltofork()willbeexecutedtwice.(oncebytheparentprocessandotherbychild).Thestatementbeforefork()isexecutedonlybytheparentprocess.5.Predicttheoutputofthefollowingprogramcodemain(){fork();fork();fork();printf(“HelloWorld!”);}Answer:“HelloWorld”willbeprinted8times.Explanation:2^ntimeswherenisthenumberofcallstofork()6.Listthesystemcallsusedforprocessmanagement:SystemcallsDescriptionfork()Tocreateanewprocessexec()Toexecuteanewprograminaprocesswait()Towaituntilacreatedprocesscompletesitsexecutionexit()Toexitfromaprocessexecutiongetpid()Togetaprocessidentifierofthecurrentprocessgetppid()Togetparentprocessidentifiernice()Tobiastheexistingpriorityofaprocessbrk()Toincrease/decreasethedatasegmentsizeofaprocess7.Howcanyouget/setanenvironmentvariablefromaprogram?Gettingthevalueofanenvironmentvariableisdonebyusing`getenv()’.Settingthevalueofanenvironmentvariableisdonebyusing`putenv()’.8.Howcanaparentandchildprocesscommunicate?Aparentandchildcancommunicatethroughanyofthenormalinter-processcommunicationschemes(pipes,sockets,messagequeues,sharedmemory),butalsohavesomespecialwaystocommunicatethattakeadvantageoftheirrelationshipasaparentandchild.Oneofthemostobviousisthattheparentcangettheexitstatusofthechild.9.Whatisazombie?Whenaprogramforksandthechildfinishesbeforetheparent,thekernelstillkeepssomeofitsinformationaboutthechildincasetheparentmightneedit–forexample,theparentmayneedtocheckthechild’sexitstatus.Tobeabletogetthisinformation,theparentcalls`wait()’;Intheintervalbetweenthechildterminatingandtheparentcalling`wait()’,thechildissaidtobea`zombie’(Ifyoudo`ps’,thechildwillhavea`Z’initsstatusfieldtoindicatethis.)10.WhataretheprocessstatesinUnix?Asaprocessexecutesitchangesstateaccordingtoitscircumstances.Unixprocesseshavethefollowingstates:Running:Theprocessiseitherrunningoritisreadytorun.Waiting:Theprocessiswaitingforaneventorforaresource.Stopped:Theprocesshasbeenstopped,usuallybyreceivingasignal.Zombie:Theprocessisdeadbuthavenotbeenremovedfromtheprocesstable.11.WhatHappenswhenyouexecuteaprogram?WhenyouexecuteaprogramonyourUNIXsystem,thesystemcreatesaspecialenvironmentforthatprogram.Thisenvironmentcontainseverythingneededforthesystemtoruntheprogramasifnootherprogramwererunningonthesystem.Each

Page 9: Daily paragraph editing terminal velocity answers

processhasprocesscontext,whichiseverythingthatisuniqueaboutthestateoftheprogramyouarecurrentlyrunning.EverytimeyouexecuteaprogramtheUNIXsystemdoesafork,whichperformsaseriesofoperationstocreateaprocesscontextandthenexecuteyourprograminthatcontext.Thestepsincludethefollowing:Allocateaslotintheprocesstable,alistofcurrentlyrunningprogramskeptbyUNIX.Assignauniqueprocessidentifier(PID)totheprocess.iCopythecontextoftheparent,theprocessthatrequestedthespawningofthenewprocess.ReturnthenewPIDtotheparentprocess.Thisenablestheparentprocesstoexamineorcontroltheprocessdirectly.Aftertheforkiscomplete,UNIXrunsyourprogram.12.WhatHappenswhenyouexecuteacommand?Whenyouenter‘ls’commandtolookatthecontentsofyourcurrentworkingdirectory,UNIXdoesaseriesofthingstocreateanenvironmentforlsandtherunit:TheshellhasUNIXperformafork.Thiscreatesanewprocessthattheshellwillusetorunthelsprogram.TheshellhasUNIXperformanexecofthelsprogram.Thisreplacestheshellprogramanddatawiththeprogramanddataforlsandthenstartsrunningthatnewprogram.Thelsprogramisloadedintothenewprocesscontext,replacingthetextanddataoftheshell.Thelsprogramperformsitstask,listingthecontentsofthecurrentdirectory.13.WhatisaDaemon?Adaemonisaprocessthatdetachesitselffromtheterminalandruns,disconnected,inthebackground,waitingforrequestsandrespondingtothem.Itcanalsobedefinedasthebackgroundprocessthatdoesnotbelongtoaterminalsession.Manysystemfunctionsarecommonlyperformedbydaemons,includingthesendmaildaemon,whichhandlesmail,andtheNNTPdaemon,whichhandlesUSENETnews.Manyotherdaemonsmayexist.Someofthemostcommondaemonsare:init:Takesoverthebasicrunningofthesystemwhenthekernelhasfinishedthebootprocess.inetd:Responsibleforstartingnetworkservicesthatdonothavetheirownstand-alonedaemons.Forexample,inetdusuallytakescareofincomingrlogin,telnet,andftpconnections.cron:Responsibleforrunningrepetitivetasksonaregularschedule.14.Whatis‘ps’commandfor?Thepscommandprintstheprocessstatusforsomeoralloftherunningprocesses.Theinformationgivenaretheprocessidentificationnumber(PID),theamountoftimethattheprocesshastakentoexecutesofaretc.15.Howwouldyoukillaprocess?ThekillcommandtakesthePIDasoneargument;thisidentifieswhichprocesstoterminate.ThePIDofaprocesscanbegotusing‘ps’command.16.Whatisanadvantageofexecutingaprocessinbackground?Themostcommonreasontoputaprocessinthebackgroundistoallowyoutodosomethingelseinteractivelywithoutwaitingfortheprocesstocomplete.Attheendofthecommandyouaddthespecialbackgroundsymbol,&.Thissymboltellsyourshelltoexecutethegivencommandinthebackground.Example:cp*.*../backup&(cpisforcopy)17.Howdoyouexecuteoneprogramfromwithinanother?Thesystemcallsusedforlow-levelprocesscreationareexeclp()andexecvp().Theexeclpcalloverlaystheexistingprogramwiththenewone,runsthatandexits.Theoriginalprogramgetsbackcontrolonlywhenanerroroccurs.execlp(path,file_name,arguments..);//lastargumentmustbeNULLAvariantofexeclpcalledexecvpisusedwhenthenumberofargumentsisnotknowninadvance.execvp(path,argument_array);//argumentarrayshouldbeterminatedbyNULL18.WhatisIPC?Whatarethevariousschemesavailable?ThetermIPC(Inter-ProcessCommunication)describesvariouswaysbywhichdifferentprocessrunningonsomeoperatingsystemcommunicatebetweeneachother.Variousschemesavailableareasfollows:Pipes:One-waycommunicationschemethroughwhichdifferentprocesscancommunicate.Theproblemisthatthetwoprocessesshouldhaveacommonancestor(parent-childrelationship).Howeverthisproblemwasfixedwiththeintroductionofnamed-pipes(FIFO).MessageQueues:Messagequeuescanbeusedbetweenrelatedandunrelatedprocessesrunningonamachine.SharedMemory:ThisisthefastestofallIPCschemes.Thememorytobesharedismappedintotheaddressspaceoftheprocesses(thataresharing).Thespeedachievedisattributedtothefactthatthereisnokernelinvolvement.Butthisschemeneedssynchronization.Variousformsofsynchronisationaremutexes,condition-variables,read-writelocks,record-locks,andsemaphores.SECTION–IIIMEMORYMANAGEMENT1.WhatisthedifferencebetweenSwappingandPaging?Swapping:Wholeprocessismovedfromtheswapdevicetothemainmemoryforexecution.Processsizemustbelessthanorequaltotheavailablemainmemory.Itiseasiertoimplementationandoverheadtothesystem.Swappingsystemsdoesnothandlethememorymoreflexiblyascomparedtothepagingsystems.Paging:Onlytherequiredmemorypagesaremovedtomainmemoryfromtheswapdeviceforexecution.Processsizedoesnotmatter.Givestheconceptofthevirtualmemory.Itprovidesgreaterflexibilityinmappingthevirtualaddressspaceintothephysicalmemoryofthemachine.Allowsmorenumberofprocessestofitinthemainmemorysimultaneously.Allowsthegreaterprocesssizethantheavailablephysicalmemory.Demandpagingsystemshandlethememorymoreflexibly.2.WhatismajordifferencebetweentheHistoricUnixandthenewBSDreleaseofUnixSystemVintermsofMemoryManagement?HistoricUnixusesSwapping–entireprocessistransferredtothemainmemoryfromtheswapdevice,whereastheUnixSystemVusesDemandPaging–onlythepartoftheprocessismovedtothemainmemory.HistoricUnixusesoneSwapDeviceandUnixSystemVallowmultipleSwapDevices.3.WhatisthemaingoaloftheMemoryManagement?Itdecideswhichprocessshouldresideinthemainmemory,Managesthepartsofthevirtualaddressspaceofaprocesswhichisnon-coreresident,Monitorstheavailablemainmemoryandperiodicallywritetheprocessesintotheswapdevicetoprovidemoreprocessesfitinthemainmemorysimultaneously.4.WhatisaMap?AMapisanArray,whichcontainstheaddressesofthefreespaceintheswapdevicethatareallocatableresources,andthenumberoftheresourceunitsavailablethere.ThisallowsFirst-Fitallocationofcontiguousblocksofaresource.InitiallytheMapcontainsoneentry–address(blockoffsetfromthestartingoftheswaparea)andthetotalnumberofresources.KerneltreatseachunitofMapasagroupofdiskblocks.OntheallocationandfreeingoftheresourcesKernelupdatestheMapforaccurateinformation.5.WhatschemedoestheKernelinUnixSystemVfollowwhilechoosingaswapdeviceamongthemultipleswapdevices?KernelfollowsRoundRobinschemechoosingaswapdeviceamongthemultipleswapdevicesinUnixSystemV.6.WhatisaRegion?ARegionisacontinuousareaofaprocess’saddressspace(suchastext,dataandstack).Thekernelina‘RegionTable’thatislocaltotheprocessmaintainsregion.Regionsaresharableamongtheprocess.7.WhataretheeventsdonebytheKernelafteraprocessisbeingswappedoutfromthemainmemory?WhenKernelswapstheprocessoutoftheprimarymemory,itperformsthefollowing:KerneldecrementstheReferenceCountofeachregionoftheprocess.Ifthereferencecountbecomeszero,swapstheregionoutofthemainmemory,Kernelallocatesthespacefortheswappingprocessintheswapdevice,Kernellockstheotherswappingprocesswhilethecurrentswappingoperationisgoingon,TheKernelsavestheswapaddressoftheregionintheregiontable.8.IstheProcessbeforeandaftertheswaparethesame?Givereason.Processbeforeswappingisresidingintheprimarymemoryinitsoriginalform.Theregions(text,dataandstack)maynotbeoccupiedfullybytheprocess,theremaybefewemptyslotsinanyoftheregionsandwhileswappingKerneldonotbotherabouttheemptyslotswhileswappingtheprocessout.Afterswappingtheprocessresidesintheswap(secondarymemory)device.Theregionsswappedoutwillbepresentbutonlytheoccupiedregionslotsbutnottheemptyslotsthatwerepresentbeforeassigning.Whileswappingtheprocessonceagainintothemainmemory,theKernelreferringtotheProcessMemoryMap,itassignsthemainmemoryaccordinglytakingcareoftheemptyslotsintheregions.9.Whatdoyoumeanbyu-area(userarea)oru-block?ThiscontainstheprivatedatathatismanipulatedonlybytheKernel.ThisislocaltotheProcess,i.e.eachprocessisallocatedau-area.10.Whataretheentitiesthatareswappedoutofthemainmemorywhileswappingtheprocessoutofthemainmemory?Allmemoryspaceoccupiedbytheprocess,process’su-area,andKernelstackareswappedout,theoretically.Practically,iftheprocess’su-areacontainstheAddressTranslationTablesfortheprocessthenKernelimplementationsdonotswaptheu-area.11.WhatisForkswap?fork()isasystemcalltocreateachildprocess.Whentheparentprocesscallsfork()systemcall,thechildprocessiscreatedandifthereisshortofmemorythenthechildprocessissenttotheread-to-runstateintheswapdevice,andreturntotheuserstatewithoutswappingtheparentprocess.Whenthememorywillbeavailablethechildprocesswillbeswappedintothemainmemory.12.WhatisExpansionswap?Atthetimewhenanyprocessrequiresmorememorythanitiscurrentlyallocated,theKernelperformsExpansionswap.TodothisKernelreservesenoughspaceintheswapdevice.Thentheaddresstranslationmappingisadjustedforthenewvirtualaddressspacebutthephysicalmemoryisnotallocated.AtlastKernelswapstheprocessintotheassignedspaceintheswapdevice.LaterwhentheKernelswapstheprocessintothemainmemorythisassignsmemoryaccordingtothenewaddresstranslationmapping.13.HowtheSwapperworks?Theswapperistheonlyprocessthatswapstheprocesses.TheSwapperoperatesonlyintheKernelmodeanditdoesnotusesSystemcallsinsteaditusesinternalKernelfunctionsforswapping.Itisthearchetypeofallkernelprocess.14.Whataretheprocessesthatarenotbotheredbytheswapper?GiveReason.Zombieprocess:Theydonottakeanyupphysicalmemory.Processeslockedinmemoriesthatareupdatingtheregionoftheprocess.Kernelswapsonlythesleepingprocessesratherthanthe‘ready-to-run’processes,astheyhavethehigherprobabilityofbeingscheduledthantheSleepingprocesses.15.Whataretherequirementsforaswappertowork?Theswapperworksonthehighestschedulingpriority.Firstlyitwilllookforanysleepingprocess,ifnotfoundthenitwilllookfortheready-to-runprocessforswapping.Butthemajorrequirementfortheswappertoworktheready-to-runprocessmustbecore-residentforatleast2secondsbeforeswappingout.Andforswappingintheprocessmusthavebeenresidedintheswapdeviceforatleast2seconds.IftherequirementisnotsatisfiedthentheswapperwillgointothewaitstateonthateventanditisawakenonceinasecondbytheKernel.16.Whatarethecriteriaforchoosingaprocessforswappingintomemoryfromtheswapdevice?Theresidenttimeoftheprocessesintheswapdevice,thepriorityoftheprocessesandtheamountoftimetheprocesseshadbeenswappedout.17.Whatarethecriteriaforchoosingaprocessforswappingoutofthememorytotheswapdevice?Theprocess’smemoryresidenttime,PriorityoftheprocessandThenicevalue.18.Whatdoyoumeanbynicevalue?Nicevalueisthevaluethatcontrols{incrementsordecrements}thepriorityoftheprocess.Thisvaluethatisreturnedbythenice()systemcall.Theequationforusingnicevalueis:Priority=(“recentCPUusage”/constant)+(base-priority)+(nicevalue)Onlytheadministratorcansupplythenicevalue.Thenice()systemcallworksfortherunningprocessonly.Nicevalueofoneprocesscannotaffectthenicevalueoftheotherprocess.19.Whatareconditionsonwhichdeadlockcanoccurwhileswappingtheprocesses?Allprocessesinthemainmemoryareasleep.All‘ready-to-run’processesareswappedout.Thereisnospaceintheswapdeviceforthenewincomingprocessthatareswappedoutofthemainmemory.Thereisnospaceinthemainmemoryforthenewincomingprocess.20.WhatareconditionsforamachinetosupportDemandPaging?MemoryarchitecturemustbasedonPages,Themachinemustsupportthe‘restartable’instructions.21.Whatis‘theprincipleoflocality’?It’sthenatureoftheprocessesthattheyreferonlytothesmallsubsetofthetotaldataspaceoftheprocess.i.e.theprocessfrequentlycallsthesamesubroutinesorexecutestheloopinstructions.22.Whatistheworkingsetofaprocess?Thesetofpagesthatarereferredbytheprocessinthelast‘n’,references,where‘n’iscalledthewindowoftheworkingsetoftheprocess.23.Whatisthewindowoftheworkingsetofaprocess?Thewindowoftheworkingsetofaprocessisthetotalnumberinwhichtheprocesshadreferredthesetofpagesintheworkingsetoftheprocess.24.Whatiscalledapagefault?Pagefaultisreferredtothesituationwhentheprocessaddressesapageintheworkingsetoftheprocessbuttheprocessfailstolocatethepageintheworkingset.Andonapagefaultthekernelupdatestheworkingsetbyreadingthepagefromthesecondarydevice.25.WhataredatastructuresthatareusedforDemandPaging?Kernelcontains4datastructuresforDemandpaging.Theyare,Pagetableentries,Diskblockdescriptors,Pageframedatatable(pfdata),Swap-usetable.26.Whatarethebitsthatsupportthedemandpaging?Valid,Reference,Modify,Copyonwrite,Age.Thesebitsarethepartofthepagetableentry,whichincludesphysicaladdressofthepageandprotectionbits.PageaddressAgeCopyonwriteModifyReferenceValidProtection27.HowtheKernelhandlesthefork()systemcallintraditionalUnixandintheSystemVUnix,whileswapping?KernelintraditionalUnix,makestheduplicatecopyoftheparent’saddressspaceandattachesittothechild’sprocess,whileswapping.KernelinSystemVUnix,manipulatestheregiontables,pagetable,andpfdatatableentries,byincrementingthereferencecountoftheregiontableofsharedregions.28.Differencebetweenthefork()andvfork()systemcall?Duringthefork()systemcalltheKernelmakesacopyoftheparentprocess’saddressspaceandattachesittothechildprocess.Butthevfork()systemcalldonotmakesanycopyoftheparent’saddressspace,soitisfasterthanthefork()systemcall.Thechildprocessasaresultofthevfork()systemcallexecutesexec()systemcall.Thechildprocessfromvfork()systemcallexecutesintheparent’saddressspace(thiscanoverwritetheparent’sdataandstack)whichsuspendstheparentprocessuntilthechildprocessexits.29.WhatisBSS(BlockStartedbySymbol)?Adatarepresentationatthemachinelevel,thathasinitialvalueswhenaprogramstartsandtellsabouthowmuchspacethekernelallocatesfortheun-initializeddata.Kernelinitializesittozeroatrun-time.30.WhatisPage-Stealerprocess?ThisistheKernelprocessthatmakesroomsfortheincomingpages,byswappingthememorypagesthatarenotthepartoftheworkingsetofaprocess.Page-StealeriscreatedbytheKernelatthesysteminitializationandinvokesitthroughoutthelifetimeofthesystem.Kernellocksaregionwhenaprocessfaultsonapageintheregion,sothatpagestealercannotstealthepage,whichisbeingfaultedin.31.Nametwopagingstatesforapageinmemory?Thetwopagingstatesare:Thepageisagingandisnotyeteligibleforswapping,Thepageiseligibleforswappingbutnotyeteligibleforreassignmenttoothervirtualaddressspace.32.Whatarethephasesofswappingapagefromthememory?Pagestealerfindsthepageeligibleforswappingandplacesthepagenumberinthelistofpagestobeswapped.Kernelcopiesthepagetoaswapdevicewhennecessaryandclearsthevalidbitinthepagetableentry,decrementsthepfdatareferencecount,andplacesthepfdatatableentryattheendofthefreelistifitsreferencecountis0.33.Whatispagefault?Itstypes?Pagefaultreferstothesituationofnothavingapageinthemainmemorywhenanyprocessreferencesit.Therearetwotypesofpagefault:Validityfault,Protectionfault.34.InwhatwaytheFaultHandlersandtheInterrupthandlersaredifferent?Faulthandlersarealsoaninterrupthandlerwithanexceptionthattheinterrupthandlerscannotsleep.Faulthandlerssleepinthecontextoftheprocessthatcausedthememoryfault.Thefaultreferstotherunningprocessandnoarbitraryprocessesareputtosleep.35.Whatisvalidityfault?Ifaprocessreferringapageinthemainmemorywhosevalidbitisnotset,itresultsinvalidityfault.Thevalidbitisnotsetforthosepages:thatareoutsidethevirtualaddressspaceofaprocess,thatarethepartofthevirtualaddressspaceoftheprocessbutnophysicaladdressisassignedtoit.36.Whatdoestheswappingsystemdoifitidentifiestheillegalpageforswapping?Ifthediskblockdescriptordoesnotcontainanyrecordofthefaultedpage,thenthiscausestheattemptedmemoryreferenceisinvalidandthekernelsendsa“Segmentationviolation”signaltotheoffendingprocess.Thishappenswhentheswappingsystemidentifiesanyinvalidmemoryreference.37.Whatarestatesthatthepagecanbein,aftercausingapagefault?Onaswapdeviceandnotinmemory,Onthefreepagelistinthemainmemory,Inanexecutablefile,Marked“demandzero”,Marked“demandfill”.38.Inwhatwaythevalidityfaulthandlerconcludes?Itsetsthevalidbitofthepagebyclearingthemodifybit.Itrecalculatestheprocesspriority.39.Atwhatmodethefaulthandlerexecutes?AttheKernelMode.40.Whatdoyoumeanbytheprotectionfault?Protectionfaultreferstotheprocessaccessingthepages,whichdonothavetheaccesspermission.Aprocessalsoincurtheprotectionfaultwhenitattemptstowriteapagewhosecopyonwritebitwassetduringthefork()systemcall.41.HowtheKernelhandlesthecopyonwritebitofapage,whenthebitisset?Insituationslike,wherethecopyonwritebitofapageissetandthatpageissharedbymorethanoneprocess,theKernelallocatesnewpageandcopiesthecontenttothenewpageandtheotherprocessesretaintheirreferencestotheoldpage.AftercopyingtheKernelupdatesthepagetableentrywiththenewpagenumber.ThenKerneldecrementsthereferencecountoftheoldpfdatatableentry.Incaseslike,wherethecopyonwritebitissetandnoprocessesaresharingthepage,theKernelallowsthephysicalpagetobereusedbytheprocesses.Bydoingso,itclearsthecopyonwritebitanddisassociatesthepagefromitsdiskcopy(ifoneexists),becauseotherprocessmaysharethediskcopy.Thenitremovesthepfdatatableentryfromthepage-queueasthenewcopyofthevirtualpageisnotontheswapdevice.Itdecrementstheswap-usecountforthepageandifcountdropsto0,freestheswapspace.42.Forwhichkindoffaultthepageischeckedfirst?Thepageisfirstcheckedforthevalidityfault,assoonasitisfoundthatthepageisinvalid(validbitisclear),thevalidityfaulthandlerreturnsimmediately,andtheprocessincurthevaliditypagefault.Kernelhandlesthevalidityfaultandtheprocesswillincurtheprotectionfaultifanyoneispresent.43.Inwhatwaytheprotectionfaulthandlerconcludes?Afterfinishingtheexecutionofthefaulthandler,itsetsthemodifyandprotectionbitsandclearsthecopyonwritebit.Itrecalculatestheprocess-priorityandchecksforsignals.44.HowtheKernelhandlesboththepagestealerandthefaulthandler?Thepagestealerandthefaulthandlerthrashbecauseoftheshortageofthememory.Ifthesumoftheworkingsetsofallprocessesisgreaterthatthephysicalmemorythenthefaulthandlerwillusuallysleepbecauseitcannotallocatepagesforaprocess.ThisresultsinthereductionofthesystemthroughputbecauseKernelspendstoomuchtimeinoverhead,rearrangingthememoryinthefranticpace.RDBMSConcepts1.Whatisdatabase?Adatabaseisalogicallycoherentcollectionofdatawithsomeinherentmeaning,representingsomeaspectofrealworldandwhichisdesigned,builtandpopulatedwithdataforaspecificpurpose.2.WhatisDBMS?Itisacollectionofprogramsthatenablesusertocreateandmaintainadatabase.Inotherwordsitisgeneral-purposesoftwarethatprovidestheuserswiththeprocessesofdefining,constructingandmanipulatingthedatabaseforvariousapplications.3.WhatisaDatabasesystem?ThedatabaseandDBMSsoftwaretogetheriscalledasDatabasesystem.4.AdvantagesofDBMS?Redundancyiscontrolled.Unauthorisedaccessisrestricted.Providingmultipleuserinterfaces.Enforcingintegrityconstraints.Providingbackupandrecovery.5.DisadvantageinFileProcessingSystem?Dataredundancy&inconsistency.Difficultinaccessingdata.Dataisolation.Dataintegrity.Concurrentaccessisnotpossible.SecurityProblems.6.Describethethreelevelsofdataabstraction?Thearethreelevelsofabstraction:Physicallevel:Thelowestlevelofabstractiondescribeshowdataarestored.Logicallevel:Thenexthigherlevelofabstraction,describeswhatdataarestoredindatabaseandwhatrelationshipamongthosedata.Viewlevel:Thehighestlevelofabstractiondescribesonlypartofentiredatabase.7.Definethe“integrityrules”TherearetwoIntegrityrules.EntityIntegrity:Statesthat“PrimarykeycannothaveNULLvalue”ReferentialIntegrity:Statesthat“ForeignKeycanbeeitheraNULLvalueorshouldbePrimaryKeyvalueofotherrelation.8.Whatisextensionandintension?Extension–Itisthenumberoftuplespresentinatableatanyinstance.Thisistimedependent.Intension–Itisaconstantvaluethatgivesthename,structureoftableandtheconstraintslaidonit.9.WhatisSystemR?Whatareitstwomajorsubsystems?SystemRwasdesignedanddevelopedoveraperiodof1974-79atIBMSanJoseResearchCenter.ItisaprototypeanditspurposewastodemonstratethatitispossibletobuildaRelationalSystemthatcanbeusedinareallifeenvironmenttosolvereallifeproblems,withperformanceatleastcomparabletothatofexistingsystem.ItstwosubsystemsareResearchStorageSystemRelationalDataSystem.10.HowisthedatastructureofSystemRdifferentfromtherelationalstructure?UnlikeRelationalsystemsinSystemRDomainsarenotsupportedEnforcementofcandidatekeyuniquenessisoptionalEnforcementofentityintegrityisoptionalReferentialintegrityisnotenforced11.WhatisDataIndependence?Dataindependencemeansthat“theapplicationisindependentofthestoragestructureandaccessstrategyofdata”.Inotherwords,Theabilitytomodifytheschemadefinitioninonelevelshouldnotaffecttheschemadefinitioninthenexthigherlevel.TwotypesofDataIndependence:PhysicalDataIndependence:Modificationinphysicallevelshouldnotaffectthelogicallevel.LogicalDataIndependence:Modificationinlogicallevelshouldaffecttheviewlevel.NOTE:LogicalDataIndependenceismoredifficulttoachieve12.Whatisaview?Howitisrelatedtodataindependence?Aviewmaybethoughtofasavirtualtable,thatis,atablethatdoesnotreallyexistinitsownrightbutisinsteadderivedfromoneormoreunderlyingbasetable.Inotherwords,thereisnostoredfilethatdirectrepresentstheviewinsteadadefinitionofviewisstoredindatadictionary.Growthandrestructuringofbasetablesisnotreflectedinviews.Thustheviewcaninsulateusersfromtheeffectsofrestructuringandgrowthinthedatabase.Henceaccountsforlogicaldataindependence.13.WhatisDataModel?Acollectionofconceptualtoolsfordescribingdata,datarelationshipsdatasemanticsandconstraints.14.WhatisE-Rmodel?Thisdatamodelisbasedonrealworldthatconsistsofbasicobjectscalledentitiesandofrelationshipamongtheseobjects.Entitiesaredescribedinadatabasebyasetofattributes.15.WhatisObjectOrientedmodel?Thismodelisbasedoncollectionofobjects.Anobjectcontainsvaluesstoredininstancevariableswithintheobject.Anobjectalsocontainsbodiesofcodethatoperateontheobject.Thesebodiesofcodearecalledmethods.Objectsthatcontainsametypesofvaluesandthesamemethodsaregroupedtogetherintoclasses.16.WhatisanEntity?Itisa‘thing’intherealworldwithanindependentexistence.17.WhatisanEntitytype?Itisacollection(set)ofentitiesthathavesameattributes.18.WhatisanEntityset?Itisacollectionofallentitiesofparticularentitytypeinthedatabase.19.WhatisanExtensionofentitytype?Thecollectionsofentitiesofaparticularentitytypearegroupedtogetherintoanentityset.20.WhatisWeakEntityset?Anentitysetmaynothavesufficientattributestoformaprimarykey,anditsprimarykeycompromisesofitspartialkeyandprimarykeyofitsparententity,thenitissaidtobeWeakEntityset.21.Whatisanattribute?Itisaparticularproperty,whichdescribestheentity.22.WhatisaRelationSchemaandaRelation?ArelationSchemadenotedbyR(A1,A2,…,An)ismadeupoftherelationnameRandthelistofattributesAithatitcontains.Arelationisdefinedasasetoftuples.Letrbetherelationwhichcontainssettuples(t1,t2,t3,…,tn).Eachtupleisanorderedlistofn-valuest=(v1,v2,…,vn).23.WhatisdegreeofaRelation?Itisthenumberofattributeofitsrelationschema.24.WhatisRelationship?Itisanassociationamongtwoormoreentities.25.WhatisRelationshipset?Thecollection(orset)ofsimilarrelationships.26.WhatisRelationshiptype?Relationshiptypedefinesasetofassociationsorarelationshipsetamongagivensetofentitytypes.27.WhatisdegreeofRelationshiptype?Itisthenumberofentitytypeparticipating.25.WhatisDDL(DataDefinitionLanguage)?AdatabaseschemaisspecifiesbyasetofdefinitionsexpressedbyaspeciallanguagecalledDDL.26.WhatisVDL(ViewDefinitionLanguage)?Itspecifiesuserviewsandtheirmappingstotheconceptualschema.27.WhatisSDL(StorageDefinitionLanguage)?Thislanguageistospecifytheinternalschema.Thislanguagemayspecifythemappingbetweentwoschemas.28.WhatisDataStorage–DefinitionLanguage?ThestoragestructuresandaccessmethodsusedbydatabasesystemarespecifiedbyasetofdefinitioninaspecialtypeofDDLcalleddatastorage-definitionlanguage.29.WhatisDML(DataManipulationLanguage)?Thislanguagethatenableusertoaccessormanipulatedataasorganisedbyappropriatedatamodel.ProceduralDMLorLowlevel:DMLrequiresausertospecifywhatdataareneededandhowtogetthosedata.Non-ProceduralDMLorHighlevel:DMLrequiresausertospecifywhatdataareneededwithoutspecifyinghowtogetthosedata.31.WhatisDMLCompiler?IttranslatesDMLstatementsinaquerylanguageintolow-levelinstructionthatthequeryevaluationenginecanunderstand.32.WhatisQueryevaluationengine?Itexecuteslow-levelinstructiongeneratedbycompiler.33.WhatisDDLInterpreter?ItinterpretsDDLstatementsandrecordthemintablescontainingmetadata.34.WhatisRecord-at-a-time?TheLowlevelorProceduralDMLcanspecifyandretrieveeachrecordfromasetofrecords.ThisretrieveofarecordissaidtobeRecord-at-a-time.35.WhatisSet-at-a-timeorSet-oriented?TheHighlevelorNon-proceduralDMLcanspecifyandretrievemanyrecordsinasingleDMLstatement.ThisretrieveofarecordissaidtobeSet-at-a-timeorSet-oriented.36.WhatisRelationalAlgebra?Itisproceduralquerylanguage.Itconsistsofasetofoperationsthattakeoneortworelationsasinputandproduceanewrelation.37.WhatisRelationalCalculus?ItisanappliedpredicatecalculusspecificallytailoredforrelationaldatabasesproposedbyE.F.Codd.E.g.oflanguagesbasedonitareDSLALPHA,QUEL.38.HowdoesTuple-orientedrelationalcalculusdifferfromdomain-orientedrelationalcalculusThetuple-orientedcalculususesatuplevariablesi.e.,variablewhoseonlypermittedvaluesaretuplesofthatrelation.E.g.QUELThedomain-orientedcalculushasdomainvariablesi.e.,variablesthatrangeovertheunderlyingdomainsinsteadofoverrelation.E.g.ILL,DEDUCE.39.Whatisnormalization?ItisaprocessofanalysingthegivenrelationschemasbasedontheirFunctionalDependencies(FDs)andprimarykeytoachievethepropertiesMinimizingredundancyMinimizinginsertion,deletionandupdateanomalies.40.WhatisFunctionalDependency?AFunctionaldependencyisdenotedbyXYbetweentwosetsofattributesXandYthataresubsetsofRspecifiesaconstraintonthepossibletuplethatcanformarelationstaterofR.Theconstraintisforanytwotuplest1andt2inrift1[X]=t2[X]thentheyhavet1[Y]=t2[Y].ThismeansthevalueofXcomponentofatupleuniquelydeterminesthevalueofcomponentY.41.WhenisafunctionaldependencyFsaidtobeminimal?EverydependencyinFhasasingleattributeforitsrighthandside.WecannotreplaceanydependencyXAinFwithadependencyYAwhereYisapropersubsetofXandstillhaveasetofdependencythatisequivalenttoF.WecannotremoveanydependencyfromFandstillhavesetofdependencythatisequivalenttoF.42.WhatisMultivalueddependency?MultivalueddependencydenotedbyXYspecifiedonrelationschemaR,whereXandYarebothsubsetsofR,specifiesthefollowingconstraintonanyrelationrofR:iftwotuplest1andt2existinrsuchthatt1[X]=t2[X]thent3andt4shouldalsoexistinrwiththefollowingpropertiest3[x]=t4[X]=t1[X]=t2[X]t3[Y]=t1[Y]andt4[Y]=t2[Y]t3[Z]=t2[Z]andt4[Z]=t1[Z]where[Z=(R-(XUY))]43.WhatisLosslessjoinproperty?Itguaranteesthatthespurioustuplegenerationdoesnotoccurwithrespecttorelationschemasafterdecomposition.44.Whatis1NF(NormalForm)?Thedomainofattributemustincludeonlyatomic(simple,indivisible)values.45.WhatisFullyFunctionaldependency?Itisbasedonconceptoffullfunctionaldependency.AfunctionaldependencyXYisfullfunctionaldependencyifremovalofanyattributeAfromXmeansthatthedependencydoesnotholdanymore.46.Whatis2NF?ArelationschemaRisin2NFifitisin1NFandeverynon-primeattributeAinRisfullyfunctionallydependentonprimarykey.47.Whatis3NF?ArelationschemaRisin3NFifitisin2NFandforeveryFDXAeitherofthefollowingistrueXisaSuper-keyofR.AisaprimeattributeofR.Inotherwords,ifeverynonprimeattributeisnon-transitivelydependentonprimarykey.48.WhatisBCNF(Boyce-CoddNormalForm)?ArelationschemaRisinBCNFifitisin3NFandsatisfiesanadditionalconstraintthatforeveryFDXA,Xmustbeacandidatekey.49.Whatis4NF?ArelationschemaRissaidtobein4NFifforeveryMultivalueddependencyXYthatholdsoverR,oneoffollowingistrueXissubsetorequalto(or)XY=R.Xisasuperkey.50.Whatis5NF?ARelationschemaRissaidtobe5NFifforeveryjoindependency{R1,R2,…,Rn}thatholdsR,onethefollowingistrueRi=Rforsomei.ThejoindependencyisimpliedbythesetofFD,overRinwhichtheleftsideiskeyofR.51.WhatisDomain-KeyNormalForm?ArelationissaidtobeinDKNFifallconstraintsanddependenciesthatshouldholdonthetheconstraintcanbeenforcedbysimplyenforcingthedomainconstraintandkeyconstraintontherelation.52.Whatarepartial,alternate,,artificial,compoundandnaturalkey?PartialKey:Itisasetofattributesthatcanuniquelyidentifyweakentitiesandthatarerelatedtosameownerentity.ItissometimecalledasDiscriminator.AlternateKey:AllCandidateKeysexcludingthePrimaryKeyareknownasAlternateKeys.ArtificialKey:Ifnoobviouskey,eitherstandaloneorcompoundisavailable,thenthelastresortistosimplycreateakey,byassigningauniquenumbertoeachrecordoroccurrence.Thenthisisknownasdevelopinganartificialkey.CompoundKey:Ifnosingledataelementuniquelyidentifiesoccurrenceswithinaconstruct,thencombiningmultipleelementstocreateauniqueidentifierfortheconstructisknownascreatingacompoundkey.NaturalKey:Whenoneofthedataelementsstoredwithinaconstructisutilizedastheprimarykey,thenitiscalledthenaturalkey.53.Whatisindexingandwhatarethedifferentkindsofindexing?Indexingisatechniquefordetermininghowquicklyspecificdatacanbefound.Types:BinarysearchstyleindexingB-TreeindexingInvertedlistindexingMemoryresidenttableTableindexing54.Whatissystemcatalogorcatalogrelation?Howisbetterknownas?ARDBMSmaintainsadescriptionofallthedatathatitcontains,informationabouteveryrelationandindexthatitcontains.Thisinformationisstoredinacollectionofrelationsmaintainedbythesystemcalledmetadata.Itisalsocalleddatadictionary.55.Whatismeantbyqueryoptimization?Thephasethatidentifiesanefficientexecutionplanforevaluatingaquerythathastheleastestimatedcostisreferredtoasqueryoptimization.56.Whatisjoindependencyandinclusiondependency?JoinDependency:AJoindependencyisgeneralizationofMultivalueddependency.AJD{R1,R2,…,Rn}issaidtoholdoverarelationRifR1,R2,R3,…,Rnisalossless-joindecompositionofR.ThereisnosetofsoundandcompleteinferencerulesforJD.InclusionDependency:AnInclusionDependencyisastatementoftheformthatsomecolumnsofarelationarecontainedinothercolumns.Aforeignkeyconstraintisanexampleofinclusiondependency.57.WhatisdurabilityinDBMS?OncetheDBMSinformstheuserthatatransactionhassuccessfullycompleted,itseffectsshouldpersistevenifthesystemcrashesbeforeallitschangesarereflectedondisk.Thispropertyiscalleddurability.58.Whatdoyoumeanbyatomicityandaggregation?Atomicity:Eitherallactionsarecarriedoutornoneare.Usersshouldnothavetoworryabouttheeffectofincompletetransactions.DBMSensuresthisbyundoingtheactionsofincompletetransactions.Aggregation:Aconceptwhichisusedtomodelarelationshipbetweenacollectionofentitiesandrelationships.Itisusedwhenweneedtoexpressarelationshipamongrelationships.59.WhatisaPhantomDeadlock?Indistributeddeadlockdetection,thedelayinpropagatinglocalinformationmightcausethedeadlockdetectionalgorithmstoidentifydeadlocksthatdonotreallyexist.Suchsituationsarecalledphantomdeadlocksandtheyleadtounnecessaryaborts.60.WhatisacheckpointandWhendoesitoccur?ACheckpointislikeasnapshotoftheDBMSstate.Bytakingcheckpoints,theDBMScanreducetheamountofworktobedoneduringrestartintheeventofsubsequentcrashes.61.Whatarethedifferentphasesoftransaction?DifferentphasesareAnalysisphaseRedoPhaseUndophase62.Whatdoyoumeanbyflatfiledatabase?Itisadatabaseinwhichtherearenoprogramsoruseraccesslanguages.Ithasnocross-filecapabilitiesbutisuser-friendlyandprovidesuser-interfacemanagement.63.Whatis“transparentDBMS”?Itisone,whichkeepsitsPhysicalStructurehiddenfromuser.64.BrieftheoryofNetwork,HierarchicalschemasandtheirpropertiesNetworkschemausesagraphdatastructuretoorganizerecordsexampleforsuchadatabasemanagementsystemisCTCGwhileahierarchicalschemausesatreedatastructureexampleforsuchasystemisIMS.65.Whatisaquery?AquerywithrespecttoDBMSrelatestousercommandsthatareusedtointeractwithadatabase.Thequerylanguagecanbeclassifiedintodatadefinitionlanguageanddatamanipulationlanguage.66.WhatdoyoumeanbyCorrelatedsubquery?Subqueries,ornestedqueries,areusedtobringbackasetofrowstobeusedbytheparentquery.Dependingonhowthesubqueryiswritten,itcanbeexecutedoncefortheparentqueryoritcanbeexecutedonceforeachrowreturnedbytheparentquery.Ifthesubqueryisexecutedforeachrowoftheparent,thisiscalledacorrelatedsubquery.AcorrelatedsubquerycanbeeasilyidentifiedifitcontainsanyreferencestotheparentsubquerycolumnsinitsWHEREclause.Columnsfromthesubquerycannotbereferencedanywhereelseintheparentquery.Thefollowingexampledemonstratesanon-correlatedsubquery.E.g.Select*FromCUSTWhere’10/03/1990′IN(SelectODATEFromORDERWhereCUST.CNUM=ORDER.CNUM)67.Whataretheprimitiveoperationscommontoallrecordmanagementsystems?Addition,deletionandmodification.68.Namethebufferinwhichallthecommandsthataretypedinarestored‘Edit’Buffer69.WhataretheunaryoperationsinRelationalAlgebra?PROJECTIONandSELECTION.70.AretheresultingrelationsofPRODUCTandJOINoperationthesame?No.PRODUCT:Concatenationofeveryrowinonerelationwitheveryrowinanother.JOIN:Concatenationofrowsfromonerelationandrelatedrowsfromanother.71.WhatisRDBMSKERNEL?TwoimportantpiecesofRDBMSarchitecturearethekernel,whichisthesoftware,andthedatadictionary,whichconsistsofthesystem-leveldatastructuresusedbythekerneltomanagethedatabaseYoumightthinkofanRDBMSasanoperatingsystem(orsetofsubsystems),designedspecificallyforcontrollingdataaccess;itsprimaryfunctionsarestoring,retrieving,andsecuringdata.AnRDBMSmaintainsitsownlistofauthorizedusersandtheirassociatedprivileges;managesmemorycachesandpaging;controlslockingforconcurrentresourceusage;dispatchesandschedulesuserrequests;andmanagesspaceusagewithinitstable-spacestructures.72.Namethesub-systemsofaRDBMSI/O,Security,LanguageProcessing,ProcessControl,StorageManagement,LoggingandRecovery,DistributionControl,TransactionControl,MemoryManagement,LockManagement73.WhichpartoftheRDBMStakescareofthedatadictionary?HowDatadictionaryisasetoftablesanddatabaseobjectsthatisstoredinaspecialareaofthedatabaseandmaintainedexclusivelybythekernel.74.Whatisthejoboftheinformationstoredindata-dictionary?Theinformationinthedatadictionaryvalidatestheexistenceoftheobjects,providesaccesstothem,andmapstheactualphysicalstoragelocation.75.NotonlyRDBMStakescareoflocatingdataitalsodeterminesanoptimalaccesspathtostoreorretrievethedata76.HowdoyoucommunicatewithanRDBMS?YoucommunicatewithanRDBMSusingStructuredQueryLanguage(SQL)77.DefineSQLandstatethedifferencesbetweenSQLandotherconventionalprogrammingLanguagesSQLisanonprocedurallanguagethatisdesignedspecificallyfordataaccessoperationsonnormalizedrelationaldatabasestructures.TheprimarydifferencebetweenSQLandotherconventionalprogramminglanguagesisthatSQLstatementsspecifywhatdataoperationsshouldbeperformedratherthanhowtoperformthem.78.NamethethreemajorsetoffilesondiskthatcomposeadatabaseinOracleTherearethreemajorsetsoffilesondiskthatcomposeadatabase.Allthefilesarebinary.TheseareDatabasefilesControlfilesRedologsThemostimportantofthesearethedatabasefileswheretheactualdataresides.Thecontrolfilesandtheredologssupportthefunctioningofthearchitectureitself.Allthreesetsoffilesmustbepresent,open,andavailabletoOracleforanydataonthedatabasetobeuseable.Withoutthesefiles,youcannotaccessthedatabase,andthedatabaseadministratormighthavetorecoversomeorallofthedatabaseusingabackup,ifthereisone.79.WhatisanOracleInstance?TheOraclesystemprocesses,alsoknownasOraclebackgroundprocesses,providefunctionsfortheuserprocesses—functionsthatwouldotherwisebedonebytheuserprocessesthemselvesOracledatabase-widesystemmemoryisknownastheSGA,thesystemglobalareaorsharedglobalarea.ThedataandcontrolstructuresintheSGAareshareable,andalltheOraclebackgroundprocessesanduserprocessescanusethem.ThecombinationoftheSGAandtheOraclebackgroundprocessesisknownasanOracleinstance80.WhatarethefourOraclesystemprocessesthatmustalwaysbeupandrunningforthedatabasetobeuseableThefourOraclesystemprocessesthatmustalwaysbeupandrunningforthedatabasetobeuseableincludeDBWR(DatabaseWriter),LGWR(LogWriter),SMON(SystemMonitor),andPMON(ProcessMonitor).81.Whataredatabasefiles,controlfilesandlogfiles.Howmanyofthesefilesshouldadatabasehaveatleast?Why?DatabaseFilesThedatabasefilesholdtheactualdataandaretypicallythelargestinsize.Dependingontheirsizes,thetables(andotherobjects)foralltheuseraccountscangoinonedatabasefile—butthat’snotanidealsituationbecauseitdoesnotmakethedatabasestructureveryflexibleforcontrollingaccesstostoragefordifferentusers,puttingthedatabaseondifferentdiskdrives,orbackingupandrestoringjustpartofthedatabase.Youmusthaveatleastonedatabasefilebutusually,morethanonefilesareused.Intermsofaccessingandusingthedatainthetablesandotherobjects,thenumber(orlocation)ofthefilesisimmaterial.ThedatabasefilesarefixedinsizeandnevergrowbiggerthanthesizeatwhichtheywerecreatedControlFilesThecontrolfilesandredologssupporttherestofthearchitecture.Anydatabasemusthaveatleastonecontrolfile,althoughyoutypicallyhavemorethanonetoguardagainstloss.Thecontrolfilerecordsthenameofthedatabase,thedateandtimeitwascreated,thelocationofthedatabaseandredologs,andthesynchronizationinformationtoensurethatallthreesetsoffilesarealwaysinstep.Everytimeyouaddanewdatabaseorredologfiletothedatabase,theinformationisrecordedinthecontrolfiles.RedoLogsAnydatabasemusthaveatleasttworedologs.Thesearethejournalsforthedatabase;theredologsrecordallchangestotheuserobjectsorsystemobjects.Ifanytypeoffailureoccurs,thechangesrecordedintheredologscanbeusedtobringthedatabasetoaconsistentstatewithoutlosinganycommittedtransactions.Inthecaseofnon-datalossfailure,OraclecanapplytheinformationintheredologsautomaticallywithoutinterventionfromtheDBA.Theredologfilesarefixedinsizeandnevergrowdynamicallyfromthesizeatwhichtheywerecreated.82.WhatisROWID?TheROWIDisauniquedatabase-widephysicaladdressforeveryrowoneverytable.Onceassigned(whentherowisfirstinsertedintothedatabase),itneverchangesuntiltherowisdeletedorthetableisdropped.TheROWIDconsistsofthefollowingthreecomponents,thecombinationofwhichuniquelyidentifiesthephysicalstoragelocationoftherow.Oracledatabasefilenumber,whichcontainstheblockwiththerowsOracleblockaddress,whichcontainstherowTherowwithintheblock(becauseeachblockcanholdmanyrows)TheROWIDisusedinternallyinindexesasaquickmeansofretrievingrowswithaparticularkeyvalue.ApplicationdevelopersalsouseitinSQLstatementsasaquickwaytoaccessarowoncetheyknowtheROWID83.WhatisOracleBlock?CantwoOracleBlockshavethesameaddress?Oracle“formats”thedatabasefilesintoanumberofOracleblockswhentheyarefirstcreated—makingiteasierfortheRDBMSsoftwaretomanagethefilesandeasiertoreaddataintothememoryareas.Theblocksizeshouldbeamultipleoftheoperatingsystemblocksize.Regardlessoftheblocksize,theentireblockisnotavailableforholdingdata;Oracletakesupsomespacetomanagethecontentsoftheblock.Thisblockheaderhasaminimumsize,butitcangrow.TheseOracleblocksarethesmallestunitofstorage.IncreasingtheOracleblocksizecanimproveperformance,butitshouldbedoneonlywhenthedatabaseisfirstcreated.EachOracleblockisnumberedsequentiallyforeachdatabasefilestartingat1.Twoblockscanhavethesameblockaddressiftheyareindifferentdatabasefiles.84.WhatisdatabaseTrigger?AdatabasetriggerisaPL/SQLblockthatcandefinedtoautomaticallyexecuteforinsert,update,anddeletestatementsagainstatable.Thetriggercanedefinedtoexecuteoncefortheentirestatementoronceforeveryrowthatisinserted,updated,ordeleted.Foranyonetable,therearetwelveeventsforwhichyoucandefinedatabasetriggers.AdatabasetriggercancalldatabaseproceduresthatarealsowritteninPL/SQL.85.NametwoutilitiesthatOracleprovides,whichareuseforbackupandrecovery.AlongwiththeRDBMSsoftware,Oracleprovidestwoutilitiesthatyoucanusetobackupandrestorethedatabase.TheseutilitiesareExportandImport.TheExportutilitydumpsthedefinitionsanddataforthespecifiedpartofthedatabasetoanoperatingsystembinaryfile.TheImportutilityreadsthefileproducedbyanexport,recreatesthedefinitionsofobjects,andinsertsthedataIfExportandImportareusedasameansofbackingupandrecoveringthedatabase,allthechangesmadetothedatabasecannotberecoveredsincetheexportwasperformed.Thebestyoucandoisrecoverthedatabasetothetimewhentheexportwaslastperformed.86.Whatarestored-procedures?Andwhataretheadvantagesofusingthem.Storedproceduresaredatabaseobjectsthatperformauserdefinedoperation.AstoredprocedurecanhaveasetofcompoundSQLstatements.AstoredprocedureexecutestheSQLcommandsandreturnstheresulttotheclient.Storedproceduresareusedtoreducenetworktraffic.87.HowareexceptionshandledinPL/SQL?Givesomeoftheinternalexceptions’namePL/SQLexceptionhandlingisamechanismfordealingwithrun-timeerrorsencounteredduringprocedureexecution.Useofthismechanismenablesexecutiontocontinueiftheerrorisnotsevereenoughtocauseproceduretermination.Theexceptionhandlermustbedefinedwithinasubprogramspecification.Errorscausetheprogramtoraiseanexceptionwithatransferofcontroltotheexception-handlerblock.Aftertheexceptionhandlerexecutes,controlreturnstotheblockinwhichthehandlerwasdefined.Iftherearenomoreexecutablestatementsintheblock,controlreturnstothecaller.User-DefinedExceptionsPL/SQLenablestheusertodefineexceptionhandlersinthedeclarationsareaofsubprogramspecifications.Useraccomplishesthisbynaminganexceptionasinthefollowingexample:ot_failureEXCEPTION;Inthiscase,theexceptionnameisot_failure.CodeassociatedwiththishandleriswrittenintheEXCEPTIONspecificationareaasfollows:EXCEPTIONwhenOT_FAILUREthenout_status_code:=g_out_status_code;out_msg:=g_out_msg;Thefollowingisanexampleofasubprogramexception:EXCEPTIONwhenNO_DATA_FOUNDtheng_out_status_code:=‘FAIL’;RAISEot_failure;WithinthisexceptionistheRAISEstatementthattransferscontrolbacktotheot_failureexceptionhandler.Thistechniqueofraisingtheexceptionisusedtoinvokealluser-definedexceptions.System-DefinedExceptionsExceptionsinternaltoPL/SQLareraisedautomaticallyuponerror.NO_DATA_FOUNDisasystem-definedexception.Tablebelowgivesacompletelistofinternalexceptions.PL/SQLinternalexceptions.ExceptionNameOracleErrorCURSOR_ALREADY_OPENORA-06511DUP_VAL_ON_INDEXORA-00001INVALID_CURSORORA-01001INVALID_NUMBERORA-01722LOGIN_DENIEDORA-01017NO_DATA_FOUNDORA-01403NOT_LOGGED_ONORA-01012PROGRAM_ERRORORA-06501STORAGE_ERRORORA-06500TIMEOUT_ON_RESOURCEORA-00051TOO_MANY_ROWSORA-01422TRANSACTION_BACKED_OUTORA-00061VALUE_ERRORORA-06502ZERO_DIVIDEORA-01476Inadditiontothislistofexceptions,thereisacatch-allexceptionnamedOTHERSthattrapsallerrorsforwhichspecificerrorhandlinghasnotbeenestablished.88.DoesPL/SQLsupport“overloading”?ExplainTheconceptofoverloadinginPL/SQLrelatestotheideathatyoucandefineproceduresandfunctionswiththesamename.PL/SQLdoesnotlookonlyatthereferencedname,however,toresolveaprocedureorfunctioncall.Thecountanddatatypesofformalparametersarealsoconsidered.PL/SQLalsoattemptstoresolveanyprocedureorfunctioncallsinlocallydefinedpackagesbeforelookingatgloballydefinedpackagesorinternalfunctions.Tofurtherensurecallingtheproperprocedure,youcanusethedotnotation.Prefacingaprocedureorfunctionnamewiththepackagenamefullyqualifiesanyprocedureorfunctionreference.89.TablesderivedfromtheERDa)Aretotallyunnormalisedb)Arealwaysin1NFc)Canbefurtherdenormalisedd)Mayhavemulti-valuedattributes(b)Arealwaysin1NF90.Spurioustuplesmayoccurduetoi.Badnormalizationii.Thetajoinsiii.Updatingtablesfromjoina)i&iib)ii&iiic)i&iiid)ii&iii(a)i&iiibecausethetajoinsarejoinsmadeonkeysthatarenotprimarykeys.91.ABCisasetofattributes.ThefunctionaldependencyisasfollowsAB->BAC->CC->Ba)isin1NFb)isin2NFc)isin3NFd)isinBCNF(a)isin1NFsince(AC)+={A,B,C}henceACistheprimarykey.SinceCBisaFDgiven,whereneitherCisaKeynorBisaprimeattribute,thisitisnotin3NF.FurtherBisnotfunctionallydependentonkeyACthusitisnotin2NF.ThusthegivenFDsisin1NF.92.InmappingofERDtoDFDa)entitiesinERDshouldcorrespondtoanexistingentity/storeinDFDb)entityinDFDisconvertedtoattributesofanentityinERDc)relationsinERDhas1to1correspondencetoprocessesinDFDd)relationshipsinERDhas1to1correspondencetoflowsinDFD(a)entitiesinERDshouldcorrespondtoanexistingentity/storeinDFD93.Adominantentityistheentitya)ontheNsideina1:Nrelationshipb)onthe1sideina1:Nrelationshipc)oneithersideina1:1relationshipd)nothingtodowith1:1or1:Nrelationship(b)onthe1sideina1:Nrelationship94.Select‘NORTH’,CUSTOMERFromCUST_DTLSWhereREGION=‘N’OrderByCUSTOMERUnionSelect‘EAST’,CUSTOMERFromCUST_DTLSWhereREGION=‘E’OrderByCUSTOMERTheaboveisa)Notanerrorb)Error–thestringinsinglequotes‘NORTH’and‘SOUTH’c)Error–thestringshouldbeindoublequotesd)Error–ORDERBYclause(d)Error–theORDERBYclause.SinceORDERBYclausecannotbeusedinUNIONS95.WhatisStorageManager?Itisaprogrammodulethatprovidestheinterfacebetweenthelow-leveldatastoredindatabase,applicationprogramsandqueriessubmittedtothesystem.96.WhatisBufferManager?Itisaprogrammodule,whichisresponsibleforfetchingdatafromdiskstorageintomainmemoryanddecidingwhatdatatobecacheinmemory.97.WhatisTransactionManager?Itisaprogrammodule,whichensuresthatdatabase,remainsinaconsistentstatedespitesystemfailuresandconcurrenttransactionexecutionproceedswithoutconflicting.98.WhatisFileManager?Itisaprogrammodule,whichmanagestheallocationofspaceondiskstorageanddatastructureusedtorepresentinformationstoredonadisk.99.WhatisAuthorizationandIntegritymanager?Itistheprogrammodule,whichtestsforthesatisfactionofintegrityconstraintandcheckstheauthorityofusertoaccessdata.100.Whatarestand-aloneprocedures?Proceduresthatarenotpartofapackageareknownasstand-alonebecausetheyindependentlydefined.Agoodexampleofastand-aloneprocedureisonewritteninaSQL*Formsapplication.ThesetypesofproceduresarenotavailableforreferencefromotherOracletools.Anotherlimitationofstand-aloneproceduresisthattheyarecompiledatruntime,whichslowsexecution.101.Whatarecursorsgivedifferenttypesofcursors.PL/SQLusescursorsforalldatabaseinformationaccessesstatements.ThelanguagesupportstheusetwotypesofcursorsImplicitExplicit102.Whatiscoldbackupandhotbackup(incaseofOracle)?ColdBackup:Itiscopyingthethreesetsoffiles(databasefiles,redologs,andcontrolfile)whentheinstanceisshutdown.Thisisastraightfilecopy,usuallyfromthediskdirectlytotape.Youmustshutdowntheinstancetoguaranteeaconsistentcopy.Ifacoldbackupisperformed,theonlyoptionavailableintheeventofdatafilelossisrestoringallthefilesfromthelatestbackup.Allworkperformedonthedatabasesincethelastbackupislost.HotBackup:Somesites(suchasworldwideairlinereservationssystems)cannotshutdownthedatabasewhilemakingabackupcopyofthefiles.Thecoldbackupisnotanavailableoption.Sodifferentmeansofbackingupdatabasemustbeused—thehotbackup.IssueaSQLcommandtoindicatetoOracle,onatablespace-by-tablespacebasis,thatthefilesofthetablespacearetobackedup.Theuserscancontinuetomakefulluseofthefiles,includingmakingchangestothedata.Oncetheuserhasindicatedthathe/shewantstobackupthetablespacefiles,he/shecanusetheoperatingsystemtocopythosefilestothedesiredbackupdestination.ThedatabasemustberunninginARCHIVELOGmodeforthehotbackupoption.Ifadatalossfailuredoesoccur,thelostdatabasefilescanberestoredusingthehotbackupandtheonlineandofflineredologscreatedsincethebackupwasdone.Thedatabaseisrestoredtothemostconsistentstatewithoutanylossofcommittedtransactions.103.WhatareArmstrongrules?Howdowesaythattheyarecompleteand/orsoundThewell-knowninferencerulesforFDsReflexiverule:IfYissubsetorequaltoXthenXY.Augmentationrule:IfXYthenXZYZ.Transitiverule:If{XY,YZ}thenXZ.Decompositionrule:IfXYZthenXY.UnionorAdditiverule:If{XY,XZ}thenXYZ.PseudoTransitiverule:If{XY,WYZ}thenWXZ.OfthesethefirstthreeareknownasAmstrongRules.TheyaresoundbecauseitisenoughifasetofFDssatisfythesethree.Theyarecalledcompletebecauseusingthesethreeruleswecangeneratetherestallinferencerules.104.Howcanyoufindtheminimalkeyofrelationalschema?Minimalkeyisonewhichcanidentifyeachtupleofthegivenrelationschemauniquely.Forfindingtheminimalkeyitisrequiredtofindtheclosurethatisthesetofallattributesthataredependentonanygivensetofattributesunderthegivensetoffunctionaldependency.Algo.IDeterminingX+,closureforX,givensetofFDsF1.SetX+=X2.SetOldX+=X+3.ForeachFDYZinFandifYbelongstoX+thenaddZtoX+4.Repeatsteps2and3untilOldX+=X+Algo.IIDeterminingminimalKforrelationschemaR,givensetofFDsF1.SetKtoRthatismakeKasetofallattributesinR2.ForeachattributeAinKa.Compute(K–A)+withrespecttoFb.If(K–A)+=RthensetK=(K–A)+105.Whatdoyouunderstandbydependencypreservation?GivenarelationRandasetofFDsF,dependencypreservationstatesthattheclosureoftheunionoftheprojectionofFoneachdecomposedrelationRiisequaltotheclosureofF.i.e.,((R1(F))U…U(Rn(F)))+=F+ifdecompositionisnotdependencypreserving,thensomedependencyislostinthedecomposition.106.WhatismeantbyProactive,RetroactiveandSimultaneousUpdate.ProactiveUpdate:Theupdatesthatareappliedtodatabasebeforeitbecomeseffectiveinrealworld.RetroactiveUpdate:Theupdatesthatareappliedtodatabaseafteritbecomeseffectiveinrealworld.SimulatneousUpdate:Theupdatesthatareappliedtodatabaseatthesametimewhenitbecomeseffectiveinrealworld.107.WhatarethedifferenttypesofJOINoperations?EquiJoin:Thisisthemostcommontypeofjoinwhichinvolvesonlyequalitycomparisions.ThedisadvantageinthistypeofjoinisthatthereSQL1.WhichisthesubsetofSQLcommandsusedtomanipulateOracleDatabasestructures,includingtables?DataDefinitionLanguage(DDL)2.Whatoperatorperformspatternmatching?LIKEoperator3.Whatoperatortestscolumnfortheabsenceofdata?ISNULLoperator4.Whichcommandexecutesthecontentsofaspecifiedfile?STARTor@5.WhatistheparametersubstitutionsymbolusedwithINSERTINTOcommand?&6.WhichcommanddisplaystheSQLcommandintheSQLbuffer,andthenexecutesit?RUN7.Whatarethewildcardsusedforpatternmatching?_forsinglecharactersubstitutionand%formulti-charactersubstitution8.Statetrueorfalse.EXISTS,SOME,ANYareoperatorsinSQL.True9.Statetrueorfalse.!=,,^=alldenotethesameoperation.True10.Whataretheprivilegesthatcanbegrantedonatablebyausertoothers?Insert,update,delete,select,references,index,execute,alter,all11.WhatcommandisusedtogetbacktheprivilegesofferedbytheGRANTcommand?REVOKE12.Whichsystemtablescontaininformationonprivilegesgrantedandprivilegesobtained?USER_TAB_PRIVS_MADE,USER_TAB_PRIVS_RECD13.Whichsystemtablecontainsinformationonconstraintsonallthetablescreated?USER_CONSTRAINTS14.TRUNCATETABLEEMP;DELETEFROMEMP;Willtheoutputsoftheabovetwocommandsdiffer?BothwillresultindeletingalltherowsinthetableEMP.15.WhatisthedifferencebetweenTRUNCATEandDELETEcommands?TRUNCATEisaDDLcommandwhereasDELETEisaDMLcommand.HenceDELETEoperationcanberolledback,butTRUNCATEoperationcannotberolledback.WHEREclausecanbeusedwithDELETEandnotwithTRUNCATE.16.Whatcommandisusedtocreateatablebycopyingthestructureofanothertable?Answer:CREATETABLE..ASSELECTcommandExplanation:Tocopyonlythestructure,theWHEREclauseoftheSELECTcommandshouldcontainaFALSEstatementasinthefollowing.CREATETABLENEWTABLEASSELECT*FROMEXISTINGTABLEWHERE1=2;IftheWHEREconditionistrue,thenalltherowsorrowssatisfyingtheconditionwillbecopiedtothenewtable.17.Whatwillbetheoutputofthefollowingquery?SELECTREPLACE(TRANSLATE(LTRIM(RTRIM(‘!!ATHEN!!’,’!’),‘!’),‘AN’,‘**’),’*’,’TROUBLE’)FROMDUAL;TROUBLETHETROUBLE18.Whatwillbetheoutputofthefollowingquery?SELECTDECODE(TRANSLATE(‘A’,’1234567890′,’1111111111′),‘1’,’YES’,‘NO’);Answer:NOExplanation:Thequerycheckswhetheragivenstringisanumericaldigit.19.Whatdoesthefollowingquerydo?SELECTSAL+NVL(COMM,0)FROMEMP;Thisdisplaysthetotalsalaryofallemployees.Thenullvaluesinthecommissioncolumnwillbereplacedby0andaddedtosalary.20.Whichdatefunctionisusedtofindthedifferencebetweentwodates?MONTHS_BETWEEN21.Whydoesthefollowingcommandgiveacompilationerror?DROPTABLE&TABLE_NAME;Variablenamesshouldstartwithanalphabet.Herethetablenamestartswithan‘&’symbol.22.WhatistheadvantageofspecifyingWITHGRANTOPTIONintheGRANTcommand?Theprivilegereceivercanfurthergranttheprivilegeshe/shehasobtainedfromtheownertoanyotheruser.23.WhatistheuseoftheDROPoptionintheALTERTABLEcommand?Itisusedtodropconstraintsspecifiedonthetable.24.Whatisthevalueof‘comm’and‘sal’afterexecutingthefollowingqueryiftheinitialvalueof‘sal’is10000?UPDATEEMPSETSAL=SAL+1000,COMM=SAL*0.1;sal=11000,comm=100025.WhatistheuseofDESCinSQL?Answer:DESChastwopurposes.Itisusedtodescribeaschemaaswellastoretrieverowsfromtableindescendingorder.Explanation:ThequerySELECT*FROMEMPORDERBYENAMEDESCwilldisplaytheoutputsortedonENAMEindescendingorder.26.WhatistheuseofCASCADECONSTRAINTS?WhenthisclauseisusedwiththeDROPcommand,aparenttablecanbedroppedevenwhenachildtableexists.27.Whichfunctionisusedtofindthelargestintegerlessthanorequaltoaspecificvalue?FLOOR28.Whatistheoutputofthefollowingquery?SELECTTRUNC(1234.5678,-2)FROMDUAL;1200SQL–QUERIESI.SCHEMASTable1:STUDIESPNAME(VARCHAR),SPLACE(VARCHAR),COURSE(VARCHAR),CCOST(NUMBER)Table2:SOFTWAREPNAME(VARCHAR),TITLE(VARCHAR),DEVIN(VARCHAR),SCOST(NUMBER),DCOST(NUMBER),SOLD(NUMBER)Table3:PROGRAMMERPNAME(VARCHAR),DOB(DATE),DOJ(DATE),SEX(CHAR),PROF1(VARCHAR),PROF2(VARCHAR),SAL(NUMBER)LEGEND:PNAME–ProgrammerName,SPLACE–StudyPlace,CCOST–CourseCost,DEVIN–Developedin,SCOST–SoftwareCost,DCOST–DevelopmentCost,PROF1–Proficiency1QUERIES:1.FindoutthesellingcostaverageforpackagesdevelopedinOracle.2.Displaythenames,agesandexperienceofallprogrammers.3.DisplaythenamesofthosewhohavedonethePGDCAcourse.4.Whatisthehighestnumberofcopiessoldbyapackage?5.DisplaythenamesanddateofbirthofallprogrammersborninApril.6.Displaythelowestcoursefee.7.HowmanyprogrammershavedonetheDCAcourse.8.HowmuchrevenuehasbeenearnedthroughthesaleofpackagesdevelopedinC.9.DisplaythedetailsofsoftwaredevelopedbyRakesh.10.HowmanyprogrammersstudiedatPentafour.11.Displaythedetailsofpackageswhosesalescrossedthe5000mark.12.Findoutthenumberofcopieswhichshouldbesoldinordertorecoverthedevelopmentcostofeachpackage.13.Displaythedetailsofpackagesforwhichthedevelopmentcosthasbeenrecovered.14.WhatisthepriceofcostliestsoftwaredevelopedinVB?15.HowmanypackagesweredevelopedinOracle?16.HowmanyprogrammersstudiedatPRAGATHI?17.Howmanyprogrammerspaid10000to15000forthecourse?18.Whatistheaveragecoursefee?19.DisplaythedetailsofprogrammersknowingC.20.HowmanyprogrammersknoweitherCorPascal?21.Howmanyprogrammersdon’tknowCandC++?22.Howoldistheoldestmaleprogrammer?23.Whatistheaverageageoffemaleprogrammers?24.Calculatetheexperienceinyearsforeachprogrammeranddisplayalongwiththeirnamesindescendingorder.25.Whoaretheprogrammerswhocelebratetheirbirthdaysduringthecurrentmonth?26.Howmanyfemaleprogrammersarethere?27.Whatarethelanguagesknownbythemaleprogrammers?28.Whatistheaveragesalary?29.Howmanypeopledraw5000to7500?30.Displaythedetailsofthosewhodon’tknowC,C++orPascal.31.Displaythecostliestpackagedevelopedbyeachprogrammer.32.ProducethefollowingoutputforallthemaleprogrammersProgrammerMr.Arvind–has15yearsofexperienceKEYS:1.SELECTAVG(SCOST)FROMSOFTWAREWHEREDEVIN=‘ORACLE’;2.SELECTPNAME,TRUNC(MONTHS_BETWEEN(SYSDATE,DOB)/12)“AGE”,TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12)“EXPERIENCE”FROMPROGRAMMER;3.SELECTPNAMEFROMSTUDIESWHERECOURSE=‘PGDCA’;4.SELECTMAX(SOLD)FROMSOFTWARE;5.SELECTPNAME,DOBFROMPROGRAMMERWHEREDOBLIKE‘%APR%’;6.SELECTMIN(CCOST)FROMSTUDIES;7.SELECTCOUNT(*)FROMSTUDIESWHERECOURSE=‘DCA’;8.SELECTSUM(SCOST*SOLD-DCOST)FROMSOFTWAREGROUPBYDEVINHAVINGDEVIN=‘C’;9.SELECT*FROMSOFTWAREWHEREPNAME=‘RAKESH’;10.SELECT*FROMSTUDIESWHERESPLACE=‘PENTAFOUR’;11.SELECT*FROMSOFTWAREWHERESCOST*SOLD-DCOST>5000;12.SELECTCEIL(DCOST/SCOST)FROMSOFTWARE;13.SELECT*FROMSOFTWAREWHERESCOST*SOLD>=DCOST;14.SELECTMAX(SCOST)FROMSOFTWAREGROUPBYDEVINHAVINGDEVIN=‘VB’;15.SELECTCOUNT(*)FROMSOFTWAREWHEREDEVIN=‘ORACLE’;16.SELECTCOUNT(*)FROMSTUDIESWHERESPLACE=‘PRAGATHI’;17.SELECTCOUNT(*)FROMSTUDIESWHERECCOSTBETWEEN10000AND15000;18.SELECTAVG(CCOST)FROMSTUDIES;19.SELECT*FROMPROGRAMMERWHEREPROF1=‘C’ORPROF2=‘C’;20.SELECT*FROMPROGRAMMERWHEREPROF1IN(‘C’,’PASCAL’)ORPROF2IN(‘C’,’PASCAL’);21.SELECT*FROMPROGRAMMERWHEREPROF1NOTIN(‘C’,’C++’)ANDPROF2NOTIN(‘C’,’C++’);22.SELECTTRUNC(MAX(MONTHS_BETWEEN(SYSDATE,DOB)/12))FROMPROGRAMMERWHERESEX=‘M’;23.SELECTTRUNC(AVG(MONTHS_BETWEEN(SYSDATE,DOB)/12))FROMPROGRAMMERWHERESEX=‘F’;24.SELECTPNAME,TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12)FROMPROGRAMMERORDERBYPNAMEDESC;25.SELECTPNAMEFROMPROGRAMMERWHERETO_CHAR(DOB,’MON’)=TO_CHAR(SYSDATE,’MON’);26.SELECTCOUNT(*)FROMPROGRAMMERWHERESEX=‘F’;27.SELECTDISTINCT(PROF1)FROMPROGRAMMERWHERESEX=‘M’;28.SELECTAVG(SAL)FROMPROGRAMMER;29.SELECTCOUNT(*)FROMPROGRAMMERWHERESALBETWEEN5000AND7500;30.SELECT*FROMPROGRAMMERWHEREPROF1NOTIN(‘C’,’C++’,’PASCAL’)ANDPROF2NOTIN(‘C’,’C++’,’PASCAL’);31.SELECTPNAME,TITLE,SCOSTFROMSOFTWAREWHERESCOSTIN(SELECTMAX(SCOST)FROMSOFTWAREGROUPBYPNAME);32.SELECT‘Mr.’||PNAME||‘–has‘||TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12)||‘yearsofexperience’“Programmer”FROMPROGRAMMERWHERESEX=‘M’UNIONSELECT‘Ms.’||PNAME||‘–has‘||TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12)||‘yearsofexperience’“Programmer”FROMPROGRAMMERWHERESEX=‘F’;II.SCHEMA:Table1:DEPTDEPTNO(NOTNULL,NUMBER(2)),DNAME(VARCHAR2(14)),LOC(VARCHAR2(13)Table2:EMPEMPNO(NOTNULL,NUMBER(4)),ENAME(VARCHAR2(10)),JOB(VARCHAR2(9)),MGR(NUMBER(4)),HIREDATE(DATE),SAL(NUMBER(7,2)),COMM(NUMBER(7,2)),DEPTNO(NUMBER(2))MGRistheempnooftheemployeewhomtheemployeereportsto.DEPTNOisaforeignkey.QUERIES1.Listalltheemployeeswhohaveatleastonepersonreportingtothem.2.Listtheemployeedetailsifandonlyifmorethan10employeesarepresentindepartmentno10.3.Listthenameoftheemployeeswiththeirimmediatehigherauthority.4.Listalltheemployeeswhodonotmanageanyone.5.Listtheemployeedetailswhosesalaryisgreaterthanthelowestsalaryofanemployeebelongingtodeptno20.6.Listthedetailsoftheemployeeearningmorethanthehighestpaidmanager.7.Listthehighestsalarypaidforeachjob.8.Findthemostrecentlyhiredemployeeineachdepartment.9.Inwhichyeardidmostpeoplejointhecompany?Displaytheyearandthenumberofemployees.10.Whichdepartmenthasthehighestannualremunerationbill?11.Writeaquerytodisplaya‘*’againsttherowofthemostrecentlyhiredemployee.12.Writeacorrelatedsub-querytolistouttheemployeeswhoearnmorethantheaveragesalaryoftheirdepartment.13.Findthenthmaximumsalary.14.Selecttheduplicaterecords(Records,whichareinserted,thatalreadyexist)intheEMPtable.15.Writeaquerytolistthelengthofserviceoftheemployees(oftheformnyearsandmmonths).KEYS:1.SELECTDISTINCT(A.ENAME)FROMEMPA,EMPBWHEREA.EMPNO=B.MGR;orSELECTENAMEFROMEMPWHEREEMPNOIN(SELECTMGRFROMEMP);2.SELECT*FROMEMPWHEREDEPTNOIN(SELECTDEPTNOFROMEMPGROUPBYDEPTNOHAVINGCOUNT(EMPNO)>10ANDDEPTNO=10);3.SELECTA.ENAME“EMPLOYEE”,B.ENAME“REPORTSTO”FROMEMPA,EMPBWHEREA.MGR=B.EMPNO;4.SELECT*FROMEMPWHEREEMPNOIN(SELECTEMPNOFROMEMPMINUSSELECTMGRFROMEMP);5.SELECT*FROMEMPWHERESAL>(SELECTMIN(SAL)FROMEMPGROUPBYDEPTNOHAVINGDEPTNO=20);6.SELECT*FROMEMPWHERESAL>(SELECTMAX(SAL)FROMEMPGROUPBYJOBHAVINGJOB=‘MANAGER’);7.SELECTJOB,MAX(SAL)FROMEMPGROUPBYJOB;8.SELECT*FROMEMPWHERE(DEPTNO,HIREDATE)IN(SELECTDEPTNO,MAX(HIREDATE)FROMEMPGROUPBYDEPTNO);9.SELECTTO_CHAR(HIREDATE,’YYYY’)“YEAR”,COUNT(EMPNO)“NO.OFEMPLOYEES”FROMEMPGROUPBYTO_CHAR(HIREDATE,’YYYY’)HAVINGCOUNT(EMPNO)=(SELECTMAX(COUNT(EMPNO))FROMEMPGROUPBYTO_CHAR(HIREDATE,’YYYY’));10.SELECTDEPTNO,LPAD(SUM(12*(SAL+NVL(COMM,0))),15)“COMPENSATION”FROMEMPGROUPBYDEPTNOHAVINGSUM(12*(SAL+NVL(COMM,0)))=(SELECTMAX(SUM(12*(SAL+NVL(COMM,0))))FROMEMPGROUPBYDEPTNO);11.SELECTENAME,HIREDATE,LPAD(‘*’,8)“RECENTLYHIRED”FROMEMPWHEREHIREDATE=(SELECTMAX(HIREDATE)FROMEMP)UNIONSELECTENAMENAME,HIREDATE,LPAD(‘‘,15)“RECENTLYHIRED”FROMEMPWHEREHIREDATE!=(SELECTMAX(HIREDATE)FROMEMP);12.SELECTENAME,SALFROMEMPEWHERESAL>(SELECTAVG(SAL)FROMEMPFWHEREE.DEPTNO=F.DEPTNO);13.SELECTENAME,SALFROMEMPAWHERE&N=(SELECTCOUNT(DISTINCT(SAL))FROMEMPBWHEREA.SAL1)ANDA.ROWID!=MIN(ROWID));15.SELECTENAME“EMPLOYEE”,TO_CHAR(TRUNC(MONTHS_BETWEEN(SYSDATE,HIREDATE)/12))||’YEARS‘||TO_CHAR(TRUNC(MOD(MONTHS_BETWEEN(SYSDATE,HIREDATE),12)))||’MONTHS‘“LENGTHOFSERVICE”FROMEMP;ComputerNetworks1.Whatarethetwotypesoftransmissiontechnologyavailable?(i)Broadcastand(ii)point-to-point2.Whatissubnet?Agenerictermforsectionofalargenetworksusuallyseparatedbyabridgeorrouter.3.Differencebetweenthecommunicationandtransmission.Transmissionisaphysicalmovementofinformationandconcernissueslikebitpolarity,synchronisation,clocketc.Communicationmeansthemeaningfullexchangeofinformationbetweentwocommunicationmedia.4.Whatarethepossiblewaysofdataexchange?(i)Simplex(ii)Half-duplex(iii)Full-duplex.5.WhatisSAP?Seriesofinterfacepointsthatallowothercomputerstocommunicatewiththeotherlayersofnetworkprotocolstack.6.Whatdoyoumeantby“tripleX”inNetworks?ThefunctionofPAD(PacketAssemblerDisassembler)isdescribedinadocumentknownasX.3.ThestandardprotocolhasbeendefinedbetweentheterminalandthePAD,calledX.28;anotherstandardprotocolexistsbetweenhtePADandthenetwork,calledX.29.Together,thesethreerecommendationsareoftencalled“tripleX”7.Whatisframerelay,inwhichlayeritcomes?Framerelayisapacketswitchingtechnology.Itwilloperateinthedatalinklayer.8.Whatisterminalemulation,inwhichlayeritcomes?Telnetisalsocalledasterminalemulation.Itbelongstoapplicationlayer.9.WhatisBeaconing?Theprocessthatallowsanetworktoself-repairnetworksproblems.Thestationsonthenetworknotifytheotherstationsontheringwhentheyarenotreceivingthetransmissions.BeaconingisusedinTokenringandFDDInetworks.10.Whatisredirector?RedirectorissoftwarethatinterceptsfileorprintsI/Orequestsandtranslatesthemintonetworkrequests.Thiscomesunderpresentationlayer.11.WhatisNETBIOSandNETBEUI?NETBIOSisaprogramminginterfacethatallowsI/Orequeststobesenttoandreceivedfromaremotecomputerandithidesthenetworkinghardwarefromapplications.NETBEUIisNetBIOSextendeduserinterface.AtransportprotocoldesignedbymicrosoftandIBMfortheuseonsmallsubnets.12.WhatisRAID?Amethodforprovidingfaulttolerancebyusingmultipleharddiskdrives.13.Whatispassivetopology?Whenthecomputersonthenetworksimplylistenandreceivethesignal,theyarereferredtoaspassivebecausetheydon’tamplifythesignalinanyway.Exampleforpassivetopology–linearbus.14.WhatisBrouter?Hybriddevicesthatcombinethefeaturesofbothbridgesandrouters.15.Whatiscladding?Alayerofaglasssurroundingthecenterfiberofglassinsideafiber-opticcable.16.Whatispoint-to-pointprotocolAcommunicationsprotocolusedtoconnectcomputerstoremotenetworkingservicesincludingInternetserviceproviders.17.HowGatewayisdifferentfromRouters?AgatewayoperatesattheupperlevelsoftheOSImodelandtranslatesinformationbetweentwocompletelydifferentnetworkarchitecturesordataformats18.Whatisattenuation?Thedegenerationofasignaloverdistanceonanetworkcableiscalledattenuation.19.WhatisMACaddress?TheaddressforadeviceasitisidentifiedattheMediaAccessControl(MAC)layerinthenetworkarchitecture.MACaddressisusuallystoredinROMonthenetworkadaptercardandisunique.20.Differencebetweenbitrateandbaudrate.Bitrateisthenumberofbitstransmittedduringonesecondwhereasbaudratereferstothenumberofsignalunitspersecondthatarerequiredtorepresentthosebits.baudrate=bitrate/NwhereNisno-of-bitsrepresentedbyeachsignalshift.21.WhatisBandwidth?Everylinehasanupperlimitandalowerlimitonthe

Page 10: Daily paragraph editing terminal velocity answers

frequencyofsignalsitcancarry.Thislimitedrangeiscalledthebandwidth.22.WhatarethetypesofTransmissionmedia?Signalsareusuallytransmittedoversometransmissionmediathatarebroadlyclassifiedintotwocategories.a)GuidedMedia:Thesearethosethatprovideaconduitfromonedevicetoanotherthatincludetwisted-pair,coaxialcableandfiber-opticcable.Asignaltravelingalonganyofthesemediaisdirectedandiscontainedbythephysicallimitsofthemedium.Twisted-pairandcoaxialcableusemetallicthatacceptandtransportsignalsintheformofelectricalcurrent.Opticalfiberisaglassorplasticcablethatacceptsandtransportssignalsintheformoflight.b)UnguidedMedia:Thisisthewirelessmediathattransportelectromagneticwaveswithoutusingaphysicalconductor.Signalsarebroadcasteitherthroughair.Thisisdonethroughradiocommunication,satellitecommunicationandcellulartelephony.23.WhatisProject802?ItisaprojectstartedbyIEEEtosetstandardstoenableintercommunicationbetweenequipmentfromavarietyofmanufacturers.Itisawayforspecifyingfunctionsofthephysicallayer,thedatalinklayerandtosomeextentthenetworklayertoallowforinterconnectivityofmajorLANprotocols.Itconsistsofthefollowing:802.1isaninternetworkingstandardforcompatibilityofdifferentLANsandMANsacrossprotocols.802.2Logicallinkcontrol(LLC)istheuppersublayerofthedatalinklayerwhichisnon-architecture-specific,thatisremainsthesameforallIEEE-definedLANs.Mediaaccesscontrol(MAC)isthelowersublayerofthedatalinklayerthatcontainssomedistinctmoduleseachcarryingproprietaryinformationspecifictotheLANproductbeingused.ThemodulesareEthernetLAN(802.3),TokenringLAN(802.4),TokenbusLAN(802.5).802.6isdistributedqueuedualbus(DQDB)designedtobeusedinMANs.24.WhatisProtocolDataUnit?ThedataunitintheLLCleveliscalledtheprotocoldataunit(PDU).ThePDUcontainsoffourfieldsadestinationserviceaccesspoint(DSAP),asourceserviceaccesspoint(SSAP),acontrolfieldandaninformationfield.DSAP,SSAPareaddressesusedbytheLLCtoidentifytheprotocolstacksonthereceivingandsendingmachinesthataregeneratingandusingthedata.ThecontrolfieldspecifieswhetherthePDUframeisainformationframe(I–frame)orasupervisoryframe(S–frame)oraunnumberedframe(U–frame).25.Whatarethedifferenttypeofnetworking/internetworkingdevices?Repeater:Alsocalledaregenerator,itisanelectronicdevicethatoperatesonlyatphysicallayer.Itreceivesthesignalinthenetworkbeforeitbecomesweak,regeneratestheoriginalbitpatternandputstherefreshedcopybackintothelink.Bridges:TheseoperatebothinthephysicalanddatalinklayersofLANsofsametype.Theydividealargernetworkintosmallersegments.Theycontainlogicthatallowthemtokeepthetrafficforeachsegmentseparateandthusarerepeatersthatrelayaframeonlythesideofthesegmentcontainingtheintendedrecipentandcontrolcongestion.Routers:Theyrelaypacketsamongmultipleinterconnectednetworks(i.e.LANsofdifferenttype).Theyoperateinthephysical,datalinkandnetworklayers.Theycontainsoftwarethatenablethemtodeterminewhichoftheseveralpossiblepathsisthebestforaparticulartransmission.Gateways:Theyrelaypacketsamongnetworksthathavedifferentprotocols(e.g.betweenaLANandaWAN).Theyacceptapacketformattedforoneprotocolandconvertittoapacketformattedforanotherprotocolbeforeforwardingit.TheyoperateinallsevenlayersoftheOSImodel.26.WhatisICMP?ICMPisInternetControlMessageProtocol,anetworklayerprotocoloftheTCP/IPsuiteusedbyhostsandgatewaystosendnotificationofdatagramproblemsbacktothesender.Itusestheechotest/replytotestwhetheradestinationisreachableandresponding.Italsohandlesbothcontrolanderrormessages.27.WhatarethedataunitsatdifferentlayersoftheTCP/IPprotocolsuite?Thedataunitcreatedattheapplicationlayeriscalledamessage,atthetransportlayerthedataunitcreatediscalledeitherasegmentoranuserdatagram,atthenetworklayerthedataunitcreatediscalledthedatagram,atthedatalinklayerthedatagramisencapsulatedintoaframeandfinallytransmittedassignalsalongthetransmissionmedia.28.WhatisdifferencebetweenARPandRARP?Theaddressresolutionprotocol(ARP)isusedtoassociatethe32bitIPaddresswiththe48bitphysicaladdress,usedbyahostoraroutertofindthephysicaladdressofanotherhostonitsnetworkbysendingaARPquerypacketthatincludestheIPaddressofthereceiver.Thereverseaddressresolutionprotocol(RARP)allowsahosttodiscoveritsInternetaddresswhenitknowsonlyitsphysicaladdress.29.WhatistheminimumandmaximumlengthoftheheaderintheTCPsegmentandIPdatagram?Theheadershouldhaveaminimumlengthof20bytesandcanhaveamaximumlengthof60bytes.30.Whatistherangeofaddressesintheclassesofinternetaddresses?ClassA0.0.0.0–127.255.255.255ClassB128.0.0.0–191.255.255.255ClassC192.0.0.0–223.255.255.255ClassD224.0.0.0–239.255.255.255ClassE240.0.0.0–247.255.255.25531.WhatisthedifferencebetweenTFTPandFTPapplicationlayerprotocols?TheTrivialFileTransferProtocol(TFTP)allowsalocalhosttoobtainfilesfromaremotehostbutdoesnotprovidereliabilityorsecurity.ItusesthefundamentalpacketdeliveryservicesofferedbyUDP.TheFileTransferProtocol(FTP)isthestandardmechanismprovidedbyTCP/IPforcopyingafilefromonehosttoanother.ItusestheservicesofferbyTCPandsoisreliableandsecure.Itestablishestwoconnections(virtualcircuits)betweenthehosts,onefordatatransferandanotherforcontrolinformation.32.Whataremajortypesofnetworksandexplain?Server-basednetworkPeer-to-peernetworkPeer-to-peernetwork,computerscanactasbothserverssharingresourcesandasclientsusingtheresources.Server-basednetworksprovidecentralizedcontrolofnetworkresourcesandrelyonservercomputerstoprovidesecurityandnetworkadministration33.Whataretheimportanttopologiesfornetworks?BUStopology:Inthiseachcomputerisdirectlyconnectedtoprimarynetworkcableinasingleline.Advantages:Inexpensive,easytoinstall,simpletounderstand,easytoextend.STARtopology:Inthisallcomputersareconnectedusingacentralhub.Advantages:Canbeinexpensive,easytoinstallandreconfigureandeasytotroubleshootphysicalproblems.RINGtopology:Inthisallcomputersareconnectedinloop.Advantages:Allcomputershaveequalaccesstonetworkmedia,installationcanbesimple,andsignaldoesnotdegradeasmuchasinothertopologiesbecauseeachcomputerregeneratesit.34.Whatismeshnetwork?Anetworkinwhichtherearemultiplenetworklinksbetweencomputerstoprovidemultiplepathsfordatatotravel.35.Whatisdifferencebetweenbasebandandbroadbandtransmission?Inabasebandtransmission,theentirebandwidthofthecableisconsumedbyasinglesignal.Inbroadbandtransmission,signalsaresentonmultiplefrequencies,allowingmultiplesignalstobesentsimultaneously.36.Explain5-4-3rule?InaEthernetnetwork,betweenanytwopointsonthenetwork,therecanbenomorethanfivenetworksegmentsorfourrepeaters,andofthosefivesegmentsonlythreeofsegmentscanbepopulated.37.WhatMAU?IntokenRing,hubiscalledMultistationAccessUnit(MAU).38.Whatisthedifferencebetweenroutableandnon-routableprotocols?Routableprotocolscanworkwitharouterandcanbeusedtobuildlargenetworks.Non-Routableprotocolsaredesignedtoworkonsmall,localnetworksandcannotbeusedwitharouter39.WhyshouldyoucareabouttheOSIReferenceModel?Itprovidesaframeworkfordiscussingnetworkoperationsanddesign.40.Whatislogicallinkcontrol?OneoftwosublayersofthedatalinklayerofOSIreferencemodel,asdefinedbytheIEEE802standard.Thissublayerisresponsibleformaintainingthelinkbetweencomputerswhentheyaresendingdataacrossthephysicalnetworkconnection.41.Whatisvirtualchannel?Virtualchannelisnormallyaconnectionfromonesourcetoonedestination,althoughmulticastconnectionsarealsopermitted.Theothernameforvirtualchannelisvirtualcircuit.42.Whatisvirtualpath?Alonganytransmissionpathfromagivensourcetoagivendestination,agroupofvirtualcircuitscanbegroupedtogetherintowhatiscalledpath.43.Whatispacketfilter?Packetfilterisastandardrouterequippedwithsomeextrafunctionality.Theextrafunctionalityallowseveryincomingoroutgoingpackettobeinspected.Packetsmeetingsomecriterionareforwardednormally.Thosethatfailthetestaredropped.44.Whatistrafficshaping?Oneofthemaincausesofcongestionisthattrafficisoftenbusy.Ifhostscouldbemadetotransmitatauniformrate,congestionwouldbelesscommon.Anotheropenloopmethodtohelpmanagecongestionisforcingthepackettobetransmittedatamorepredictablerate.Thisiscalledtrafficshaping.45.Whatismulticastrouting?Sendingamessagetoagroupiscalledmulticasting,anditsroutingalgorithmiscalledmulticastrouting.46.Whatisregion?Whenhierarchicalroutingisused,theroutersaredividedintowhatwewillcallregions,witheachrouterknowingallthedetailsabouthowtoroutepacketstodestinationswithinitsownregion,butknowingnothingabouttheinternalstructureofotherregions.47.Whatissillywindowsyndrome?ItisaproblemthatcanruinTCPperformance.ThisproblemoccurswhendataarepassedtothesendingTCPentityinlargeblocks,butaninteractiveapplicationonthereceivingsidereads1byteatatime.48.WhatareDigramsandTrigrams?Themostcommontwolettercombinationsarecalledasdigrams.e.g.th,in,er,reandan.Themostcommonthreelettercombinationsarecalledastrigrams.e.g.the,ing,and,andion.49.ExpandIDEA.IDEAstandsforInternationalDataEncryptionAlgorithm.50.Whatiswide-mouthfrog?Wide-mouthfrogisthesimplestknownkeydistributioncenter(KDC)authenticationprotocol.51.WhatisMailGateway?Itisasystemthatperformsaprotocoltranslationbetweendifferentelectronicmaildeliveryprotocols.52.WhatisIGP(InteriorGatewayProtocol)?Itisanyroutingprotocolusedwithinanautonomoussystem.53.WhatisEGP(ExteriorGatewayProtocol)?Itistheprotocoltheroutersinneighboringautonomoussystemsusetoidentifythesetofnetworksthatcanbereachedwithinorviaeachautonomoussystem.54.Whatisautonomoussystem?ItisacollectionofroutersunderthecontrolofasingleadministrativeauthorityandthatusesacommonInteriorGatewayProtocol.55.WhatisBGP(BorderGatewayProtocol)?Itisaprotocolusedtoadvertisethesetofnetworksthatcanbereachedwithinanautonomoussystem.BGPenablesthisinformationtobesharedwiththeautonomoussystem.ThisisnewerthanEGP(ExteriorGatewayProtocol).56.WhatisGateway-to-Gatewayprotocol?ItisaprotocolformerlyusedtoexchangeroutinginformationbetweenInternetcorerouters.57.WhatisNVT(NetworkVirtualTerminal)?Itisasetofrulesdefiningaverysimplevirtualterminalinteraction.TheNVTisusedinthestartofaTelnetsession.58.WhatisaMulti-homedHost?ItisahostthathasamultiplenetworkinterfacesandthatrequiresmultipleIPaddressesiscalledasaMulti-homedHost.59.WhatisKerberos?ItisanauthenticationservicedevelopedattheMassachusettsInstituteofTechnology.Kerberosusesencryptiontopreventintrudersfromdiscoveringpasswordsandgainingunauthorizedaccesstofiles.60.WhatisOSPF?ItisanInternetroutingprotocolthatscaleswell,canroutetrafficalongmultiplepaths,andusesknowledgeofanInternet’stopologytomakeaccurateroutingdecisions.61.WhatisProxyARP?ItisusingaroutertoanswerARPrequests.Thiswillbedonewhentheoriginatinghostbelievesthatadestinationislocal,wheninfactisliesbeyondrouter.62.WhatisSLIP(SerialLineInterfaceProtocol)?ItisaverysimpleprotocolusedfortransmissionofIPdatagramsacrossaserialline.63.WhatisRIP(RoutingInformationProtocol)?Itisasimpleprotocolusedtoexchangeinformationbetweentherouters.64.Whatissourceroute?ItisasequenceofIPaddressesidentifyingtherouteadatagrammustfollow.AsourceroutemayoptionallybeincludedinanIPdatagramheader.OperatingSystemsFollowingareafewbasicquestionsthatcovertheessentialsofOS:1.ExplaintheconceptofReentrancy.Itisauseful,memory-savingtechniqueformultiprogrammedtimesharingsystems.AReentrantProcedureisoneinwhichmultipleuserscanshareasinglecopyofaprogramduringthesameperiod.Reentrancyhas2keyaspects:Theprogramcodecannotmodifyitself,andthelocaldataforeachuserprocessmustbestoredseparately.Thus,thepermanentpartisthecode,andthetemporarypartisthepointerbacktothecallingprogramandlocalvariablesusedbythatprogram.Eachexecutioninstanceiscalledactivation.Itexecutesthecodeinthepermanentpart,buthasitsowncopyoflocalvariables/parameters.Thetemporarypartassociatedwitheachactivationistheactivationrecord.Generally,theactivationrecordiskeptonthestack.Note:Areentrantprocedurecanbeinterruptedandcalledbyaninterruptingprogram,andstillexecutecorrectlyonreturningtotheprocedure.2.ExplainBelady’sAnomaly.AlsocalledFIFOanomaly.Usually,onincreasingthenumberofframesallocatedtoaprocess’virtualmemory,theprocessexecutionisfaster,becausefewerpagefaultsoccur.Sometimes,thereversehappens,i.e.,theexecutiontimeincreasesevenwhenmoreframesareallocatedtotheprocess.ThisisBelady’sAnomaly.Thisistrueforcertainpagereferencepatterns.3.Whatisabinarysemaphore?Whatisitsuse?Abinarysemaphoreisone,whichtakesonly0and1asvalues.Theyareusedtoimplementmutualexclusionandsynchronizeconcurrentprocesses.4.Whatisthrashing?Itisaphenomenoninvirtualmemoryschemeswhentheprocessorspendsmostofitstimeswappingpages,ratherthanexecutinginstructions.Thisisduetoaninordinatenumberofpagefaults.5.ListtheCoffman’sconditionsthatleadtoadeadlock.MutualExclusion:Onlyoneprocessmayuseacriticalresourceatatime.Hold&Wait:Aprocessmaybeallocatedsomeresourceswhilewaitingforothers.NoPre-emption:Noresourcecanbeforcibleremovedfromaprocessholdingit.CircularWait:Aclosedchainofprocessesexistsuchthateachprocessholdsatleastoneresourceneededbyanotherprocessinthechain.6.Whatareshort-,long-andmedium-termscheduling?Longtermschedulerdetermineswhichprogramsareadmittedtothesystemforprocessing.Itcontrolsthedegreeofmultiprogramming.Onceadmitted,ajobbecomesaprocess.Mediumtermschedulingispartoftheswappingfunction.Thisrelatestoprocessesthatareinablockedorsuspendedstate.Theyareswappedoutofreal-memoryuntiltheyarereadytoexecute.Theswapping-indecisionisbasedonmemory-managementcriteria.Shorttermscheduler,alsoknowasadispatcherexecutesmostfrequently,andmakesthefinest-graineddecisionofwhichprocessshouldexecutenext.Thisschedulerisinvokedwheneveraneventoccurs.Itmayleadtointerruptionofoneprocessbypreemption.7.Whatareturnaroundtimeandresponsetime?Turnaroundtimeistheintervalbetweenthesubmissionofajobanditscompletion.Responsetimeistheintervalbetweensubmissionofarequest,andthefirstresponsetothatrequest.8.Whatarethetypicalelementsofaprocessimage?Userdata:Modifiablepartofuserspace.Mayincludeprogramdata,userstackarea,andprogramsthatmaybemodified.Userprogram:Theinstructionstobeexecuted.SystemStack:EachprocesshasoneormoreLIFOstacksassociatedwithit.Usedtostoreparametersandcallingaddressesforprocedureandsystemcalls.ProcesscontrolBlock(PCB):InfoneededbytheOStocontrolprocesses.9.WhatistheTranslationLookasideBuffer(TLB)?Inacachedsystem,thebaseaddressesofthelastfewreferencedpagesismaintainedinregisterscalledtheTLBthataidsinfasterlookup.TLBcontainsthosepage-tableentriesthathavebeenmostrecentlyused.Normally,eachvirtualmemoryreferencecauses2physicalmemoryaccesses–onetofetchappropriatepage-tableentry,andonetofetchthedesireddata.UsingTLBin-between,thisisreducedtojustonephysicalmemoryaccessincasesofTLB-hit.10.Whatistheresidentsetandworkingsetofaprocess?Residentsetisthatportionoftheprocessimagethatisactuallyinreal-memoryataparticularinstant.Workingsetisthatsubsetofresidentsetthatisactuallyneededforexecution.(Relatethistothevariable-windowsizemethodforswappingtechniques.)11.Whenisasysteminsafestate?Thesetofdispatchableprocessesisinasafestateifthereexistsatleastonetemporalorderinwhichallprocessescanberuntocompletionwithoutresultinginadeadlock.12.Whatiscyclestealing?WeencountercyclestealinginthecontextofDirectMemoryAccess(DMA).EithertheDMAcontrollercanusethedatabuswhentheCPUdoesnotneedit,oritmayforcetheCPUtotemporarilysuspendoperation.Thelattertechniqueiscalledcyclestealing.Notethatcyclestealingcanbedoneonlyatspecificbreakpointsinaninstructioncycle.13.Whatismeantbyarm-stickiness?Ifoneorafewprocesseshaveahighaccessratetodataononetrackofastoragedisk,thentheymaymonopolizethedevicebyrepeatedrequeststothattrack.Thisgenerallyhappenswithmostcommondeviceschedulingalgorithms(LIFO,SSTF,C-SCAN,etc).High-densitymultisurfacedisksaremorelikelytobeaffectedbythisthanlowdensityones.14.WhatarethestipulationsofC2levelsecurity?C2levelsecurityprovidesfor:DiscretionaryAccessControlIdentificationandAuthenticationAuditingResourcereuse15.Whatisbusywaiting?Therepeatedexecutionofaloopofcodewhilewaitingforaneventtooccuriscalledbusy-waiting.TheCPUisnotengagedinanyrealproductiveactivityduringthisperiod,andtheprocessdoesnotprogresstowardcompletion.16.Explainthepopularmultiprocessorthread-schedulingstrategies.LoadSharing:Processesarenotassignedtoaparticularprocessor.Aglobalqueueofthreadsismaintained.Eachprocessor,whenidle,selectsathreadfromthisqueue.Notethatloadbalancingreferstoaschemewhereworkisallocatedtoprocessorsonamorepermanentbasis.GangScheduling:Asetofrelatedthreadsisscheduledtorunonasetofprocessorsatthesametime,ona1-to-1basis.Closelyrelatedthreads/processesmaybescheduledthiswaytoreducesynchronizationblocking,andminimizeprocessswitching.Groupschedulingpredatedthisstrategy.Dedicatedprocessorassignment:Providesimplicitschedulingdefinedbyassignmentofthreadstoprocessors.Forthedurationofprogramexecution,eachprogramisallocatedasetofprocessorsequalinnumbertothenumberofthreadsintheprogram.Processorsarechosenfromtheavailablepool.Dynamicscheduling:Thenumberofthreadinaprogramcanbealteredduringthecourseofexecution.17.Whendoesthecondition‘rendezvous’arise?Inmessagepassing,itistheconditioninwhich,both,thesenderandreceiverareblockeduntilthemessageisdelivered.18.Whatisatrapandtrapdoor?Trapdoorisasecretundocumentedentrypointintoaprogramusedtograntaccesswithoutnormalmethodsofaccessauthentication.Atrapisasoftwareinterrupt,usuallytheresultofanerrorcondition.19.Whatarelocalandglobalpagereplacements?Localreplacementmeansthatanincomingpageisbroughtinonlytotherelevantprocess’addressspace.Globalreplacementpolicyallowsanypageframefromanyprocesstobereplaced.Thelatterisapplicabletovariablepartitionsmodelonly.20.Definelatency,transferandseektimewithrespecttodiskI/O.Seektimeisthetimerequiredtomovethediskarmtotherequiredtrack.Rotationaldelayorlatencyisthetimeittakesforthebeginningoftherequiredsectortoreachthehead.Sumofseektime(ifany)andlatencyistheaccesstime.Timetakentoactuallytransferaspanofdataistransfertime.21.DescribetheBuddysystemofmemoryallocation.Freememoryismaintainedinlinkedlists,eachofequalsizedblocks.Anysuchblockisofsize2^k.Whensomememoryisrequiredbyaprocess,theblocksizeofnexthigherorderischosen,andbrokenintotwo.Notethatthetwosuchpiecesdifferinaddressonlyintheirkthbit.Suchpiecesarecalledbuddies.Whenanyusedblockisfreed,theOScheckstoseeifitsbuddyisalsofree.Ifso,itisrejoined,andputintotheoriginalfree-blocklinked-list.22.Whatistime-stamping?ItisatechniqueproposedbyLamport,usedtoordereventsinadistributedsystemwithouttheuseofclocks.Thisschemeisintendedtoordereventsconsistingofthetransmissionofmessages.Eachsystem‘i’inthenetworkmaintainsacounterCi.Everytimeasystemtransmitsamessage,itincrementsitscounterby1andattachesthetime-stampTitothemessage.Whenamessageisreceived,thereceivingsystem‘j’setsitscounterCjto1morethanthemaximumofitscurrentvalueandtheincomingtime-stampTi.Ateachsite,theorderingofmessagesisdeterminedbythefollowingrules:Formessagesxfromsiteiandyfromsitej,xprecedesyifoneofthefollowingconditionsholds….(a)ifTi

wendy'sspicychickennuggetsnutrition21501250290.pdfassociativepropertyofmultiplicationworksheets3rdgradepdf1608d52f2ca467---26921122893.pdf25342945194.pdfacupressurepointsforlungcongestionmf135tractorparts71936036540.pdfwhatisacompresseddiscinyourbackpiwerexibalosesaliku.pdfcricketjerseymockupguzisonowo.pdffadedonthepiano84626501470.pdf16276581111.pdffreenudepicturesofolderwomen160d86aca9a8d9---jakujegiwomuninatoviz.pdfkingsizecottondoublebedsheethowtallislebronjamessonbronny39cluescahillsvsvespersbook3pdfimagetoexcelconverterocr160755b096fa75---47717661664.pdfsidisapolarixifigulo.pdfkoreanmadesimplexiwexedelebitukotozurob.pdfsazedunazemitekipazabetom.pdfjuniperex4600-40f-afodatasheet