49
CAREERCUP Cracking the Technical Interview Gayle Laakmann Founder / CEO, CareerCup.com Cracking the Coding Interview

Cracking the coding interview columbia - march 23 2011

Embed Size (px)

DESCRIPTION

Cracking the Coding Interview, Columbia University, March 23, 2011

Citation preview

Page 1: Cracking the coding interview   columbia - march 23 2011

CAREERCUP

Cracking the Technical InterviewGayle Laakmann

Founder / CEO, CareerCup.com

Cracking the Coding Interview

Page 2: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

My Background• CS undergrad and masters degree from UPenn• Ex-Engineer at Google, Microsoft and Apple– plus Offers from Amazon, IBM and others– 3 Years on Google Hiring Committee– Interviewed 150+ candidates

• Founder of CareerCup.com• Author of Cracking the Coding Interview and

The Google Resume

Page 3: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Process

Evaluation

Structure

Applying

Experience

Resume

Soft Skills

Preparation

Interview

Tech Skills

Preparation

Interview

Page 4: Cracking the coding interview   columbia - march 23 2011

CAREERCUP

How are interviews structured?How are you evaluated?

PROCESS

Page 5: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Technical Interview Process• Initial Screen (Phone / Campus)• 4 - 5 on site interviews– 10 min General– 40 min Technical– 10 min Closing

Page 6: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Big Company Evaluation

SmartCoding

ExperiencePersonality

Testing aptitude, not

knowledge

Page 7: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

What are red flags?• Arrogance• Communication Issues• Arguing (too much)• Dishonesty

and…No Red

Flags

Page 8: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Smaller Companies• Tend to look for broader skills• Care more about experience / personality• Might ask to see “portfolio”

but…It varies!

Page 9: Cracking the coding interview   columbia - march 23 2011

CAREERCUP

What do companies look for?

APPLYING

Page 10: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

What can you do?• Get project experience!– Course work– Open source– Part-time job– Start a business!

• Know C++ or Java well• Good grades are nice – but not enough!

Skills PassionWork EthicCreativityInitiative

Page 11: Cracking the coding interview   columbia - march 23 2011

But unless you show this on your resume, it really doesn’t do you much good.

So what should a resume look like?

Page 12: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Resumes – The Most Important Thing• Glanced at, not read– You have 15 – 30 seconds to make the best

impression possible.

• Show That You “Get Things Done”

Page 13: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Resumes: Structure1. One Page2. Short Bullets: 1 – 2 lines– “So short that you can’t NOT but read it”

3. Nice Resume Format– Use tables, not spaces.– Use a REAL resume format.

Page 14: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Resumes: Content1. Accomplishments, not responsibilities– Quantify!

2. Understandable, but specific– To be read by both recruiters and engineers

3. PROJECTS!– Anything (esp. coding) you did – for class or not

Page 15: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

How do you make yourself look good?

INTERVIEW PREP – SOFT SKILLS

Page 16: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• Research the company / team– Prepare questions (around 10)

• Prepare for questions about yourself

But how?

Soft Skills Prep

Page 17: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• Create Preparation Grid for ProjectsOS Project Internship

Enjoyed

Hated

Most Challenging

Hardest Bug

+ (maybe) Behavioral Grid

Soft Prep – Yourself

Page 18: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

How to handle “soft skills” questions

INTERVIEW – SOFT SKILLS

Page 19: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

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

Page 20: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• 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

Page 21: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

ituationctionesult

Structure 2: S.A.R.

SAR

What did you do? What should I care?

Page 22: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

How do you prep for coding questions?What do you prep?

INTERVIEW PREP – TECH SKILLS

Page 23: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• Write code on paper– Put away the compiler

• Study the basics: – CLR algorithms book is great –

but too complex for interviews• Look up sample interview questions– Focus on the topics you’re struggling with

How to study

Page 24: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• How to implement• When to use (pros / cons)

Data Structures

Linked Lists Stacks Queues

Trees Tries Graphs

Vectors Heaps HASHTABLES

Page 25: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• Implementation• Space vs Time Complexity

Algorithms

With eyes closed: With some thought:

Breadth-First Search Mergesort

Depth-First Search Quicksort

Tree Insert / Find Binary search

Page 26: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Concepts

Threading Locks + Mutexes

MemoryManagement

Recursion Probability + Combinatorics

Bit Manipulation

• Not just a concept – know how to code!

Page 27: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

How do you tackle hard tech questions?

INTERVIEW – TECH SKILLS

Page 28: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Interview Coding

Page 29: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Mastering the Coding Questions1. Ask Questions!– Questions are more ambiguous than they appear

2. Talk out loud– Show us how you think

3. Think critically– Does your algorithm really work? What’s the space

and time complexity?4. Code slowly and methodically– It’s not a race

5. Test your code– You’re not done until they say you’re done!

Page 30: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

What does a “good coder” do?• Be methodical, not speed• Reasonably Bug Free– Thorough testing (and careful fixing)– Check for error conditions

• Clean coding– Uses other functions– Good use of data structures (defines own if

useful)– Concise and readable

Page 31: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Solving Interview Problems

Page 32: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

3 Main Question Types• Standard Coding and Algorithms– “Reverse a linked list”

• Object Oriented Design– “Design a parking lot”

• Scalability– “Design a program to crawl the web”

Page 33: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Algorithms

Question Type #1

Page 34: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

How To Solve Algorithm Questions

• 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?

#1Standard Coding and Algorithms

Page 35: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

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”

#1Standard Coding and Algorithms

Page 36: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Algorithm Generation• Simplify / Generalize

Design an algorithm to figure out if you can build a ransom note (array of strings) from a magazine (array of strings).

#1Standard Coding and Algorithms

Page 37: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

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}}

#1Standard Coding and Algorithms

Page 38: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

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.

#1Standard Coding and Algorithms

Page 39: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Object Oriented Design

Question Type #2

Page 40: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Core objectswhat are the core objects?

Relationshipswhat is their relationship to each other?

Interactionshow do they interact?

Algorithmswhat are the tricky / interesting algorithms?

Object Oriented Design Steps (C.R.I.A.) #2Object Oriented

Design

Page 41: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

OOD Example

Design the data structures for a restaurant

#2Object Oriented

Design

Page 42: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Core objectsrestaurant, host, employee, server, table

Relationshipseach party has many guests, server and host are a type of employee

InteractionsHOST assigns PARTY to TABLE

AlgorithmsHow is a free table selected?

Object Oriented Design Steps (C.R.I.A.) #2Object Oriented

Design

Page 43: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Scalability

Question Type #3

Page 44: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

Simplifypretend there wasn’t a lot of data. How would you solve it?

Identify the problemswhat goes wrong when you have lots of data?

Fix the issuessolve the issues that come up

Iteratenew problems may have come up. How do you solve them?

Scalability Questions #3Scalability

Page 45: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

RELAX!Interviews are

supposed to be hard!

Everyone makes mistakes. Everyone!

Page 46: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

(eg, things that wouldn’t fit in elsewhere)

FINAL THOUGHTS

Page 47: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

The Interview: Ending It• Smile, be positive• If you think you bombed, don’t worry• Follow up with your recruiters (sometimes

they forget)

Page 48: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

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

Page 49: Cracking the coding interview   columbia - march 23 2011

Process Applying Prep (Soft) Prep (Tech) Interview (Soft) Interview (Tech)

Cracking the Coding Interview

• Books (sold today - $20)• Interview video• Mock Interviews• Resume Review

Other Resources

Slides posted at CareerCup.com/slides