Gayle McDowell: Cracking the coding interview

zukun 12,009 views 45 slides Aug 10, 2012
Slide 1
Slide 1 of 45
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45

About This Presentation

Talk video in youtube:
http://www.youtube.com/watch?v=rEJzOhC5ZtQ


Slide Content

Cracking the Coding Interview Advice and Strategies for Software Engineering Interviews McDowell | NIT Trichy | Feb 2012 CareerCup.com Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview

My Background Software Engineer @ GOOG, MS & Apple 3 Years on Google Hiring Committee Interviewed 150+ candidates Founder of CareerCup.com Author Cracking the Coding Interview The Google Resume McDowell | CareerCup.com

Slides Posted Online posted at: www.technologywoman.com Click “Speaking Engagements” McDowell | CareerCup.com

McDowell | CareerCup.com

Interview Process McDowell | CareerCup.com

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

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

Resumes & Application Process McDowell | CareerCup.com

Indians are at a disadvantage Far away Fewer recruiting opportunities Unfamiliar Recruiters may not understand your school, GPA, etc Language barrier / Cultural differences Accents, grammar, accidental sexism Different / less experience More emphasis in US on projects

So what to do? Get equivalent experience Translate GPA & other items Use good grammar & punctuation On resumes, cover letters, etc No abbreviations, no sloppiness Be careful about your assumptions Sexism is not acceptable in the U.S. Ever .

Cheat Sheet for Indians (Grammar / Writing) Space after comma & period. Never before. WRONG: “Hello .I am Gayle .” RIGHT: “Hello. I am Gayle.” Questions need a question mark WRONG: “Do you have one.” RIGHT: “Do you have one?” No abbreviations WRONG: “Ny1 dr ?” RIGHT: “Is anyone there?” Commands are rude (use a question) WRONG: “Send it to me.” RIGHT: “Would you mind sending it to me?”

Cheat Sheet for Indians (Gender / Sexism) Mr. LastName / Ms. LastName WRONG: Ms. Gayle RIGHT: Ms. McDowell But “Dear Gayle” is perfectly okay in U.S. “Guy” / “Guys” is not unisex* in the U.S. WRONG: “I need to hire a really smart CS guy.” * Except: “you guys” and “hey guys ” Don’t assume that people are male / female (Just don’t use Mr. / Ms. in emails!) It is EXTREMELY offensive to comment on someone’s looks But a great way to get fired / rejected

Cheat Sheet for Indians (Getting Experience) Build something! Make a kick-ass resume McDowell | CareerCup.com Don’t waste your summers! It’s really not that hard.

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

How CS Resume Should Look (U.S.) Short (1 – 2 line bullets) 3 – 4 Projects Courses & independent Finished or unfinished List of Technical Skills Short! Cut the “fluff.” GPA - Translated We don’t understand “first class” One Page Only! Unless > 10 years exp. A Real Resume Format with organized columns Focus on Accomplishments not responsibilities Observe: No Objective! Objectives / summaries are almost always useless.

Behavioral Questions McDowell | CareerCup.com

Communication Tips Goals: Answer the question. Deliver a *good* answer. Communicate well. Strategies: Nugget First S.A.R.: Situation, Action, Result McDowell | CareerCup.com

Preparing for Behavioral Qs Create Preparation Grid for Projects McDowell | CareerCup.com OS Project Amazon Intern. Enjoyed Hated Most Challenging Hardest Bug + Behavioral Grid [for PM & less tech. roles ]

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

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

Technical Skills Interview Prep McDowell | CareerCup.com

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

Data Structures How to implement When to use (pros / cons) McDowell | CareerCup.com Linked Lists Stacks Queues Trees Tries Graphs Vectors Heaps Hashtables

Algorithms Implementation Space vs. Time Complexity McDowell | CareerCup.com Quick Sort Merge Sort Tree Insert / Find Binary Search Breadth-First Search Depth-First Search

Concepts Not just a concept – know how to code! McDowell | CareerCup.com Threading System Design & Scalability Memory Management Recursion Probability + Combinatorics Bit Manipulation

Technical Skills Mastering the Interview McDowell | CareerCup.com

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 And make CAREFUL fixes. McDowell | CareerCup.com

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

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

Types of Interview Questions McDowell | CareerCup.com

Algorithm Qs: Pattern Matching McDowell | CareerCup.com 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.

Algorithm Qs: Simplify & Generalize McDowell | CareerCup.com 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.

Algorithm Qs: Base Case & Build McDowell | CareerCup.com 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.

Algorithm Qs: Data Structure Brainstorm McDowell | CareerCup.com 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.

How To Solve Algorithm Questions McDowell | CareerCup.com Compare to similar problems. Solve first for a simplified / tweaked problem. Solve for n = 1, and build solution for n = 2. Try to apply data structure to solve problem.

Object Oriented Design McDowell | CareerCup.com Handle Ambiguity What about the question is ambiguous? Design the Core Objects What are the main objects in the system ? Analyze Relationships How are the objects related to each other ? Investigate Actions What are the main operations?

Object Oriented Design McDowell | CareerCup.com Handle Ambiguity Is it a single restaurant, or part of a chain? Design the Core Objects Guest, Party, Table, Server, Host, … Analyze Relationships Server and Host are both Employees … Investigate Actions A Party is seated at a T able by a Host … How would you design the data structures and objects for a restaurant ?

System Design McDowell | CareerCup.com Handle Ambiguity What about the question is ambiguous? Make Believe Pretend there wasn’t so much data & solve Get Real Go back to the real problem. What breaks? Solve Problems Solve the issues you just found.

System Design McDowell | CareerCup.com Handle Ambiguity Do the words need to be in a specific order? Make Believe Assume everything can fit on one machine. Get Real Must split up data across machines. Solve Problems Divide hash table by file or by keyword? Given millions of documents, find all documents which contain a list of words.

Whew! All Done! McDowell | CareerCup.com <Gulp> This is a lot of stuff. Do I need to get everything right?

<Gulp> This is a lot of stuff. Do I need to get everything right? </Gulp> McDowell | CareerCup.com Evaluation is RELATIVE , not absolute. … it’s about how quickly you solved it relative to other candidates. It’s not about how quickly you solved the problem…

So RELAX! Interviews are supposed to be hard! Everyone makes mistakes. Everyone! McDowell | CareerCup.com

Final Thoughts McDowell | CareerCup.com

After Your Interview Follow-up with your recruiter No response != rejection You have no idea how well/poorly you did. Seriously. I know you think you do. But you don’t. Lots of randomness. So if you fail, get up and try again. McDowell | CareerCup.com

Other Resources Sold Today Signed (just ask!) McDowell | CareerCup.com CareerCup.com Interview Videos iPhone App Resume Review Mock Interviews today Rs . 400 5 stars! Or, stalk me online at… t witter.com/ gayle facebook.com/ gayle technologywoman .com gayle @careercup.com
Tags