Cracking the Facebook Coding Interview

Gayle McDowell
Gayle McDowellFounder of CareerCup, Consultant (acquisitions & tech hiring), Author of 3 tech books, Developer (Google, MS, Apple) at CareerCup
GayleL.McDowell | Founder/ CEO
gayle in/gaylemcdgayle
Cracking the Facebook
Coding Interview
I <3 Facebook!
CareerCup
Why am I here?
00
gayle in/gaylemcdgayleGayle Laakmann McDowell 3
Why wouldFacebookprepyou?!?
Be more
comfortable
Be more prepared
Take out
the mystery
Avoid common
mistakes
gayle in/gaylemcdgayleGayle Laakmann McDowell 4
Hi! I’m Gayle LaakmannMcDowell
Author Interview Coach Interview Consulting
<dev> </dev>
(CS) (MBA)
Gayle Laakmann McDowell 5gayle in/gaylemcdgayle
Yes! Slidesare online!
Gayle.com
 Click “Events”
 Ctrl-F for “Facebook”
What to Expect
gayle in/gaylemcdgayleGayle Laakmann McDowell 7
A Typical**Process(**notuniversal!Askyourrecruiter)
Phone Onsite HiringCommittee & Decision
½ Behavioral
½ Algo / Coding
Design
Algo / Coding
Algo / Coding
Algo / Coding
gayle in/gaylemcdgayle 8
z
Gayle Laakmann McDowell
Typical
Coding
Interview
5 Minutes
Questions FORInterviewer
35 Minutes
Question #1 Question#2
5 Minutes
Prior Experience
gayle in/gaylemcdgayle 9
z
Gayle Laakmann McDowell
Typical
Design
Interview
5 Minutes
Questions FORInterviewer
35 Minutes
Question#1
5 Minutes
Prior Experience
Behavioral
Questions
The soft squishy stuff.
02
gayle in/gaylemcdgayleGayle Laakmann McDowell 11
The Pitch /Resume Walk-Through
• Showsof success
• Prompt the
interviewer
• Hobbies
I’masoftwareengineerat...
Mybackground’sinCS.
IstudiedatUPennandthen…
Atmycurrentcompany,I…
OutsideofworkI…
Gayle Laakmann McDowell 12gayle in/gaylemcdgayle
Your Past Work
3+ Projects
 Hard / cool
 You werecentral
 Technical depth
All Past Work
 TECHNICAL:Challenges,
architecture, tradeoffs,
successes, motivations
 SOFT:Teamwork, leadership,
conflicts, etc
What did YOU do?
What would you do differently?
gayle in/gaylemcdgayle 13
z
Gayle Laakmann McDowell
What
about
YOU?
Be PASSIONATE
Be KNOWLEDGEABLE
Be a GOOD TEAMMATE
Design Questions
Big, meaty problems
03
gayle in/gaylemcdgayle 15
z
Gayle Laakmann McDowell
How
To
Approach
W
W
Y
D
A
W
hat
ould
ou
o
t
ork
gayle in/gaylemcdgayle 16
z
Gayle Laakmann McDowell
How
To
Approach
S
K
I
R
cope
eycomponents
dentify issues
epair
gayle in/gaylemcdgayle 17
z
Gayle Laakmann McDowell
How
To
Approach
① Scope the Problem
 Askquestions
 Make appropriateassumptions
② Define Key Components
 Can besomewhatnaïve
③ Identify Issues
 Bottlenecks,tradeoffs
④ Repair & Redesign
Breadth-first,notdepth-first
Gayle Laakmann McDowell 18gayle in/gaylemcdgayle
ExampleQuestion
Gayle Laakmann McDowell 19gayle in/gaylemcdgayle
Design sketch
Frontend
Backend
Data store
logger
Gayle Laakmann McDowell 20gayle in/gaylemcdgayle
Collaborativediscussionthat you’re driving!
DRIVE
 Leadtheprocess
 Be openaboutissues
TEAMWORK
 Be opentofeedback
 Tweak asnecessary
Usethewhiteboard!
gayle in/gaylemcdgayle 21
z
Gayle Laakmann McDowell
How
To
Prepare
Read about design of major companies
 THINK, don’t memorize!
Know key concepts
 Tasks, sharding, caches.
 Web stack, REST, etc
Practice back-of-the-envelope
calculations
Algorithm
Questions
Things that make you think
04
Gayle Laakmann McDowell 23gayle in/gaylemcdgayle
Why?
Analytical skills
How you think
Make tradeoffs
Pushthrough hard
problems
Communication
Strong CS fundamentals
gayle in/gaylemcdgayleGayle Laakmann McDowell 24
Essential Knowledge
Data Structures Algorithms Concepts
ArrayLists Merge Sort BigO Time
Hash Tables QuickSort BigO Space
Trees(+Tries) & Graphs Breadth-FirstSearch Recursion
LinkedLists Depth-FirstSearch Memoization/ Dynamic
Programming
Stacks/ Queues BinarySearch
Heaps
gayle in/gaylemcdgayleGayle Laakmann McDowell 25
Preparation
MASTER Big O
ImplementDS/Algorithms
Practicewith interview questions
Code on paper/whiteboard
Mock interviews
PUSHYOURSELF!
A Crash Course in Big O
Just getting your feet wet
gayle in/gaylemcdgayleGayle Laakmann McDowell 27
Basicfor loop
Print0 throughN
Runtime?
 O(N)
