Interview Experience

5
After writing GATE paper, I was sure of not expecting anything from the GATE then the weirder answer keys of different institutes added the confusion and pressure. So, I decided to focus on my job and was busy with the boring testing work in office. 11 th March somebody posted link of GATE result I checked mine it was AIR 320 , a 400KW shock… I was stunned for movement I checked with few for validity of the result then rest of 4 days goes praying to make it real. Then come the day 15 th March, and yes it was same AIR 320 I was in cloud nine and sure of getting at least IITH/IITG. But, within few days I found myself in the cloud of sorrows and disgust as people from last year with higher rank were having more score than me. But then, my seniors and friends suggested me to focus on written/interview so I did. First confront was IITM(M.S), I cracked the written and delivered well in interview but was not shortlisted. Second battle was of IITK: waiting ticket and nighmare to travel from Mumbai to Kanpur. I write well in written and was among the top. Seniors there were saying that I am having very good chances now. Then come the movement. I entered in room: 1.How will you find shortest path in weighted graph? ‐ Dijkstra’s algorithm. 2.What is complexity? ‐ I acted street smart here, was trying to spend more time on question as I was comfortable. I said uin iterative approach we would need O(n^2) for finding shortest path between all pairs. 3.Is there any other approach? ‐Acted like recalling and then said Sir I guess the use of priority queqes would make it faster, we can achieve it in O(nlogn). Satisfied 4.What is difference between heap and priority queqe? ‐We can use heap as priority queqe. Bur Heap should then provide the function for insertion, report min, extractMin. Satisfied. 5.For reportMin and insert which data structure should be used?and what would be complexity?(this was a question from written test). I answerd it wrong in test. ‐I said Min heap and complexity for insertion O(logn) & for reportMin: O(logn). But, again I was wrong. They tried to give me hint but I was not able to get it. Correct answer was we can use an array and a min variable and everytime we insert element just check it with current min and update the min var accordingly This was explained to me by Swapnil after interview. 6.Is it able to have insertion in O(1)? ‐Yes we could use Fibonacci heap. 7. If we have an DS in which insertion and deleteMin is O(1) then what would its use? ‐We could use the insertion of n element in O(n) in that DS and then we could apply deleteMin() n time to get sorted array so we can have the sorting in O(n).

description

Interview of various IIT's Entrance Interview

