Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Prochain SlideShare
How to Interview Like Google (But Better) - SVCC
Suivant
Télécharger pour lire hors ligne et voir en mode plein écran

11

Partager

Cracking the Coding interview (Abbreviated) - aug 2016

Télécharger pour lire hors ligne

How to do well in a software engineering coding/algorithm interview, and in particular how to optimize / solve algorithms

Livres associés

Gratuit avec un essai de 30 jours de Scribd

Tout voir

Cracking the Coding interview (Abbreviated) - aug 2016

  1. 1. GayleL.McDowell | Founder/ CEO gayle in/gaylemcdgayle Cracking the Coding Interview CareerCup
  2. 2. gayle in/gaylemcdgayleGayle Laakmann McDowell 2 Hi! I’m Gayle LaakmannMcDowell Author Interview Coach Interview Consulting <dev> </dev> (CS) (MBA)
  3. 3. Evaluation What it’s all about 01
  4. 4. Gayle Laakmann McDowell 4gayle in/gaylemcdgayle Why? Analytical skills How you think Make tradeoffs Pushthrough hard problems Communication Strong CS fundamentals
  5. 5. gayle in/gaylemcdgayle 5 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.
  6. 6. gayle in/gaylemcdgayle 6 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!
  7. 7. Preparation Getting ready 02
  8. 8. gayle in/gaylemcdgayleGayle Laakmann McDowell 8 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
  9. 9. gayle in/gaylemcdgayleGayle Laakmann McDowell 9 Preparation MASTER Big O ImplementDS/Algorithms Practicewith interview questions Code on paper/whiteboard Mock interviews PUSHYOURSELF!
  10. 10. gayle in/gaylemcdgayle 10 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  11. 11. Doing It 7 Steps to Solve 03
  12. 12. gayle in/gaylemcdgayle 12Gayle Laakmann McDowell step Listen(for clues &details)
  13. 13. gayle in/gaylemcdgayle 13Gayle Laakmann McDowell step Draw an Example Big Enough General Purpose +
  14. 14. gayle in/gaylemcdgayle 14Gayle Laakmann McDowell step Brute Force / Naive Stupid&terribleisokay!
  15. 15. gayle in/gaylemcdgayle 15Gayle Laakmann McDowell step Optimize Walk through brute force Look for optimizations
  16. 16. gayle in/gaylemcdgayle 16Gayle Laakmann McDowell step Walk Through Know the variables andwhen they change
  17. 17. gayle in/gaylemcdgayle 17Gayle Laakmann McDowell step Write Beautiful Code
  18. 18. gayle in/gaylemcdgayle 18Gayle Laakmann McDowell step Write Beautiful Code RealCode with GoodStyle and UpfrontModularization
  19. 19. gayle in/gaylemcdgayleGayle Laakmann McDowell 19 Modularization
  20. 20. Gayle Laakmann McDowell 20gayle in/gaylemcdgayle Modularize(Upfront!) I’ve learned nothing.
  21. 21. gayle in/gaylemcdgayle 21Gayle 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
  22. 22. gayle in/gaylemcdgayle 22 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  23. 23. Solving & Optimizing 4 Optimization/Solving Techniques 04
  24. 24. gayle in/gaylemcdgayle 24Gayle Laakmann McDowell step Optimize Walk through brute force Look for optimizations
  25. 25. Gayle Laakmann McDowell 25gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  26. 26. Gayle Laakmann McDowell 26gayle in/gaylemcdgayle (A) Look for BUD Bottlenecks Unnecessary work Duplicated work
  27. 27. Gayle Laakmann McDowell 27gayle 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
  28. 28. Gayle Laakmann McDowell 28gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  29. 29. Gayle Laakmann McDowell 29gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  30. 30. Gayle Laakmann McDowell 30gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D
  31. 31. Gayle Laakmann McDowell 31gayle 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 … … …
  32. 32. Gayle Laakmann McDowell 32gayle 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) … …
  33. 33. Gayle Laakmann McDowell 33gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  34. 34. Gayle Laakmann McDowell 34gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  35. 35. Gayle Laakmann McDowell 35gayle in/gaylemcdgayle (B)Space/TimeTradeoffs Hashtables & other datastructures Precomputing
  36. 36. Gayle Laakmann McDowell 36gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle at origin w biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2  Brute force: compute all rectanglesand sums
  37. 37. Gayle Laakmann McDowell 37gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle at origin w biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2
  38. 38. Gayle Laakmann McDowell 38gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle with biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2 -+ + 10=
  39. 39. Gayle Laakmann McDowell 39gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle with biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2 -+ + 13=
  40. 40. Gayle Laakmann McDowell 40gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb
  41. 41. gayle in/gaylemcdgayleGayle Laakmann McDowell 41 find abbc in babcabbacaabcbabcacbb
  42. 42. Gayle Laakmann McDowell 42gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb  s = abbc  b = babcabbacaabcbabcacbb Findthem!  … now how didyou actuallydoit?
  43. 43. Gayle Laakmann McDowell 43gayle 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
  44. 44. Gayle Laakmann McDowell 44gayle in/gaylemcdgayle Techniquesto Develop Algorithms BUD Space and Time Do It Yourself Recursion
  45. 45. gayle in/gaylemcdgayle 45 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  46. 46. gayle in/gaylemcdgayleGayle Laakmann McDowell 46 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
  47. 47. Gayle Laakmann McDowell 47gayle in/gaylemcdgayle What Now? Book signing, photos, etc. [withme!] Mock interviews [withAWS!] Code challenge [online!] hr.gs/mockathon
  • nits_9

    Dec. 30, 2020
  • sonergonul

    Apr. 12, 2020
  • jitter

    Jul. 5, 2019
  • fix_felix

    Mar. 11, 2019
  • RohanSuri3

    Jan. 1, 2019
  • ssusera278a8

    Oct. 25, 2018
  • SenthilkumarKandasam4

    Jan. 4, 2018
  • AmitMishra432

    Feb. 19, 2017
  • brysmi

    Feb. 2, 2017
  • aelam

    Nov. 18, 2016
  • ViditOchani

    Sep. 11, 2016

How to do well in a software engineering coding/algorithm interview, and in particular how to optimize / solve algorithms

Vues

Nombre de vues

11 391

Sur Slideshare

0

À partir des intégrations

0

Nombre d'intégrations

18

Actions

Téléchargements

199

Partages

0

Commentaires

0

Mentions J'aime

11

×