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