gayle in/gaylemcdgayleGayle Laakmann McDowell 28
Two loops
Printevens, thenodds
Runtime?O(N)
gayle in/gaylemcdgayleGayle Laakmann McDowell 29
Basicfor loop
Printpairs from two arrays
Runtime?
 O(A*B)
gayle in/gaylemcdgayleGayle Laakmann McDowell 30
Basicfor loop
Printordered pairs
Runtime?
 O(N2)
j : 0  N
i:0N
x x x x x x
x x x x x
x x x x
x x x
x x
x
gayle in/gaylemcdgayleGayle Laakmann McDowell 31
Okay now thingsare getting tougher!
gayle in/gaylemcdgayleGayle Laakmann McDowell 32
Okay now thingsare getting tougher!
Step 1: O(P)
 P = numberof people
Step 2: O(P * Y)
 Y = max life span
Step 3: O(L)
 L = last death year
O(P + P * Y + L)  O(P * Y + L)
gayle in/gaylemcdgayleGayle Laakmann McDowell 33
Validate
Validate
Runtime?
 undefined
gayle in/gaylemcdgayleGayle Laakmann McDowell 34
Fibonacci
Runtime?
Eeek. Recursion?
gayle in/gaylemcdgayleGayle Laakmann McDowell 35
Fibonacci
Eeek. Recursion?
• Height of N
• Each level doubles # nodes
•  O(2N) time ***
•  O(N) space
Actuallyslightlylessforcomplexmathreasons.
gayle in/gaylemcdgayleGayle Laakmann McDowell 36
Fibonacci, part 2
Runtime?
Eeek. Recursion?
• Height of N
• Each level has <=2nodes
•  O(N) time
•  O(N) space
gayle in/gaylemcdgayleGayle Laakmann McDowell 37
Reminders
Drop constants
Don’t drop non-constants
Differentvariables
Avoid ‘n’
Add vs. Multiply
Recursion call tree
Solving Algorithms
How to… attempt to solve a hard problem
gayle in/gaylemcdgayle 39
z
Gayle Laakmann McDowell
What
is NOT
expected
To know the answers
To solve immediately
To code perfectly
(It’snice.Itjustdoesn’t
happen*.)
*Okayfine.Ithappenedonce,in2000+hiringpackets.
gayle in/gaylemcdgayle 40
z
Gayle Laakmann McDowell
What
IS
expected
Be excitedabout hard problems
Drive!
 Keep trying when stuck
 More than just “correct”
Pay attention to me!
Write real code
Showmehowyouthink!
gayle in/gaylemcdgayle 41
z
Gayle Laakmann McDowell
How
To
Approach
CrackingTheCodingInterview.com“Resources”
gayle in/gaylemcdgayle 42Gayle Laakmann McDowell
step
Listen (for clues)
Gayle Laakmann McDowell 43gayle in/gaylemcdgayle
What’s the clue?
Anagram server
 Ex: rates ->aster, stare, taser, tears
Clue:why is it on a server?
Key(sorted string) Value (list of words)
aerst rates, aster, stare, taser, tears,
dgo dog, god
acll call
… …
gayle in/gaylemcdgayle 44Gayle Laakmann McDowell
step
Draw an Example
INTERSECTION SIZE: Find #
elementsin common between
two sorted, distinct arrays:
gayle in/gaylemcdgayleGayle Laakmann McDowell 45
Ex:Intersection ofTwo Sorted Arrays
Most people draw somethinglike this:
[1, 12, 15, 19]
[2, 12, 13, 20]
 Toosmall
 Toospecial-case-y
• same size, one commonelement, same index
gayle in/gaylemcdgayleGayle Laakmann McDowell 46
Ex:Intersection ofTwo Sorted Arrays
Better:
[1, 12, 15, 19, 20, 21]
[2, 15, 17, 19, 21, 25, 27]
 Big
 No specialcases
