Cracking the coding interview u penn - sept 30 2010


Published on

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • What you want to know:How much time do you spend coding per day? In meetings?How does code get shipped?Insightful QuestionsI noticed that Google Talk uses the XMPP standard, and …Passion QuestionsI love learning about scalable systems. What are opportunities at Google?
  • Hashtables – super important!!!
  • Bit manipulation – super important!Recursion: how does recursion impact space and time?Practice converting from iterative into recursion
  • Cracking the coding interview u penn - sept 30 2010

    1. 1. Cracking the Technical Interview<br />Cracking the Coding Interview<br />Gayle Laakmann<br />Founder / CEO,<br />
    2. 2. My Background<br />Penn BSE / MSE ‘05 in CS<br />Ex-Engineer at Google, Microsoft and Apple<br /> + Offers from Amazon, IBM and others<br />3 Years on Google Hiring Committee<br />Interviewed 150+ candidates<br />
    3. 3. CareerCup<br />Founded 2005<br />Largest source for technical interview questions (3000+ FREE questions)<br />Services:<br />Book (Cracking the Coding Interview)<br />Video of interview<br />Resume review<br />Mock interviews<br />
    4. 4.
    5. 5. How are interviews structured?<br />How are you evaluated?<br />Process<br />
    6. 6. Technical Interview Process<br />Initial Screen (Phone / Campus)<br />4 - 5 on site interviews<br />10 min General<br />40 min Technical<br />10 min Closing<br />Sometimes “blind” interview<br />
    7. 7. Big Company Evaluation<br />Experience<br />Personality<br />and…<br />No Red Flags<br />
    8. 8. What are red flags?<br />Arrogance<br />Communication Issues<br />Arguing (too much)<br />Dishonesty<br />
    9. 9. Smaller Companies<br />Tend to look for broader skills<br />Care more about experience / personality<br />Might ask to see “portfolio”<br />but…<br />It varies!<br />
    10. 10. What do companies look for?<br />Applying<br />
    11. 11. What can you do?<br />Get project experience!<br />Course work<br />Open source<br />Independent studies<br />Weiss Tech House<br />Part-time job<br />Start a business!<br />Know C++ or Java well<br />Good grades are nice – but not enough!<br />Skills <br />Passion<br />Work Ethic<br />Creativity<br />Initiative<br />
    12. 12. 3 Hallmarks of a Great Resume:<br />Short and sweet<br />One page – no more!<br />Short bullets (1 – 2 lines). No paragraphs!<br />Accomplishments, not responsibilities<br />Quantify!<br />Clean, Professional and Well Structured<br />Projects section<br />No spelling / grammar mistakes<br />Nice resume format (don’t format via spaces!)<br />
    13. 13. Why do you want to work here? <br />What was your favorite project?<br />Interview prep – SOFT SKILLS<br />
    14. 14. Research the company / team<br />Prepare questions (around 10)<br />Know:<br />What they do (duh)<br />Specific products – what is good / bad<br />What their hardest problems are<br />Why you want to work there<br />What value you can add (esp. if non-coding role)<br />Soft Prep – The Company / Team<br />
    15. 15. Create Preparation Grid for Projects<br />+ (maybe) Behavioral Grid<br />Soft Prep – Yourself<br />
    16. 16. Strengths vs. Weaknesses<br />Mediocre answer: “it was hard because I had to learn new languages / technologies”<br />Not just answering Q’s – show who you are!<br />Soft Prep – Yourself<br />
    17. 17. How do you prep for coding questions?<br />What do you prep?<br />Interview prep – Tech SKILLS<br />
    18. 18. Study the basics: <br />CLR algorithms book is great – but too complex for interviews<br />Write code on paper<br />Put away the compiler<br />Look up sample interview questions<br />Focus on the topics you’re struggling with<br />How to study<br />
    19. 19. How to implement<br />When to use (pros / cons)<br />Data Structures<br />
    20. 20. Implementation<br />Space vs Time Complexity<br />Algorithms<br />
    21. 21. Concepts<br />Not just a concept – know how to code!<br />
    22. 22. Don’t practice on computer!<br />
    23. 23. What do companies look for?<br />Interview – soft SKILLS<br />
    24. 24. Communication Tips<br />Be specific – not arrogant<br /> “Yeah, I did all the hard work for the team”<br /> “I implemented the file system, which was <br /> considered one of the hardest components.”<br />Be concise and structured<br />Nugget First<br />S.A.R.: Situation, Action, Result<br />
    25. 25. Lead with your “thesis” / nugget<br />Nuggets grab the listener’s attention, and tell them where you’re going<br />Q: What accomplishment are you most proud of?<br />A: The time that I convinced the engineering school to switch to paperless time logs.<br />Structure 1: Nugget First<br />
    26. 26. ituation<br />ction<br />esult<br />Structure 2: S.A.R.<br />S<br />What did you do? <br />What should I care?<br />A<br />R<br />
    27. 27. How do you tackle hard tech questions?<br />Interview – tech SKILLS<br />
    28. 28. Mastering the Technical Questions<br />Ask Questions!<br />Questions are more ambiguous than they appear<br />Talk out loud<br />Show us how you think<br />Think critically<br />Does your algorithm really work? What’s the space and time complexity?<br />Code slowly and methodically<br />It’s not a race<br />Test your code<br />You’re not done until they say you’re done!<br />
    29. 29. Step 1: Ask Questions<br />What are the data types?<br />How much data?<br />What assumptions do you need?<br />Who is the user?<br />NOTE: Especially important at Microsoft.<br />
    30. 30. Step 2: Think Critically<br />What’s space / time complexity?<br />What if there’s lots of data?<br />Does your design cause other issues?<br />If there are other issues, did you make the right trade offs?<br />
    31. 31. Step 3: Talk Out Loud<br />Approach is more important than answer<br />Talking out loud:<br />Shows us how you think<br />Lets the interviewer guide you<br />Makes you not appear “stuck”<br />
    32. 32. Step 4: Pseudo Code & Code<br />Pseudo code first – but say that!<br />Use data structures generously<br />What are the right ones?<br />Define your own = shows good style<br />Don’t crowd your coding<br />Start in the upper left corner of board, not bottom<br />
    33. 33. Step 5: Testing<br />Test your code!<br />Extreme cases<br />Check for user error<br />Test general cases<br />CAREFULLY FIX MISTAKES<br />
    34. 34. RELAX!<br />Interviews are supposed to be hard!<br />Everyone makes mistakes. Everyone!<br />
    35. 35. Question Types<br />Standard Coding and Algorithms<br />“Reverse a linked list”<br />Object Oriented Design<br />“Design a parking lot”<br />Large System Design<br />“Design a program to crawl the web”<br />Trivia<br />“What does a “vtable” refer to in C++”<br />
    36. 36. Standard Coding <br />and Algorithms<br />Question Type #1<br />
    37. 37. Algorithm Generation<br />#1<br />Standard Coding <br />and Algorithms<br />OMG! I have no idea how to solve this problem!<br />
    38. 38. Algorithm Generation<br />Pattern Matching<br />What problem is this similar to?<br />Simplify / Generalize<br />What if the data was a different type?<br />Base Case & Build<br />Can you do this just for element 1? 1 and 2? …<br />Data Structure Brainstorm<br />Go through all data structures – can they help?<br />#1<br />Standard Coding <br />and Algorithms<br />
    39. 39. Algorithm Generation<br />Pattern Matching<br />Write code to reverse the order of words in a sentence.<br /> Example:<br /> input: “she ran to the store”<br /> output: “store the to ran she”<br />#1<br />Standard Coding <br />and Algorithms<br />
    40. 40. Algorithm Generation<br />Simplify / Generalize<br />Write a program to remove the duplicate characters in a string without using any additional buffers.<br />#1<br />Standard Coding <br />and Algorithms<br />
    41. 41. Algorithm Generation<br />Base Case & Build<br />Design an algorithm to print all subsets of a set (e.g., the power set)<br /> Example:<br /> input: {a, b, c}<br /> output: {{}, {a}, {b}, {c}, {a, b}, {a, c}, <br /> {b, c}, {a, b, c}}<br />#1<br />Standard Coding <br />and Algorithms<br />
    42. 42. Algorithm Generation<br />Data Structures Brainstorm<br />Design an algorithm to figure out if someone has won a game of tic-tac-toe. Make it as fast as possible.<br />#1<br />Standard Coding <br />and Algorithms<br />
    43. 43. Object Oriented Design<br />Question Type #2<br />
    44. 44. Core objects<br />what are the core objects?<br />Relationships<br />what is their relationship to each other?<br />Interactions<br />how do they interact?<br />Algorithms<br /> what are the tricky / interesting algorithms?<br />OOD Steps (C.R.I.A.)<br />#2<br />Object Oriented Design<br />
    45. 45. OOD Example<br />#2<br />Object Oriented Design<br />Design the data structures for a restaurant<br />
    46. 46. Restaurant OOD<br />#2<br />Object Oriented Design<br />1. Core Objects<br />Guest<br />Party<br />Server<br />Table<br />Meal<br />Order<br />
    47. 47. Restaurant OOD<br />#2<br />Object Oriented Design<br />2. Relationships<br />Each party has many guests. Each guest has one party. (“One to many”)<br />
    48. 48. Restaurant OOD<br />#2<br />Object Oriented Design<br />3. Interactions<br />Party enters with Guest(s). Host assigns Party to Table. <br />
    49. 49. Restaurant OOD<br />#2<br />Object Oriented Design<br />4. Algorithms<br />How do you find a free table? <br />
    50. 50. Large Scale<br />System Design<br />Question Type #3<br />
    51. 51. Large Scale Steps<br />#3<br />Large Scale <br />System Design<br />Simplify<br />Generalize<br />Generalize to more data:find & solve problems<br />Solve for simple case (less data)<br />
    52. 52. Trivia<br />Question Type #4<br />
    53. 53. Trivia<br />#4<br />Trivia<br />Hopefully you know the answer!<br />Practice more <br />Else…<br />Admit that you don’t know<br />Try to derive the answer<br />
    54. 54. (eg, things that wouldn’t fit in elsewhere)<br />FINAL THOUGHTS<br />
    55. 55. The Interview: Ending It<br />Smile, be positive<br />If you think you bombed, don’t worry<br />Follow up with your recruiters (sometimes they forget)<br />
    56. 56. The Offer<br />It’s always negotiable<br />Helps if you have competing offer<br />Don’t lie – companies know what competitors offer<br />Negotiate on multiple factors (salary, signing bonus, stock, etc)<br />Is it really what you want?<br />Money, career options, etc<br />
    57. 57. My Red Flags: People who…<br />… didn’t test their code<br />… found mistakes and would make random fixes<br />… messy code (lack of data structures / redundant code)<br />… didn’t consider the impact of their algorithms<br />… were scared to try<br />
    58. 58. Take Aways – Getting Ready<br />Get Project Experience<br />Show project experience on resume<br />S. A. R. (Situation Action Result)<br />Prepare Project / Behavioral Grids<br />
    59. 59. Technical Interview Prep<br />Things to know (data structures, algorithms, concepts)<br />Simple  Know Implementation<br />Complex  Know Concepts<br />Practice interview questions!<br />
    60. 60. At The Interview <br />Be nice<br />RELAX! Interviews are supposed to be hard<br />Approaches<br />Pattern Matching<br />Simplify / Generalize<br />Base Case & Build<br />Data Structure Brainstorm<br />
    61. 61. Other Resources<br />Book (sold today - $20)<br />Interview video<br />Mock Interviews<br />Resume Review<br />Slides posted at<br />#1 book for interviewing on Amazon!<br />PS: CareerCup is hiring a part-time dev!<br />(remember that part about needing coding experience?)<br />If you know Ruby on Rails (or even if you don’t), contact<br />