爱问 爱问共享资料 爱问分类
首页 >IT资料 >IT书籍 >CareerCup.Cracking.the.Technical.Interview.Ed4.…

CareerCup.Cracking.the.Technica…

上传者: hr21
790次下载 0人收藏 暂无简介 简介 2011-01-08 举报

简介:程序员面试教程,第四版!

t1SPHSBNNJOH*OUFSWJFX2VFTUJPOTBOE4PMVUJPOTt'JWF1SPWFO"QQSPBDIFTUP4PMWJOH5PVHI"MHPSJUIN2VFTUJPOTt5FO.JTUBLFT$BOEJEBUFT.BLF"OE)PXUP"WPJE5IFNt4UFQTUP1SFQBSFGPS#FIBWJPSBMBOE5FDIOJDBM2VFTUJPOTt*OUFSWJFX8BS4UPSJFT"7JFXGSPNUIF*OUFSWJFXFST4JEF(BZMF-BBLNBOOGAYLELAAKMANNFounderandCEO,CareerCup.com150programminginterviewquestionsandsolutionsPlus:tFiveprovenapproachestosolvingtoughalgorithmquestionstTenmistakescandidatesmake--andhowtoavoidthemtStepstoprepareforbehavioralandtechnicalquestionstInterviewerwarstories:aviewfromtheinterviewer’ssideFOURTHEDITIONCRACKINGTHECODINGINTERVIEWCRACKINGTHECODINGINTERVIEWCRACKINGTHECODINGINTERVIEW150ProgrammingInterviewQuestionsandSolutionsGAYLELAAKMANNFounderandCEO,CareerCup.comCareerCup,LLCSeattle,WACRACKINGTHECODINGINTERVIEW,FOURTHEDITIONCopyright2008-2010byGayleLaakmann.Allrightsreserved.PublishedbyCareerCup,LLC,Seattle,WA.Version3.21090410302210.Visitourwebsiteat:www.careercup.com.Nopartofthisbookmaybeusedorrepro-ducedinanymannerwithoutwrittenpermissionexceptinthecaseofbriefquota-tionsincriticalarticlesorreviews.Formoreinformation,contactsupport@careercup.com.PrintedinUnitedStatesofAmerica978-1-450-59320-59781450593205(ISBN13)CrackingtheCodingInterview15BCMFPG$POUFOUT'PSFXPSE4*OUSPEVDUJPO5#FIJOEUIF4DFOFT7TheMicrosoftInterview..........................................8TheAmazonInterview...........................................9TheGoogleInterview..........................................10TheAppleInterview...........................................11TheYahooInterview...........................................12*OUFSWJFX8BS4UPSJFT13#FGPSFUIF*OUFSWJFX20ResumeAdvice..............................................21BehavioralPreparation.........................................23TechnicalPreparation..........................................255IF*OUFSWJFXBOE#FZPOE28HandlingBehavioralQuestions....................................29HandlingTechnicalQuestions.....................................31FiveAlgorithmApproaches......................................34TheOfferandBeyond..........................................37TopTenMistakesCandidatesMake..................................39FrequentlyAskedQuestions......................................41*OUFSWJFX2VFTUJPOT44%BUB4USVDUVSFT46Chapter1|ArraysandStrings.....................................47Chapter2|LinkedLists.........................................49Chapter3|StacksandQueues....................................51Chapter4|TreesandGraphs.....................................53$PODFQUTBOE"MHPSJUINT56Chapter5|BitManipulation......................................57Chapter6|BrainTeasers........................................592CareerCup.com5BCMFPG$POUFOUTChapter7|ObjectOrientedDesign.................................61Chapter8|Recursion..........................................63Chapter9|SortingandSearching..................................65Chapter10|Mathematical.......................................67Chapter11|Testing...........................................69Chapter12|SystemDesignandMemoryLimits.........................71,OPXMFEHF#BTFE74Chapter13|C++.............................................75Chapter14|Java.............................................77Chapter15|Databases.........................................79Chapter16|LowLevel.........................................81Chapter17|Networking........................................83Chapter18|ThreadsandLocks....................................85"EEJUJPOBM3FWJFX1SPCMFNT88Chapter19|Moderate.........................................89Chapter20|Hard.............................................914PMVUJPOT94*OEFY301.PDL*OUFSWJFXT303"CPVUUIF"VUIPS3044CareerCup.com'PSFXPSEDearReaders,Welcometothe4theditionofCrackingtheCodingInterview.Thisvolumeupdatesthe3rdeditionwithnewcontentandrefreshedinformation.Besuretocheckoutourwebsite,www.careercup.com,toconnectwithothercandidatesandtodiscovernewresources.Forthoseofyounewtotechnicalinterviews,theprocesscanseemoverwhelming.Inter-viewersthrowquestionsatyou,expectyoutowhipupbrilliantalgorithmsonthespot,andthenaskyoutowritebeautifulcodeonawhiteboard.Luckily,everyoneelseisinthesameboat,andyou’realreadyworkinghardtoprepare.Goodjob!Asyougetreadyforyourinterviews,considerthesesuggestions:8SJUF$PEFPO1BQFSMostinterviewerswon’tgiveyouacomputerandwillinsteadexpectyoutowritecodeonawhiteboardoronpaper.Tosimulatethisenvironment,tryansweringinterviewproblemsbywritingcodeonpaper!rst,andthentypingthemintoacomputeras-is.Whiteboard/papercodingisaspecialskill,whichcanbemasteredwithconstantpractice.,OPX:PVS3FTVNFWhiletechnicalskillsareextremelyimportant,that’snoreasontoneglectyourownresume.Makesuretoprepareyourselftogiveaquicksummaryofanyprojectorjobyouwereinvolvedwith,andtodiscussthehardestandmostinterestingproblemsyouencounteredalongtheday.%POU.FNPSJ[F4PMVUJPOTWhilethisbooko$ersarepresentativesampleofinterviewquestions,therearestillthousandsofinterviewquestionsoutthere.Memorizingsolu-tionsisnotagreatuseofyourtime.Rather,usethisbooktoexploreapproachestoproblems,tolearnnewconcepts,andtopracticeyourskills.5BML0VU-PVEInterviewerswanttounderstandhowyouthinkandapproachprob-lems,sotalkoutloudwhileyou’resolvingproblems.Lettheinterviewerseehowyou’retacklingtheproblem,andtheyjustmightguideyouaswell."OESFNFNCFSJOUFSWJFXTBSFIBSEInmyyearsofinterviewingatGoogle,Isawsomeinterviewersask“easy”questionswhileothersaskharderquestions.Butyouknowwhat?Gettingtheeasyquestionsdoesn’tmakeitanyeasiertogettheo$er.Receivingano$erisnotaboutsolvingquestions"awlessly(veryfewcandidatesdo!),butrather,itisaboutansweringquestionsbetterthanothercandidates.Sodon’tstressoutwhenyougetatrickyquestion-everyoneelseprobablythoughtitwashardtoo!I'mexcitedforyouandfortheskillsyouaregoingtodevelop.Thoroughpreparationwillgiveyouawiderangeoftechnicalandcommunicationskills.Itwillbewell-worthitnomatterwherethee$orttakesyou!Studyhard,practice,andgoodluck!GayleLaakmannCrackingtheCodingInterview5*OUSPEVDUJPO4PNFUIJOHT8SPOHWewalkedoutofthehiringmeetingfrustrated,again.Oftheten“passable”candidateswereviewedthatday,nonewouldreceiveo$ers.Werewebeingtooharsh,wewondered?I,inparticular,wasdisappointed.Wehadrejectedoneofmycandidates.Aformerstudent.OnewhoIhadreferred.Hehada3.73GPAfromtheUniversityofWashington,oneofthebestcomputerscienceschoolsintheworld,andhaddoneextensiveworkonopensourceprojects.Hewasenergetic.Hewascreative.Heworkedhard.Hewassharp.Hewasatruegeek,inallthebestways.But,Ihadtoagreewiththerestofthecommittee:thedatawasn’tthere.Evenifmyemphaticrecommendationwouldswaythemtoreconsider,hewouldsurelygetrejectedinthelaterstagesofthehiringprocess.Therewerejusttoomanyred"ags.Thoughtheinterviewersgenerallybelievedthathewasquiteintelligent,hehadstruggledtodevelopgoodalgorithms.Mostsuccessfulcandidatescould"ythroughthe!rstques-tion,whichwasatwistonawellknownproblem,buthestruggledtodevelophisalgorithm.Whenhecameupwithone,hefailedtoconsidersolutionsthatoptimizedforotherscenar-ios.Finally,whenhebegancoding,he"ewthroughthecodewithaninitialsolution,butitwasriddledwithmistakesthathethenfailedtocatch.Thoughhewasn’ttheworstcandidatewe'dseenbyanymeasure,hewasfarfrommeeting“thebar.”Rejected.Whenheaskedforfeedbackoverthephoneacoupleofweekslater,Istruggledwithwhattotellhim.Besmarter?No,Iknewhewasbrilliant.Beabettercoder?No,hisskillswereon-parwithsomeofthebestI'dseen.Likemanymotivatedcandidates,hehadpreparedextensively.HehadreadK&R’sclassicCbookandhe'dreviewedCLRS'famousalgorithmstextbook.Hecoulddescribeindetailthemyriadofwaysofbalancingatree,andhecoulddothingsinCthatnosaneprogrammershouldeverwanttodo.Ihadtotellhimtheunfortunatetruth:thosebooksaren’tenough.Academicbooksprepareyouforfancyresearch,butthey’renotgoingtohelpyoumuchinaninterview.Why?I'llgiveyouahint:yourinterviewershaven’tseenRed-BlackTreessincetheywereinschooleither.Tocrackthecodinginterview,youneedtopreparewithrealinterviewquestions.Youmustpracticeonrealproblems,andlearntheirpatterns.CrackingtheCodingInterviewistheresultofmy!rst-handexperienceinterviewingattopcompanies.Itistheresultofhundredsofconversationswithcandidates.Itistheresultofthethousandsofcandidate-andinterviewer-contributedquestions.Andit’stheresultofseeingsomanyinterviewquestionsfromsomany!rms.Enclosedinthisbookare150ofthebestinterviewquestions,selectedfromthousandsofpotentialproblems.6CareerCup.com*OUSPEVDUJPO.Z"QQSPBDIThefocusofCrackingtheCodingInterviewisalgorithm,codinganddesignquestions.Why?Becausewhileyoucanandwillbeaskedbehavioralquestions,theanswerswillbeasvariedasyourresume.Likewise,whilemany!rmswillaskso-called“trivia”questions(e.g.,“Whatisavirtualfunction?”),theskillsdevelopedthroughpracticingthesequestionsarelimitedtoveryspeci!cbitsofknowledge.Thebookwillbrie"ytouchonsomeofthesequestions,toshowyouwhatthey’relike,butIhavechosentoallocatespacewherethere’smoretolearn..Z1BTTJPOTeachingismypassion.Ilovehelpingpeopleunderstandnewconcepts,andgivingthemtoolssothattheycanexcelintheirpassions.My!rstexperience“o%cially”teachingwasincollegeattheUniversityofPennsylvania,whenIbecameateachingassistantforanundergraduateComputerSciencecourseduringmysecondyear.IwentontoTAforseveralothercourses,andeventuallylaunchedmyownCScourseattheuniversityfocusedon“hands-on”skills.AsanengineeratGoogle,trainingandmentoring“Nooglers”(yes,that’sreallywhattheycallnewGoogleemployees!)weresomeofthethingsIenjoyedmost.Iwentontousemy“20%time”toteachtwoComputerSciencecoursesattheUniversityofWashington.CrackingtheCodingInterviewand$BSFFS$VQDPNre"ectmypassionforteaching.Evennow,youcanoften!ndme“hangingout”atCareerCup.com,helpinguserswhostopbyforassistance.Joinus.GayleLaakmannCrackingtheCodingInterview7#FIJOEUIF4DFOFTFormanycandidates,interviewingisabitofablackbox.Youwalkin,yougetpoundedwithquestionsfromavarietyofinterviewers,andthensomehoworotheryoureturnwithanof-fer...ornot.Haveyoueverwondered:Howdodecisionsgetmade?Doyourinterviewerstalktoeachother?Whatdoesthecompanyreallycareabout?Well,wondernomore!CareerCupsoughtoutinterviewingexpertsfrom!vetopcompanies-Microsoft,Google,Amazon,YahooandApple-toshowyouwhatreallyhappens“behindthescenes.”Theseexpertswillwalkusthroughatypicalinterviewdayanddescribewhat’stakingplaceoutsideoftheinterviewingroom,andwhathappensafteryouleave.Ourinterviewingexpertsalsotolduswhat’sdi$erentabouttheirinterviewprocess.Frombarraisers(Amazon)toHiringCommittees(Google),eachcompanyhasitsownquirks.Knowingtheseidiosyncrasieswillhelpyoutoreactbettertoasuper-toughinterviewer,ortoavoidbeingintimidatedwhentwointerviewersshowupatthedoor(Apple!).Inaddition,ourspecialistso$eredinsightastowhattheircompanystressesintheirinter-views.Whilealmostallsoftware!rmscareaboutcodingandalgorithms,somecompaniesfocusmorethanothersonspeci!caspectsoftheinterview.Whetherthisisbecauseofthecompany’stechnologyoritshistory,nowyou'llknowwhatandhowtoprepare.So,joinusaswetakeyoubehindthescenesatMicrosoft,Google,Amazon,YahooandAp-ple...8CareerCup.com#FIJOEUIF4DFOFT]TheMicrosoftInterviewMicrosoftwantssmartpeople.Geeks.Peoplewhoarepassionateabouttechnology.Youprobablywon’tbetestedontheinsandoutsofC++APIs,butyouwillbeexpectedtowritecodeontheboard.Inatypicalinterview,you'llshowupatMicrosoftatsometimeinthemorningand!lloutinitialpaperwork.You'llhaveashortinterviewwitharecruiterwhereheorshewillgiveyouasamplequestion.Yourrecruiterisusuallytheretoprepyou,andnottogrillyouontechni-calquestions.Benicetoyourrecruiter.Yourrecruitercanbeyourbiggestadvocate,evenpushingtore-interviewyouifyoustumbledonyour!rstinterview.Theycan!ghtforyoutobehired-ornot!Duringtheday,you'lldofouror!veinterviews,oftenwithtwodi$erentteams.Unlikemanycompanies,whereyoumeetyourinterviewersinaconferenceroom,you'llmeetwithyourMicrosoftinterviewersintheiro%ce.Thisisagreattimetolookaroundandgetafeelfortheteamculture.Dependingontheteam,interviewersmayormaynotsharetheirfeedbackonyouwiththerestoftheinterviewloop.Whenyoucompleteyourinterviewswithateam,youmightspeakwithahiringmanager.Ifso,that’sagreatsign!Itlikelymeansthatyoupassedtheinterviewswithaparticularteam.It’snowdowntothehiringmanager’sdecision.Youmightgetadecisionthatday,oritmightbeaweek.AfteroneweekofnowordfromHR,sendthemafriendlyemailaskingforastatusupdate.DenitelyPrepare:“WhydoyouwanttoworkforMicrosoft?”Inthisquestion,Microsoftwantstoseethatyou’repassionateabouttechnology.Agreatanswermightbe,“I’vebeenusingMicrosoftsoftwareaslongasIcanre-member,andI'mreallyimpressedathowMicrosoftmanagestocreateaproductthatisuniversallyexcellent.Forexample,I’vebeenusingVisualStudiorecentlytolearngameprogramming,andit’sAPIsareexcellent.”Notehowthisshowsapassionfortechnology!What’sUnique:You'llonlyreachthehiringmanagerifyou’vedonewell,butifyoudo,that’sagreatsign!CrackingtheCodingInterview9#FIJOEUIF4DFOFT]TheAmazonInterviewAmazon’srecruitingprocessusuallybeginswithoneortwophonescreensinwhichyouin-terviewwithaspeci!cteam.Theengineerwhointerviewsyouwillusuallyaskyoutowritesimplecodeandreaditaloudonthephone.Theywillaskabroadsetofquestionstoexplorewhatareasoftechnologyyou’refamiliarwith.Next,you"ytoSeattleforfouror!veinterviewswithoneortwoteamswhichhaveselectedyoubasedonyourresumeandphoneinterviews.Youwillhavetocodeonawhiteboard,andsomeinterviewerswillstressotherskills.Interviewersareeachassignedaspeci!careatoprobeandmayseemverydi$

用户评论

0/200
暂无评论

该用户的其它资料

关闭

请选择举报的类型

关闭

提示

提交成功!

感谢您对爱问共享资料的支持,我们将尽快核实并处理您的举报信息。

关闭

提示

提交失败!

您的举报信息提交失败,请重试!

关闭

提示

重复举报!

亲爱的用户!感觉您对爱问共享资料的支持,请勿重复举报噢!

全屏 缩小 放大
收藏
资料评价:

/ 310
所需积分:1 立即下载
返回
顶部
举报
资料
关闭

温馨提示

感谢您对爱问共享资料的支持,精彩活动将尽快为您呈现,敬请期待!