gayle in/gaylemcdgayle 47Gayle Laakmann McDowell
step
Draw an Example
Big Enough
General Purpose
+
gayle in/gaylemcdgayle 48Gayle Laakmann McDowell
step
Brute Force / Naive
Stupid&terribleisokay!
gayle in/gaylemcdgayle 49Gayle Laakmann McDowell
step
Optimize
Walk through brute
force
Look for optimizations
Gayle Laakmann McDowell 50gayle in/gaylemcdgayle
Techniquesto Develop Algorithms
BUD
Space and Time
Do It Yourself
Recursion
Gayle Laakmann McDowell 51gayle in/gaylemcdgayle
(A) Look for BUD
Bottlenecks
Unnecessary work
Duplicated work
Gayle Laakmann McDowell 52gayle in/gaylemcdgayle
What’s the bottleneck?
 Ex: countingthe intersection
[1, 12, 15, 19, 20, 21]
[2, 15, 17, 19, 21, 25, 27]
 Bottleneck:searching
B
Gayle Laakmann McDowell 53gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnecessary: looking for d
U
Gayle Laakmann McDowell 54gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnecessary: looking for d
U
Gayle Laakmann McDowell 55gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplicated: c, d pairs
D
Gayle Laakmann McDowell 56gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplicated: c, d pairs
D
c d c3 + d3
… … …
4 31 29855
4 32 32832
4 33 36001
… … …
5 59 205504
5 60 216125
5 61 227106
… … …
Gayle Laakmann McDowell 57gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplicated: c, d pairs
D
c3 + d3 (c, d)
… …
29855 (4, 31)
32832 (4, 32),(18, 30)
36001 (4, 33)
… …
205504 (5, 59)
216125 (5, 60),(45, 50)
227106 (5, 61)
… …
Gayle Laakmann McDowell 58gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
D
Gayle Laakmann McDowell 59gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
D
Gayle Laakmann McDowell 60gayle in/gaylemcdgayle
(B)Space/TimeTradeoffs
Hashtables & other datastructures
Precomputing
Gayle Laakmann McDowell 61gayle in/gaylemcdgayle
(C)Do it yourself
Findpermutationsof swithinb
gayle in/gaylemcdgayleGayle Laakmann McDowell 62
find abbcd in
b a b c d b a e f d b b a c b d d f a e
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Gayle Laakmann McDowell 63gayle in/gaylemcdgayle
(C)Do it yourself
Findpermutationsof swithinb
 s = abbcd
 b =
Findthem!
 … now how didyou actuallydoit?
b a b c d b a e f d b b a c b d d f a e
Gayle Laakmann McDowell 64gayle in/gaylemcdgayle
(D)Recursion
 Use, but don’t cling to, recursion
“instinct”
 Trybottom-up
 “Backtracking”
 Draw call-tree
 Derive runtime
 Find repeated subproblems
 Subsets of a set
 {} {}
 {a}{},{a}
 {a,b} {},{a},{b},{a,b}
 {a,b, c} …
 Subsets of {S1…Sn-1} +Sn to each
Gayle Laakmann McDowell 65gayle in/gaylemcdgayle
Techniquesto Develop Algorithms
BUD
Space and Time
Do It Yourself
Recursion
gayle in/gaylemcdgayle 66Gayle Laakmann McDowell
step
Walk Through
Know the variables
andwhen they change
gayle in/gaylemcdgayle 67Gayle Laakmann McDowell
step
Write Beautiful Code
Gayle Laakmann McDowell 68gayle in/gaylemcdgayle
How toWrite WhiteboardCode
Write straight
Top-leftcorner
Use arrows if needed
Error cases
Good style
Modularize (upfront!)
Languagechoiceisuptoyou!
Gayle Laakmann McDowell 69gayle in/gaylemcdgayle
Error Cases
Good to check errors / boundaries!
But consider the time…
gayle in/gaylemcdgayleGayle Laakmann McDowell 70
Good Style
Spacing, line breaks, variable names
Gayle Laakmann McDowell 71gayle in/gaylemcdgayle
Language Choice
Java, Objective C, etc:Abbreviate
Python, Ruby, JS,etc: Carefulwithbuilt-infunctions
gayle in/gaylemcdgayleGayle Laakmann McDowell 72
Modularization
Gayle Laakmann McDowell 73gayle in/gaylemcdgayle
Modularize(Upfront!)
I’ve learned
nothing.
gayle in/gaylemcdgayle 74Gayle Laakmann McDowell
step
Testing
FIRST Analyze
 What’s it doing? Why?
 Anything that looks weird?
 Errorhot spots
THEN use test cases
 Small test cases
 Edge cases
 Biggertest cases
BUT…
 Test code, notalgorithm
 Think as you test
 Think before you fix
