1 / 60

Cracking the Coding Interview

Cracking the Coding Interview. Advice and Strategies for Software Engineering Interviews. Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview. My Background. Software Engineer @ Google, Microsoft & Apple

arnie
Download Presentation

Cracking the Coding Interview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cracking the Coding Interview Advice and Strategies for Software Engineering Interviews Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview McDowell | CareerCup.com July 2013

  2. My Background • Software Engineer @ Google, Microsoft & Apple • 3 Years on Google Hiring Committee • Interviewed 150+ candidates • Founder of CareerCup.com • Author • Cracking the Coding Interview • The Google Resume • Interview coach for acquisitions & acquihires McDowell | CareerCup.com

  3. What to Expect • 5 - 10 min – Qs about resume • 40 min – technical Qs • Coding and algorithms • 5 – 10 min – let you ask Qs, general wrap up, etc McDowell | CareerCup.com

  4. Big Company Evaluation (Devs) Testing aptitude, not knowledge McDowell | CareerCup.com

  5. Start-Ups • Coding + Intelligence • “Hit the ground running” • Do you know “their” technologies? • Entrepreneurial • Have you started things? • How much direction do you need? • Personality • Will you fit with the team? but… it varies! McDowell | CareerCup.com

  6. PM Roles • Communication Skills • User-Focused Thinking • Passion for Technology • Analytical Skills • Technical Skills (position dependent) McDowell | CareerCup.com

  7. How You Are Judged How did you do RELATIVE to other candidates on the SAME question? It’s not about how quickly you solved the problem… … it’s about how quickly you solved it relative to other candidates. McDowell | CareerCup.com

  8. Resumes & Application Process McDowell | CareerCup.com

  9. How to Get an Interview • Your “Pedigree” • Education • Work Experience • Projects • Github / Online Profile • Make a kick-ass resume McDowell | CareerCup.com

  10. How We Review Resumes • Pull resume out of giant stack • Spot-check: company names, positions, projects, schools. • Skim bullets to see if you’ve written real code. “Glanced at,” not read. 15 – 30 seconds Reject Interview • Go to next resume & whine about how many more you have left. McDowell | CareerCup.com

  11. How CS Resume Should Look Observe: No Objective! Objectives / summaries are almost always useless. One Page Only! Unless > 10 years exp. A Real Resume Format with organized columns Short (1 – 2 line bullets) Focus on Accomplishments not responsibilities GPAif at least 3.0 max (in-major, overall) 3 – 4 Projects Courses & independent Finished or unfinished List of Technical Skills Short! Cut the “fluff.”

  12. Soft Questions McDowell | CareerCup.com

  13. Goals of Your Answer • Answer the question. • Deliver a goodanswer. • Communicate well. • Nugget First • S.A.R.: Situation, Action, Result McDowell | CareerCup.com

  14. Preparing for Behavioral Qs • Create Preparation Grid for Projects + Behavioral Grid [for PM & less tech. roles] McDowell | CareerCup.com

  15. Structure 1: Nugget First • Lead with your “thesis” / nugget • Grabs the listener’s attention • Gives them context for where you’re going. Q: What accomplishment are you most proud of? A: I’m most proud of the way I re-architected the … McDowell | CareerCup.com

  16. Structure 2: S.A.R. ituation ction esult S What was the issue? A What did you do about it? R What was the impact? McDowell | CareerCup.com

  17. Good Questions for Interviewer • Qs you want to get answered • How decisions get made • Interaction betwdevs, PMs, testers • Qs that show interest / passion • What’s the architecture like? • Qs that show knowledge / aptitude • How did you solve problem with ___? Don’t worry too much about this stuff McDowell | CareerCup.com

  18. Technical SkillsInterview Prep McDowell | CareerCup.com

  19. How to study • Study the basics • Complex algorithms generally unnecessary. • Practice solving questions • Don’t memorize! • See: CtCI & CareerCup.com • Push yourself! • Write code on paper McDowell | CareerCup.com

  20. Data Structures • How to implement • When to use (pros / cons) McDowell | CareerCup.com

  21. Algorithms • Implementation • Space vs. Time Complexity McDowell | CareerCup.com

  22. Concepts • Not just a concept – know how to code! McDowell | CareerCup.com

  23. How to Learn CS Fundamentals? • Necessary for “elite” tech companies • Not necessarily otherwise (check interview questions) • MIT Open Courseware • Freshman / sophomore level DS & Algo courses • Books • CLRS (Algorithms) • Online tutorials • Practice implementing and using McDowell | CareerCup.com

  24. Technical SkillsMastering the Interview McDowell | CareerCup.com

  25. Types of “Serious” Questions • Product Design Questions • Estimation Questions • Software Engineering Questions • Coding & Algorithms • Object Oriented Design • Scalability • Factual / Trivia / Language-Based McDowell | CareerCup.com

  26. Product Design Questions How would you design an calculator for the blind? Design an elevator for a building. Pick a Google product. How would you improve it?

  27. Product Design Questions: Why? • Communication & Structured Thinking • Ability to understand the user • Creativity • Business instincts / skills

  28. Product Design Qs: Approach • Ask questions to resolve ambiguity • Understand the user • Structure the problem • Solve piece by piece

  29. Estimation Questions How many tennis balls can fit in an SUV? How much money does Gmail make from ads every year? How much do New Yorkers spend on electricity each year?

  30. Estimation Qs: Why? • Problem Solving • Basic Quantitative Skills

  31. Estimation Qs: How to Approach • Ask questions to resolve ambiguity • Don’t make assumptions (yet) • Outline / Structure Your Approach • Break down the components • Assume numbers when necessary • State assumptions explicitly • Round numbers to make your math easier • Sanity Check • Do your numbers make sense?

  32. CS Questions • Knowledge Questions • Coding & Algorithms • Object Oriented Design • Scalability McDowell | CareerCup.com

  33. Knowledge & Trivia Questions • Not key focus at “elite” tech companies. • If asked, tends to focus more on DS knowledge than language knowledge • If you don’t know, try to deduce the answer • How would language designer do it? etc McDowell | CareerCup.com

  34. Coding & Algorithm Questions • Ask Questions! • Questions are more ambiguous than they appear • Talk out loud • Show us how you think • Think critically • Does your algorithm really work? What’s the space and time complexity? • Code slowly and methodically • It’s not a race • Test your code • And make CAREFUL fixes. If you’ve heard a question before, admit it. McDowell | CareerCup.com

  35. What does a “good coder” do? • Be methodical. Don’t try to rush. • Reasonably Bug Free • Thorough testing (and careful fixing) • Check for error conditions • Clean coding • Use other functions • Good use of data structures (define own if useful) • Concise and readable McDowell | CareerCup.com

  36. Whiteboard Coding Tips • Code in the FAR top left corner • Write small & straight • Pseudocode if you’d like • Use arrows to insert new code snippets • Erasing wastes time • Use “good” variable names, then abbreviate • “Breadth-First” Coding McDowell | CareerCup.com

  37. “Breath-First” Coding • Divide problems into sub-components • Modularize & Structure • Ex: Ransom Note • Write as one big function? • OR… modularize! McDowell | CareerCup.com

  38. Ex: Ransom Note: “Depth-First” Coding McDowell | CareerCup.com

  39. Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com

  40. Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com

  41. Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com

  42. Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com

  43. “Breath-First” Coding • “Depth-First” Coding (One big function) • Messy • Time consuming • Poor coding style • “Breadth-First” Coding (Modularized) • “Finishes” algorithm immediately • Often allows you to skip details • Easier to test & fix issues • Demonstrates good coding style • Keeps YOU organized McDowell | CareerCup.com

  44. Common Mistakes • Ignoring information given • Not using examples • To design algorithms • While writing code • “Pushing through” code when confused • Incoherent thoughts -> incoherent code • Diving into code too quickly • The details: • Off-by-one, < vs <=, division (and any math) McDowell | CareerCup.com

  45. Types of Interview Questions “Design a Parking Lot” “Reverse a Linked List” “Design a Web Crawler” McDowell | CareerCup.com

  46. Types of Interview Questions McDowell | CareerCup.com

  47. Algorithm Qs: Pattern Matching Q: Write code to reverse the order of words in a sentence. “dogs are cute” “cute are dogs” Similar to: reverse characters in a string. “dogs are cute” “etuc era sgod” A: Reverse full string, then reverse each word. McDowell | CareerCup.com

  48. Algorithm Qs: Simplify & Generalize Q: Design algorithm to figure out if you can build a ransom note (array of strings) from a magazine (array of strings). Simplify: what if we used characters instead of strings?  Build array of character frequencies. Generalize: how we can extend answer to words? A: Build hashtable from word to frequency. McDowell | CareerCup.com

  49. Algorithm Qs: Base Case & Build Q: Design algorithm to print subsets of set. {a, b, c}  {}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} S({}) {} S({a}) {}, {a} S({a, b}) {}, {a}, {b}, {a, b} S({a, b, c})  ? A: Build S(n) by cloning S(n-1) and adding n to the cloned sets. McDowell | CareerCup.com

  50. Algorithm Qs: Data Structure Brainstorm Q: There are 10^10 possible phone #s. Explain how you could efficiently implement assignSpecificNum(num)and assignAnyAvailableNum(). Array (sorted)? Too slow to remove num. Linked list? Too slow to find specific num. Hash table? Can’t iterate through free nums. Tree? Ah-ha! A: Store free #s in BST. Remove when taken. McDowell | CareerCup.com

More Related