cracking the coding interview n.
Skip this Video
Loading SlideShow in 5 Seconds..
Cracking the Coding Interview PowerPoint Presentation
Download Presentation
Cracking the Coding Interview

Loading in 2 Seconds...

play fullscreen
1 / 48

Cracking the Coding Interview - PowerPoint PPT Presentation

  • Uploaded on

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

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Cracking the Coding Interview' - nansen

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cracking the coding interview

Cracking the Coding Interview

Advice and Strategies for Software Engineering and PM Interviews

Gayle Laakmann McDowell

Founder / CEO,

Author of The Google Resume and Cracking the Coding Interview

McDowell | | Palantir

Oct 2012

my background
My Background
  • Software Engineer @ Google, Microsoft & Apple
    • 3 Years on Google Hiring Committee
    • Interviewed 150+ candidates
  • Founder of
  • Author
    • Cracking the Coding Interview
    • The Google Resume

McDowell |

slides posted online
Slides Posted Online

posted at:

Click “Speaking Engagements”

McDowell |

interview process
Interview Process

McDowell |

big company evaluation devs
Big Company Evaluation (Devs)

Testing aptitude, not knowledge

McDowell |

start ups devs
Start-Ups (Devs)
  • “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?


it varies!

McDowell |

pms microsoft apms google
PMs (Microsoft) & APMs (Google)
  • Communication Skills
  • User-Focused Thinking
  • Passion for Technology
  • Analytical Skills
  • Technical Skills (position dependent)

McDowell |

how you are judged
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 |

resumes application process
Resumes & Application Process

McDowell |

how to get an interview
How to Get an Interview
  • Build something!
  • Make a kick-ass resume

Got a weekend free?

It’s really not that hard.

McDowell |

how we review resumes
How We Review Resumes
  • Pull resume out of giant stack
  • Spot-check: company names, positions, projects, schools.
  • Skim bullets for coding / impact

“Glanced at,” not read.

15 – 30 seconds



  • Go to next resume & whine about how many more you have left.

McDowell |

how cs resume should look
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.”

behavioral questions
Behavioral Questions

McDowell |

goals of your answer
Goals of Your Answer
  • Answer the question.
  • Deliver a goodanswer.
  • Communicate well.
    • Nugget First
    • S.A.R.: Situation, Action, Result

McDowell |

preparing for behavioral qs
Preparing for Behavioral Qs
  • Create Preparation Grid for Projects

+ Behavioral Grid [for PM & less tech. roles]

McDowell |

technical skills interview prep
Technical SkillsInterview Prep

McDowell |

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

McDowell |

data structures
Data Structures
  • How to implement
  • When to use (pros / cons)

McDowell |

  • Implementation
  • Space vs. Time Complexity

McDowell |

  • Not just a concept – know how to code!

McDowell |

types of serious questions
Types of “Serious” Questions
  • Product Design Questions
  • Estimation Questions
  • Software Engineering Questions
    • Coding & Algorithms
    • Object Oriented Design
    • Scalability

McDowell |

product design questions
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?

product design questions why
Product Design Questions: Why?
  • Communication & Structured Thinking
  • Ability to understand the user
  • Creativity
  • Business instincts / skills
product design qs approach
Product Design Qs: Approach
  • Ask questions to resolve ambiguity
  • Understand the user
  • Structure the problem
  • Solve piece by piece
estimation questions
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?

estimation qs why
Estimation Qs: Why?
  • Problem Solving
  • Basic Quantitative Skills
estimation qs how to approach
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?
technical questions
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.

If you’ve heard a question before, admit it.

McDowell |

what does a good coder do
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 |

types of interview questions
Types of Interview Questions

“Design a Parking Lot”

“Reverse a Linked List”

“Design a

Web Crawler”

McDowell |

types of interview questions1
Types of Interview Questions

McDowell |

algorithm qs pattern matching
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 |

algorithm qs simplify generalize
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 |

algorithm qs base case build
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 |

algorithm qs data structure brainstorm
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 |

how to solve algorithm questions
How To Solve Algorithm Questions

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.

McDowell |

object oriented design
Object Oriented Design

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?

McDowell |

object oriented design1
Object Oriented Design

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 Table by a Host…

How would you design the data structures and objects for a restaurant?

McDowell |

system design
System Design

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.

McDowell |

system design1
System Design

Given millions of documents, find all documents which contain a list of words.

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?

McDowell |

whew all done
Whew! All Done!

<Gulp> This is a lot of stuff. Do I need to get everything right?

McDowell |


Evaluation is RELATIVE,

not absolute.

<Gulp> This is a lot of stuff. Do I need to get everything right?

It’s not about how quickly you solved the problem…


… it’s about how quickly you solved it relative to other candidates.

McDowell |



Interviews are supposed to be hard!

Everyone makes mistakes.


McDowell |

final thoughts
Final Thoughts

McDowell |

after your interview
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 |

other resources
Other Resources
  • Interview Videos
  • iPhone App
  • Resume Review
  • Mock Interviews

Sold Today

Signed! {ask to add your name too}

5 stars!





  • Or, follow me online at…

McDowell |