Find permutationsof s withinb:
s = abbc
b = babcabbacaabcbabcacbb
for (i = 0; i < b.len – s.len; i++) {
if (isPerm(s, b.subs(i, s.len)) …
}
gayle in/gaylemcdgayle 75
z
Gayle Laakmann McDowell
How
To
Approach
CrackingTheCodingInterview.com“Resources”
Questions for Your
Interviewer
What do you want to know?
05
Gayle Laakmann McDowell 77gayle in/gaylemcdgayle
Prepare some questions
What’s made you
happy / unhappy?
What are your goals?
Culture& work style
Career paths
Technology
Interviewer’s
experience
Final Thoughts
And questions
06
gayle in/gaylemcdgayle 79
z
Gayle Laakmann McDowell
It’s done
for a
reason!
Be agreat teammate.
Be a great engineer.
Gayle Laakmann McDowell 80gayle in/gaylemcdgayle
Butwait, there’s onemore thing...
READY? Follow up with your recruiter to schedule your next steps.
JOB POSTINGS: facebook.com/careers/teams/engineering
SLIDES? Gayle.com -> Events -> search “Facebook”
gayle in/gaylemcdgayleGayle Laakmann McDowell 81
Other Resources
Gayle.com
CareerCup.com
CrackingThe
CodingInterview.com
Or, follow me online
• facebook.com/gayle
• twitter.com/gayle
• gayle.com
• gayle@gayle.com
• quora.com
1 of 81

Recommended

Cracking the Algorithm & Coding Interview by
Cracking the Algorithm & Coding InterviewCracking the Algorithm & Coding Interview
Cracking the Algorithm & Coding InterviewGayle McDowell
8.7K views53 slides
Cracking the Coding Interview - 7 steps - Udacity by
Cracking the Coding Interview - 7 steps - UdacityCracking the Coding Interview - 7 steps - Udacity
Cracking the Coding Interview - 7 steps - UdacityGayle McDowell
8.6K views43 slides
Cracking the Coding interview (College) by
Cracking the Coding interview (College)Cracking the Coding interview (College)
Cracking the Coding interview (College)Gayle McDowell
6.4K views71 slides
How to Interview Like Google (But Better) - SVCC by
How to Interview Like Google (But Better) - SVCCHow to Interview Like Google (But Better) - SVCC
How to Interview Like Google (But Better) - SVCCGayle McDowell
3.3K views87 slides
Cracking the Coding Interview by
Cracking the Coding InterviewCracking the Coding Interview
Cracking the Coding InterviewGayle McDowell
12.1K views62 slides
Cracking The Technical Interview by
Cracking The Technical InterviewCracking The Technical Interview
Cracking The Technical Interviewcareercup
4.4K views62 slides

More Related Content

What's hot

Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas... by
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...DataStax
8.3K views33 slides
Advanced MySQL Query Tuning by
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query TuningAlexander Rubin
1.2K views67 slides
Apache Calcite Tutorial - BOSS 21 by
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
666 views83 slides
More mastering the art of indexing by
More mastering the art of indexingMore mastering the art of indexing
More mastering the art of indexingYoshinori Matsunobu
27.7K views54 slides
Examining Oracle GoldenGate Trail Files by
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
6.4K views24 slides
Getting Things Done by
Getting Things DoneGetting Things Done
Getting Things DoneDana Vanden Heuvel
31.7K views36 slides

What's hot(20)

Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas... by DataStax
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
DataStax8.3K views
Examining Oracle GoldenGate Trail Files by Bobby Curtis
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
Bobby Curtis6.4K views
Percona Live 2012PPT: MySQL Query optimization by mysqlops
Percona Live 2012PPT: MySQL Query optimizationPercona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimization
mysqlops 4.3K views
Things I will tell my kids if they become entrepreneurs by Laurent Haug
Things I will tell my kids if they become entrepreneursThings I will tell my kids if they become entrepreneurs
Things I will tell my kids if they become entrepreneurs
Laurent Haug373.3K views
Time is money, use it wisely by SlideShop.com
Time is money, use it wiselyTime is money, use it wisely
Time is money, use it wisely
SlideShop.com31.8K views
Craigslist Code Words: Do You Know What They Really Mean? by Instant Checkmate
Craigslist Code Words: Do You Know What They Really Mean?Craigslist Code Words: Do You Know What They Really Mean?
Craigslist Code Words: Do You Know What They Really Mean?
Instant Checkmate72.5K views
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ... by Monica Beckwith
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Monica Beckwith7.2K views
Building a Complex, Real-Time Data Management Application by Jonathan Katz
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management Application
Jonathan Katz2.1K views
A rumelt perpsective on good strategy by Michaelcmcdermott
A rumelt perpsective on good strategyA rumelt perpsective on good strategy
A rumelt perpsective on good strategy
Michaelcmcdermott34.7K views

Similar to Cracking the Facebook Coding Interview

Cracking the Coding interview (Abbreviated) - aug 2016 by
Cracking the Coding interview (Abbreviated) - aug 2016Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016Gayle McDowell
13.4K views47 slides
How to Hire Software Engineers: Best and Worst Practices by
How to Hire Software Engineers: Best and Worst PracticesHow to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst PracticesGayle McDowell
2.2K views49 slides
Cracking the PM Interview by
Cracking the PM InterviewCracking the PM Interview
Cracking the PM InterviewGayle McDowell
2.8K views56 slides
Creating the (Im)perfect Developer Interview by
Creating the (Im)perfect Developer InterviewCreating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer InterviewGayle McDowell
2.5K views68 slides
Architecture of Tech Interviews by
Architecture of Tech InterviewsArchitecture of Tech Interviews
Architecture of Tech InterviewsGayle McDowell
3.1K views49 slides
Cracking the PM Interview by
Cracking the PM InterviewCracking the PM Interview
Cracking the PM InterviewGayle McDowell
1.9K views53 slides

Similar to Cracking the Facebook Coding Interview(8)

Cracking the Coding interview (Abbreviated) - aug 2016 by Gayle McDowell
Cracking the Coding interview (Abbreviated) - aug 2016Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016
Gayle McDowell13.4K views
How to Hire Software Engineers: Best and Worst Practices by Gayle McDowell
How to Hire Software Engineers: Best and Worst PracticesHow to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst Practices
Gayle McDowell2.2K views
Cracking the PM Interview by Gayle McDowell
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
Gayle McDowell2.8K views
Creating the (Im)perfect Developer Interview by Gayle McDowell
Creating the (Im)perfect Developer InterviewCreating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer Interview
Gayle McDowell2.5K views
Architecture of Tech Interviews by Gayle McDowell
Architecture of Tech InterviewsArchitecture of Tech Interviews
Architecture of Tech Interviews
Gayle McDowell3.1K views
Cracking the PM Interview by Gayle McDowell
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
Gayle McDowell1.9K views
Cracking the Product Manager Interview by Gayle McDowell
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
Gayle McDowell65.4K views
Fast katz-presentation by David Gleich
Fast katz-presentationFast katz-presentation
Fast katz-presentation
David Gleich629 views

More from Gayle McDowell

Cracking the Product Manager Interview by
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager InterviewGayle McDowell
2.5K views1 slide
Cracking the Interview Skills (Coding, Soft Skills, Product Management) Handouts by
Cracking the Interview Skills (Coding, Soft Skills, Product Management) HandoutsCracking the Interview Skills (Coding, Soft Skills, Product Management) Handouts
Cracking the Interview Skills (Coding, Soft Skills, Product Management) HandoutsGayle McDowell
87.8K views3 slides
Prepping Your Engineering Candidates to Reduce Your False Negatives by
Prepping Your Engineering Candidates to Reduce Your False NegativesPrepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False NegativesGayle McDowell
2.4K views42 slides
Hiring Great Product Managers by
Hiring Great Product ManagersHiring Great Product Managers
Hiring Great Product ManagersGayle McDowell
1.5K views35 slides
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer by
Reverse Engineering Engineering Interviewing: How to Be a Great InterviewerReverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great InterviewerGayle McDowell
10K views27 slides
Transitioning from Engineering to Product Management by
Transitioning from Engineering to Product ManagementTransitioning from Engineering to Product Management
Transitioning from Engineering to Product ManagementGayle McDowell
2.6K views24 slides

More from Gayle McDowell(8)

Cracking the Product Manager Interview by Gayle McDowell
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
Gayle McDowell2.5K views
Cracking the Interview Skills (Coding, Soft Skills, Product Management) Handouts by Gayle McDowell
Cracking the Interview Skills (Coding, Soft Skills, Product Management) HandoutsCracking the Interview Skills (Coding, Soft Skills, Product Management) Handouts
Cracking the Interview Skills (Coding, Soft Skills, Product Management) Handouts
Gayle McDowell87.8K views
Prepping Your Engineering Candidates to Reduce Your False Negatives by Gayle McDowell
Prepping Your Engineering Candidates to Reduce Your False NegativesPrepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False Negatives
Gayle McDowell2.4K views
Hiring Great Product Managers by Gayle McDowell
Hiring Great Product ManagersHiring Great Product Managers
Hiring Great Product Managers
Gayle McDowell1.5K views
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer by Gayle McDowell
Reverse Engineering Engineering Interviewing: How to Be a Great InterviewerReverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Gayle McDowell10K views
Transitioning from Engineering to Product Management by Gayle McDowell
Transitioning from Engineering to Product ManagementTransitioning from Engineering to Product Management
Transitioning from Engineering to Product Management
Gayle McDowell2.6K views
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea... by Gayle McDowell
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Gayle McDowell1.8K views
Cracking the Coding & PM Interview (Jan 2014) by Gayle McDowell
Cracking the Coding & PM Interview (Jan 2014)Cracking the Coding & PM Interview (Jan 2014)
Cracking the Coding & PM Interview (Jan 2014)
Gayle McDowell5.3K views

Recently uploaded

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
222 views23 slides
The Role of Patterns in the Era of Large Language Models by
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
80 views65 slides
NTGapps NTG LowCode Platform by
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform Mustafa Kuğu
365 views30 slides
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueShapeBlue
93 views15 slides
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
50 views69 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
144 views12 slides

Recently uploaded(20)

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li80 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu365 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue93 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker50 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue144 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue176 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE69 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely78 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue179 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue138 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue154 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software385 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue103 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue101 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue85 views

Cracking the Facebook Coding Interview

  • 1. GayleL.McDowell | Founder/ CEO gayle in/gaylemcdgayle Cracking the Facebook Coding Interview I <3 Facebook! CareerCup
  • 2. Why am I here? 00
  • 3. gayle in/gaylemcdgayleGayle Laakmann McDowell 3 Why wouldFacebookprepyou?!? Be more comfortable Be more prepared Take out the mystery Avoid common mistakes
  • 4. gayle in/gaylemcdgayleGayle Laakmann McDowell 4 Hi! I’m Gayle LaakmannMcDowell Author Interview Coach Interview Consulting <dev> </dev> (CS) (MBA)
  • 5. Gayle Laakmann McDowell 5gayle in/gaylemcdgayle Yes! Slidesare online! Gayle.com  Click “Events”  Ctrl-F for “Facebook”
  • 7. gayle in/gaylemcdgayleGayle Laakmann McDowell 7 A Typical**Process(**notuniversal!Askyourrecruiter) Phone Onsite HiringCommittee & Decision ½ Behavioral ½ Algo / Coding Design Algo / Coding Algo / Coding Algo / Coding
  • 8. gayle in/gaylemcdgayle 8 z Gayle Laakmann McDowell Typical Coding Interview 5 Minutes Questions FORInterviewer 35 Minutes Question #1 Question#2 5 Minutes Prior Experience
  • 9. gayle in/gaylemcdgayle 9 z Gayle Laakmann McDowell Typical Design Interview 5 Minutes Questions FORInterviewer 35 Minutes Question#1 5 Minutes Prior Experience
  • 11. gayle in/gaylemcdgayleGayle Laakmann McDowell 11 The Pitch /Resume Walk-Through • Showsof success • Prompt the interviewer • Hobbies I’masoftwareengineerat... Mybackground’sinCS. IstudiedatUPennandthen… Atmycurrentcompany,I… OutsideofworkI…
  • 12. Gayle Laakmann McDowell 12gayle in/gaylemcdgayle Your Past Work 3+ Projects  Hard / cool  You werecentral  Technical depth All Past Work  TECHNICAL:Challenges, architecture, tradeoffs, successes, motivations  SOFT:Teamwork, leadership, conflicts, etc What did YOU do? What would you do differently?
  • 13. gayle in/gaylemcdgayle 13 z Gayle Laakmann McDowell What about YOU? Be PASSIONATE Be KNOWLEDGEABLE Be a GOOD TEAMMATE
  • 15. gayle in/gaylemcdgayle 15 z Gayle Laakmann McDowell How To Approach W W Y D A W hat ould ou o t ork
  • 16. gayle in/gaylemcdgayle 16 z Gayle Laakmann McDowell How To Approach S K I R cope eycomponents dentify issues epair
  • 17. gayle in/gaylemcdgayle 17 z Gayle Laakmann McDowell How To Approach ① Scope the Problem  Askquestions  Make appropriateassumptions ② Define Key Components  Can besomewhatnaïve ③ Identify Issues  Bottlenecks,tradeoffs ④ Repair & Redesign Breadth-first,notdepth-first
  • 18. Gayle Laakmann McDowell 18gayle in/gaylemcdgayle ExampleQuestion
  • 19. Gayle Laakmann McDowell 19gayle in/gaylemcdgayle Design sketch Frontend Backend Data store logger
  • 20. Gayle Laakmann McDowell 20gayle in/gaylemcdgayle Collaborativediscussionthat you’re driving! DRIVE  Leadtheprocess  Be openaboutissues TEAMWORK  Be opentofeedback  Tweak asnecessary Usethewhiteboard!
  • 21. gayle in/gaylemcdgayle 21 z Gayle Laakmann McDowell How To Prepare Read about design of major companies  THINK, don’t memorize! Know key concepts  Tasks, sharding, caches.  Web stack, REST, etc Practice back-of-the-envelope calculations
  • 23. Gayle Laakmann McDowell 23gayle in/gaylemcdgayle Why? Analytical skills How you think Make tradeoffs Pushthrough hard problems Communication Strong CS fundamentals
  • 24. gayle in/gaylemcdgayleGayle Laakmann McDowell 24 Essential Knowledge Data Structures Algorithms Concepts ArrayLists Merge Sort BigO Time Hash Tables QuickSort BigO Space Trees(+Tries) & Graphs Breadth-FirstSearch Recursion LinkedLists Depth-FirstSearch Memoization/ Dynamic Programming Stacks/ Queues BinarySearch Heaps
  • 25. gayle in/gaylemcdgayleGayle Laakmann McDowell 25 Preparation MASTER Big O ImplementDS/Algorithms Practicewith interview questions Code on paper/whiteboard Mock interviews PUSHYOURSELF!
  • 26. A Crash Course in Big O Just getting your feet wet
  • 27. gayle in/gaylemcdgayleGayle Laakmann McDowell 27 Basicfor loop Print0 throughN Runtime?  O(N)
  • 28. gayle in/gaylemcdgayleGayle Laakmann McDowell 28 Two loops Printevens, thenodds Runtime?O(N)
  • 29. gayle in/gaylemcdgayleGayle Laakmann McDowell 29 Basicfor loop Printpairs from two arrays Runtime?  O(A*B)
  • 30. gayle in/gaylemcdgayleGayle Laakmann McDowell 30 Basicfor loop Printordered pairs Runtime?  O(N2) j : 0  N i:0N x x x x x x x x x x x x x x x x x x x x x
  • 31. gayle in/gaylemcdgayleGayle Laakmann McDowell 31 Okay now thingsare getting tougher!
  • 32. gayle in/gaylemcdgayleGayle Laakmann McDowell 32 Okay now thingsare getting tougher! Step 1: O(P)  P = numberof people Step 2: O(P * Y)  Y = max life span Step 3: O(L)  L = last death year O(P + P * Y + L)  O(P * Y + L)
  • 33. gayle in/gaylemcdgayleGayle Laakmann McDowell 33 Validate Validate Runtime?  undefined
  • 34. gayle in/gaylemcdgayleGayle Laakmann McDowell 34 Fibonacci Runtime? Eeek. Recursion?
  • 35. gayle in/gaylemcdgayleGayle Laakmann McDowell 35 Fibonacci Eeek. Recursion? • Height of N • Each level doubles # nodes •  O(2N) time *** •  O(N) space Actuallyslightlylessforcomplexmathreasons.
  • 36. gayle in/gaylemcdgayleGayle Laakmann McDowell 36 Fibonacci, part 2 Runtime? Eeek. Recursion? • Height of N • Each level has <=2nodes •  O(N) time •  O(N) space
  • 37. gayle in/gaylemcdgayleGayle Laakmann McDowell 37 Reminders Drop constants Don’t drop non-constants Differentvariables Avoid ‘n’ Add vs. Multiply Recursion call tree
  • 38. Solving Algorithms How to… attempt to solve a hard problem
  • 39. gayle in/gaylemcdgayle 39 z Gayle Laakmann McDowell What is NOT expected To know the answers To solve immediately To code perfectly (It’snice.Itjustdoesn’t happen*.) *Okayfine.Ithappenedonce,in2000+hiringpackets.
  • 40. gayle in/gaylemcdgayle 40 z Gayle Laakmann McDowell What IS expected Be excitedabout hard problems Drive!  Keep trying when stuck  More than just “correct” Pay attention to me! Write real code Showmehowyouthink!
  • 41. gayle in/gaylemcdgayle 41 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  • 42. gayle in/gaylemcdgayle 42Gayle Laakmann McDowell step Listen (for clues)
  • 43. Gayle Laakmann McDowell 43gayle in/gaylemcdgayle What’s the clue? Anagram server  Ex: rates ->aster, stare, taser, tears Clue:why is it on a server? Key(sorted string) Value (list of words) aerst rates, aster, stare, taser, tears, dgo dog, god acll call … …
  • 44. gayle in/gaylemcdgayle 44Gayle Laakmann McDowell step Draw an Example INTERSECTION SIZE: Find # elementsin common between two sorted, distinct arrays:
  • 45. gayle in/gaylemcdgayleGayle Laakmann McDowell 45 Ex:Intersection ofTwo Sorted Arrays Most people draw somethinglike this: [1, 12, 15, 19] [2, 12, 13, 20]  Toosmall  Toospecial-case-y • same size, one commonelement, same index
  • 46. gayle in/gaylemcdgayleGayle Laakmann McDowell 46 Ex:Intersection ofTwo Sorted Arrays Better: [1, 12, 15, 19, 20, 21] [2, 15, 17, 19, 21, 25, 27]  Big  No specialcases
  • 47. gayle in/gaylemcdgayle 47Gayle Laakmann McDowell step Draw an Example Big Enough General Purpose +
  • 48. gayle in/gaylemcdgayle 48Gayle Laakmann McDowell step Brute Force / Naive Stupid&terribleisokay!
  • 49. gayle in/gaylemcdgayle 49Gayle Laakmann McDowell step Optimize Walk through brute force Look for optimizations
  • 50. Gayle Laakmann McDowell 50gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  • 51. Gayle Laakmann McDowell 51gayle in/gaylemcdgayle (A) Look for BUD Bottlenecks Unnecessary work Duplicated work
  • 52. Gayle Laakmann McDowell 52gayle in/gaylemcdgayle What’s the bottleneck?  Ex: countingthe intersection [1, 12, 15, 19, 20, 21] [2, 15, 17, 19, 21, 25, 27]  Bottleneck:searching B
  • 53. Gayle Laakmann McDowell 53gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  • 54. Gayle Laakmann McDowell 54gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  • 55. Gayle Laakmann McDowell 55gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D
  • 56. Gayle Laakmann McDowell 56gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D c d c3 + d3 … … … 4 31 29855 4 32 32832 4 33 36001 … … … 5 59 205504 5 60 216125 5 61 227106 … … …
  • 57. Gayle Laakmann McDowell 57gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D c3 + d3 (c, d) … … 29855 (4, 31) 32832 (4, 32),(18, 30) 36001 (4, 33) … … 205504 (5, 59) 216125 (5, 60),(45, 50) 227106 (5, 61) … …
  • 58. Gayle Laakmann McDowell 58gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  • 59. Gayle Laakmann McDowell 59gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  • 60. Gayle Laakmann McDowell 60gayle in/gaylemcdgayle (B)Space/TimeTradeoffs Hashtables & other datastructures Precomputing
  • 61. Gayle Laakmann McDowell 61gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb
  • 62. gayle in/gaylemcdgayleGayle Laakmann McDowell 62 find abbcd in b a b c d b a e f d b b a c b d d f a e 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 63. Gayle Laakmann McDowell 63gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb  s = abbcd  b = Findthem!  … now how didyou actuallydoit? b a b c d b a e f d b b a c b d d f a e
  • 64. Gayle Laakmann McDowell 64gayle in/gaylemcdgayle (D)Recursion  Use, but don’t cling to, recursion “instinct”  Trybottom-up  “Backtracking”  Draw call-tree  Derive runtime  Find repeated subproblems  Subsets of a set  {} {}  {a}{},{a}  {a,b} {},{a},{b},{a,b}  {a,b, c} …  Subsets of {S1…Sn-1} +Sn to each
  • 65. Gayle Laakmann McDowell 65gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  • 66. gayle in/gaylemcdgayle 66Gayle Laakmann McDowell step Walk Through Know the variables andwhen they change
  • 67. gayle in/gaylemcdgayle 67Gayle Laakmann McDowell step Write Beautiful Code
  • 68. Gayle Laakmann McDowell 68gayle in/gaylemcdgayle How toWrite WhiteboardCode Write straight Top-leftcorner Use arrows if needed Error cases Good style Modularize (upfront!) Languagechoiceisuptoyou!
  • 69. Gayle Laakmann McDowell 69gayle in/gaylemcdgayle Error Cases Good to check errors / boundaries! But consider the time…
  • 70. gayle in/gaylemcdgayleGayle Laakmann McDowell 70 Good Style Spacing, line breaks, variable names
  • 71. Gayle Laakmann McDowell 71gayle in/gaylemcdgayle Language Choice Java, Objective C, etc:Abbreviate Python, Ruby, JS,etc: Carefulwithbuilt-infunctions
  • 72. gayle in/gaylemcdgayleGayle Laakmann McDowell 72 Modularization
  • 73. Gayle Laakmann McDowell 73gayle in/gaylemcdgayle Modularize(Upfront!) I’ve learned nothing.
  • 74. gayle in/gaylemcdgayle 74Gayle Laakmann McDowell step Testing FIRST Analyze  What’s it doing? Why?  Anything that looks weird?  Errorhot spots THEN use test cases  Small test cases  Edge cases  Biggertest cases BUT…  Test code, notalgorithm  Think as you test  Think before you fix Find permutationsof s withinb: s = abbc b = babcabbacaabcbabcacbb for (i = 0; i < b.len – s.len; i++) { if (isPerm(s, b.subs(i, s.len)) … }
  • 75. gayle in/gaylemcdgayle 75 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  • 76. Questions for Your Interviewer What do you want to know? 05
  • 77. Gayle Laakmann McDowell 77gayle in/gaylemcdgayle Prepare some questions What’s made you happy / unhappy? What are your goals? Culture& work style Career paths Technology Interviewer’s experience
  • 79. gayle in/gaylemcdgayle 79 z Gayle Laakmann McDowell It’s done for a reason! Be agreat teammate. Be a great engineer.
  • 80. Gayle Laakmann McDowell 80gayle in/gaylemcdgayle Butwait, there’s onemore thing... READY? Follow up with your recruiter to schedule your next steps. JOB POSTINGS: facebook.com/careers/teams/engineering SLIDES? Gayle.com -> Events -> search “Facebook”
  • 81. gayle in/gaylemcdgayleGayle Laakmann McDowell 81 Other Resources Gayle.com CareerCup.com CrackingThe CodingInterview.com Or, follow me online • facebook.com/gayle • twitter.com/gayle • gayle.com • gayle@gayle.com • quora.com