Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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
...
gayle in/gaylemcdgayleGayle Laakmann McDowell 4
Hi! I’m Gayle LaakmannMcDowell
Author Interview Coach Interview Consulting...
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 HiringCom...
gayle in/gaylemcdgayle 8
z
Gayle Laakmann McDowell
Typical
Coding
Interview
5 Minutes
Questions FORInterviewer
35 Minutes
...
gayle in/gaylemcdgayle 9
z
Gayle Laakmann McDowell
Typical
Design
Interview
5 Minutes
Questions FORInterviewer
35 Minutes
...
Behavioral
Questions
The soft squishy stuff.
02
gayle in/gaylemcdgayleGayle Laakmann McDowell 11
The Pitch /Resume Walk-Through
• Showsof success
• Prompt the
interviewer...
Gayle Laakmann McDowell 12gayle in/gaylemcdgayle
Your Past Work
3+ Projects
 Hard / cool
 You werecentral
 Technical d...
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 appropriatea...
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 ...
gayle in/gaylemcdgayle 21
z
Gayle Laakmann McDowell
How
To
Prepare
Read about design of major companies
 THINK, don’t me...
Algorithm
Questions
Things that make you think
04
Gayle Laakmann McDowell 23gayle in/gaylemcdgayle
Why?
Analytical skills
How you think
Make tradeoffs
Pushthrough hard
...
gayle in/gaylemcdgayleGayle Laakmann McDowell 24
Essential Knowledge
Data Structures Algorithms Concepts
ArrayLists Merge ...
gayle in/gaylemcdgayleGayle Laakmann McDowell 25
Preparation
MASTER Big O
ImplementDS/Algorithms
Practicewith interview...
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...
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
...
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
• ...
gayle in/gaylemcdgayleGayle Laakmann McDowell 36
Fibonacci, part 2
Runtime?
Eeek. Recursion?
• Height of N
• Each level ...
gayle in/gaylemcdgayleGayle Laakmann McDowell 37
Reminders
Drop constants
Don’t drop non-constants
Differentvariables
...
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 co...
gayle in/gaylemcdgayle 40
z
Gayle Laakmann McDowell
What
IS
expected
Be excitedabout hard problems
Drive!
 Keep trying ...
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...
gayle in/gaylemcdgayle 44Gayle Laakmann McDowell
step
Draw an Example
INTERSECTION SIZE: Find #
elementsin common between...
gayle in/gaylemcdgayleGayle Laakmann McDowell 45
Ex:Intersection ofTwo Sorted Arrays
Most people draw somethinglike this:...
gayle in/gaylemcdgayleGayle Laakmann McDowell 46
Ex:Intersection ofTwo Sorted Arrays
Better:
[1, 12, 15, 19, 20, 21]
[2, ...
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
Rec...
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,...
Gayle Laakmann McDowell 53gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnec...
Gayle Laakmann McDowell 54gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnec...
Gayle Laakmann McDowell 55gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplic...
Gayle Laakmann McDowell 56gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplic...
Gayle Laakmann McDowell 57gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplic...
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...
Gayle Laakmann McDowell 63gayle in/gaylemcdgayle
(C)Do it yourself
Findpermutationsof swithinb
 s = abbcd
 b =
Findthe...
Gayle Laakmann McDowell 64gayle in/gaylemcdgayle
(D)Recursion
 Use, but don’t cling to, recursion
“instinct”
 Trybottom-...
Gayle Laakmann McDowell 65gayle in/gaylemcdgayle
Techniquesto Develop Algorithms
BUD
Space and Time
Do It Yourself
Rec...
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...
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:...
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...
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 g...
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 t...
gayle in/gaylemcdgayleGayle Laakmann McDowell 81
Other Resources
Gayle.com
CareerCup.com
CrackingThe
CodingInterview.com
O...
Upcoming SlideShare
Loading in …5
×

Cracking the Facebook Coding Interview

87,233 views

Published on

Published in: Technology

Cracking the Facebook Coding Interview

  1. 1. GayleL.McDowell | Founder/ CEO gayle in/gaylemcdgayle Cracking the Facebook Coding Interview I <3 Facebook! CareerCup
  2. 2. Why am I here? 00
  3. 3. gayle in/gaylemcdgayleGayle Laakmann McDowell 3 Why wouldFacebookprepyou?!? Be more comfortable Be more prepared Take out the mystery Avoid common mistakes
  4. 4. gayle in/gaylemcdgayleGayle Laakmann McDowell 4 Hi! I’m Gayle LaakmannMcDowell Author Interview Coach Interview Consulting <dev> </dev> (CS) (MBA)
  5. 5. Gayle Laakmann McDowell 5gayle in/gaylemcdgayle Yes! Slidesare online! Gayle.com  Click “Events”  Ctrl-F for “Facebook”
  6. 6. What to Expect
  7. 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. 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. 9. gayle in/gaylemcdgayle 9 z Gayle Laakmann McDowell Typical Design Interview 5 Minutes Questions FORInterviewer 35 Minutes Question#1 5 Minutes Prior Experience
  10. 10. Behavioral Questions The soft squishy stuff. 02
  11. 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. 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. 13. gayle in/gaylemcdgayle 13 z Gayle Laakmann McDowell What about YOU? Be PASSIONATE Be KNOWLEDGEABLE Be a GOOD TEAMMATE
  14. 14. Design Questions Big, meaty problems 03
  15. 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. 16. gayle in/gaylemcdgayle 16 z Gayle Laakmann McDowell How To Approach S K I R cope eycomponents dentify issues epair
  17. 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. 18. Gayle Laakmann McDowell 18gayle in/gaylemcdgayle ExampleQuestion
  19. 19. Gayle Laakmann McDowell 19gayle in/gaylemcdgayle Design sketch Frontend Backend Data store logger
  20. 20. Gayle Laakmann McDowell 20gayle in/gaylemcdgayle Collaborativediscussionthat you’re driving! DRIVE  Leadtheprocess  Be openaboutissues TEAMWORK  Be opentofeedback  Tweak asnecessary Usethewhiteboard!
  21. 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
  22. 22. Algorithm Questions Things that make you think 04
  23. 23. Gayle Laakmann McDowell 23gayle in/gaylemcdgayle Why? Analytical skills How you think Make tradeoffs Pushthrough hard problems Communication Strong CS fundamentals
  24. 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. 25. gayle in/gaylemcdgayleGayle Laakmann McDowell 25 Preparation MASTER Big O ImplementDS/Algorithms Practicewith interview questions Code on paper/whiteboard Mock interviews PUSHYOURSELF!
  26. 26. A Crash Course in Big O Just getting your feet wet
  27. 27. gayle in/gaylemcdgayleGayle Laakmann McDowell 27 Basicfor loop Print0 throughN Runtime?  O(N)
  28. 28. gayle in/gaylemcdgayleGayle Laakmann McDowell 28 Two loops Printevens, thenodds Runtime?O(N)
  29. 29. gayle in/gaylemcdgayleGayle Laakmann McDowell 29 Basicfor loop Printpairs from two arrays Runtime?  O(A*B)
  30. 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. 31. gayle in/gaylemcdgayleGayle Laakmann McDowell 31 Okay now thingsare getting tougher!
  32. 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. 33. gayle in/gaylemcdgayleGayle Laakmann McDowell 33 Validate Validate Runtime?  undefined
  34. 34. gayle in/gaylemcdgayleGayle Laakmann McDowell 34 Fibonacci Runtime? Eeek. Recursion?
  35. 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. 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. 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. 38. Solving Algorithms How to… attempt to solve a hard problem
  39. 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. 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. 41. gayle in/gaylemcdgayle 41 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  42. 42. gayle in/gaylemcdgayle 42Gayle Laakmann McDowell step Listen (for clues)
  43. 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. 44. gayle in/gaylemcdgayle 44Gayle Laakmann McDowell step Draw an Example INTERSECTION SIZE: Find # elementsin common between two sorted, distinct arrays:
  45. 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. 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. 47. gayle in/gaylemcdgayle 47Gayle Laakmann McDowell step Draw an Example Big Enough General Purpose +
  48. 48. gayle in/gaylemcdgayle 48Gayle Laakmann McDowell step Brute Force / Naive Stupid&terribleisokay!
  49. 49. gayle in/gaylemcdgayle 49Gayle Laakmann McDowell step Optimize Walk through brute force Look for optimizations
  50. 50. Gayle Laakmann McDowell 50gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  51. 51. Gayle Laakmann McDowell 51gayle in/gaylemcdgayle (A) Look for BUD Bottlenecks Unnecessary work Duplicated work
  52. 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. 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. 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. 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. 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. 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. 58. Gayle Laakmann McDowell 58gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  59. 59. Gayle Laakmann McDowell 59gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  60. 60. Gayle Laakmann McDowell 60gayle in/gaylemcdgayle (B)Space/TimeTradeoffs Hashtables & other datastructures Precomputing
  61. 61. Gayle Laakmann McDowell 61gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb
  62. 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. 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. 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. 65. Gayle Laakmann McDowell 65gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  66. 66. gayle in/gaylemcdgayle 66Gayle Laakmann McDowell step Walk Through Know the variables andwhen they change
  67. 67. gayle in/gaylemcdgayle 67Gayle Laakmann McDowell step Write Beautiful Code
  68. 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. 69. Gayle Laakmann McDowell 69gayle in/gaylemcdgayle Error Cases Good to check errors / boundaries! But consider the time…
  70. 70. gayle in/gaylemcdgayleGayle Laakmann McDowell 70 Good Style Spacing, line breaks, variable names
  71. 71. Gayle Laakmann McDowell 71gayle in/gaylemcdgayle Language Choice Java, Objective C, etc:Abbreviate Python, Ruby, JS,etc: Carefulwithbuilt-infunctions
  72. 72. gayle in/gaylemcdgayleGayle Laakmann McDowell 72 Modularization
  73. 73. Gayle Laakmann McDowell 73gayle in/gaylemcdgayle Modularize(Upfront!) I’ve learned nothing.
  74. 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. 75. gayle in/gaylemcdgayle 75 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  76. 76. Questions for Your Interviewer What do you want to know? 05
  77. 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
  78. 78. Final Thoughts And questions 06
  79. 79. gayle in/gaylemcdgayle 79 z Gayle Laakmann McDowell It’s done for a reason! Be agreat teammate. Be a great engineer.
  80. 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. 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

×