Transcript of Interview Experience

  • AfterwritingGATEpaper,IwassureofnotexpectinganythingfromtheGATEthentheweirderanswerkeysofdifferentinstitutesaddedtheconfusionandpressure.So,Idecidedtofocusonmyjobandwasbusywiththeboringtestingworkinoffice.11thMarchsomebodypostedlinkofGATEresultIcheckedmineitwasAIR320,a400KWshockIwasstunnedformovementIcheckedwithfewforvalidityoftheresultthenrestof4daysgoesprayingtomakeitreal.

    Thencometheday15thMarch,andyesitwassameAIR320IwasincloudnineandsureofgettingatleastIITH/IITG.But,withinfewdaysIfoundmyselfinthecloudofsorrowsanddisgustaspeoplefromlastyearwithhigherrankwerehavingmorescorethanme.Butthen,myseniorsandfriendssuggestedmetofocusonwritten/interviewsoIdid.

    FirstconfrontwasIITM(M.S),Icrackedthewrittenanddeliveredwellininterviewbutwasnotshortlisted.

    SecondbattlewasofIITK:waitingticketandnighmaretotravelfromMumbaitoKanpur.Iwritewellinwrittenandwasamongthetop.SeniorsthereweresayingthatIamhavingverygoodchancesnow.Thencomethemovement.Ienteredinroom:1.Howwillyoufindshortestpathinweightedgraph?Dijkstrasalgorithm.2.Whatiscomplexity?Iactedstreetsmarthere,wastryingtospendmoretimeonquestionasIwascomfortable.IsaiduiniterativeapproachwewouldneedO(n^2)forfindingshortestpathbetweenallpairs.3.Isthereanyotherapproach?ActedlikerecallingandthensaidSirIguesstheuseofpriorityqueqeswouldmakeitfaster,wecanachieveitinO(nlogn).Satisfied4.Whatisdifferencebetweenheapandpriorityqueqe?Wecanuseheapaspriorityqueqe.BurHeapshouldthenprovidethefunctionforinsertion,reportmin,extractMin.Satisfied.5.ForreportMinandinsertwhichdatastructureshouldbeused?andwhatwouldbecomplexity?(thiswasaquestionfromwrittentest).Ianswerditwrongintest.IsaidMinheapandcomplexityforinsertionO(logn)&forreportMin:O(logn).But,againIwaswrong.TheytriedtogivemehintbutIwasnotabletogetit.CorrectanswerwaswecanuseanarrayandaminvariableandeverytimeweinsertelementjustcheckitwithcurrentminandupdatetheminvaraccordinglyThiswasexplainedtomebySwapnilafterinterview.

    6.IsitabletohaveinsertioninO(1)?YeswecoulduseFibonacciheap.

    7.IfwehaveanDSinwhichinsertionanddeleteMinisO(1)thenwhatwoulditsuse?WecouldusetheinsertionofnelementinO(n)inthatDSandthenwecouldapplydeleteMin()ntimetogetsortedarraysowecanhavethesortinginO(n).

  • 8.Aretheresortingalgorithmsortinginntime?IfyouareaskingaboutasymptoticallyO(n)therearethealgorithslikebucketsortandradixsort.Butifyouaskingaboutexactlynoperationthethereisnone.

    9.How?Because,theprimeoperationforsortingiscomparisonandweneedatleastO(nlogn)comparison.

    10.Proveit.Iwasabouttostanduptoexplainonboard,whiledoingsoIsaidwecanproveitbyusingthedecisiontree.Theystoppedmeandaskednextquestion.

    11.Areyoucomfortablewithanyothersubject?Yes,TOC.

    12.IwillaskyouonlysinglequestionIssetofwellformnoisregular?(Wellformnomeans1,000propernowrittenwith,).Thiswasnighmareforme.Iwasblank.Theysaidmethatyoucanuseblackboard.Itriedbutwasnotgettingnehow.ThenIsaidsomeweiredthingthatitsnotregularwecanproveitbypumpinglemma.ThentheyexplainedmethatIamunabletouselemmaproperlyandthisisregular.Iwasdisappointed.

    Wecanproveitbyformingregularexpressionforitas:

    (19)^?.((09.09),*(09.09.09)?)

    Iwasnotawareof?whichmeans0/1instance.

    Iwasinnotsureaboutclearinginterviewbutgoodmarksinwrittenwereincreasingmyconfidence.

    IITB(RA)

    Nowmyeticketgetcancelwithlaststatusaswaiting4.ThankfullytherewassmespecialtrainboardedingeneralboggyanditwasemptycamesleepinginittoMumbai.On20thmorningtherewaswrittenofRA.Abittoughandsubjective,AftertestwewentforLunchinmidwaysomebodysaidIITKresultsareout.IcheckedIwasin.ThenIattendedtheRAinterviewinWebapplicationproject.1.Atablecontainsyearandcoursesinthatyearalongwithotherdetails.WritequerytoprintyearfromwhichcourseCS206wasoffered..

    Selectmin(year)fromTable

  • wherecourse=CS206.2.Howcanyouuseminfunctionwithoutusinggroupby?Iwasexpectingthisquestion.Isaid,Ifyoudonotapplythegroupbyclauseitwillmakeasinglegroupofallrowswhicharefilteredoutafterwhereclause.

    3.TheaskaboutmyJobexperience.Answered.

    4.AskaboutS/Wscalability.Isitgoodtohavesingleserverwithmanyprocessorsortohavedifferentservers?

    Itstreadoff.Ifyouhavesingleserverwithmanyprocessoritwouldbefasterbutthenavaibilitywouldbelow.Andifyouhavemultipleserversthenavaibilitywouldbemore.Buttheninternalcommunicationandroutingtherequesttoparticularserverwouldbeoverhead.Soweprefermultipleserverincaseofhightraffic.

    5.FewmorequestionaboutJSPandall.Ianswered

    IwasselectedinIITB(RA)

    BARC.

    Iwaschillandwasoutoftension,

    1.Explainyourproject.

    Didwell.2.AskedmetowritesomequerybasedonDBofmyproject.Didit.3.WhatisWebservices?Howitworks.Webservicesareusedtolettwodifferentapplicationtocommunicateirrespectiveofthereplatforms.XML/SOAPareusedforthesame..4.WhatareACIDproperty?Explainedwiththeexamples.5.Listyourfavsubjects.OS,DB,TOC,Descrete,DS6.Withwhichlanguagesyourcomfortable?C,C++,Java

    7.Writeprogramtochecknoof1sinbinaryrepresentationofintegerwhichuseri/pWithfewhintsfromtheresideIwasabletowriteitthewaytheywanted.main()

  • {inta,count=0,t=1couta;

    For(inti=0;i

  • *(base+size)=temp;

    Reverse(base+1,size1)

    }

    }

    9.Whatisprincipleofoptimality

    thereare2optimalityprinciples:1.Temporal:datawhichisreferredislikelytobereferredagaininnearfuture,soitsgoodtokeepitincache.

    2.Spatial:Addresslocationneartheaddresseslocationbeingaccessedarelikelytobeaccessedinnearfuturesoitsgoodtokeepblockofdataratherthansingledataelement.

    10.Howpagesharinghappens?Therearedifferentcontrolbitsinpagetableentrieslikehardlockwhichmeansrespectivepageisneverswappedoutusedforkernelpages.Similarlythereferencecountismaintainedforthepagesindicatingthenoofprocessescurrentlyreferencingthepage.Sothiscountisusedinpagereplacementalgoandpageswithmorecountarenotswapped.

    11.Whatareothercontrolfieldinpagetable.1.Valid/invalid:Thisindicatewhetherthepagetableentryisvalidorinvalid.Ifpagewithvalid/invalidbitsetisreferredthenpagefaultoccure.2.Dirtybit:Ifpageismodifiedthendirtybitissetindicatingthatpageneedstobewrittenback.

    12.Explaintheprocessofpagefault.Whenapagewithvalid/invalidbitsetisaccessedOStrapisgenerated.Itcheckswhetheritssegmentationfaultoritsgenericpagefault.Ifitssegmentationfault,processisswappedout.IfitsgenericpagefaultthenOSwillcheckforemptypageinmainmemoryandloadtheframeintothepageandthenupdatethepagetableandrestarttheinstruction.

    FewmorequestionsonOSconceptsandactivationrecordsanditwasover.

    Iwasaskedtowaitandin5minute1ofpanelmembertakemeinsidewheretheygivemethewhiteslip.