Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CodePath SE102 - Week 1b

Caren
May 13, 2019
290

CodePath SE102 - Week 1b

Caren

May 13, 2019
Tweet

Transcript

  1. A few guidelines as we start… Make sure you’re muted

    Turn on your webcam! Feel free to talk in the room chat
  2. Common interview mistakes: • not verbalizing thought process • jumping

    to conclusions / solving the wrong problem • not communicating with interviewer
 

  3. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan Implement Review Evaluate
  4. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement Review Evaluate
  5. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement - Code Review Evaluate
  6. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement - Code Review - Test solution works as expected Evaluate
  7. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement - Code Review - Test solution works as expected Evaluate - Analyze run time and space complexity
  8. Understand - Clarify what the interviewer is asking for Match

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement - Code Review - Test solution works as expected Evaluate - Analyze run time and space complexity
  9. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} 

  10. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Understand: 
 
 

  11. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Understand: 
 - is the input always sorted for us?
 
 

  12. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Understand: 
 - is the input always sorted for us?
 - are inputs always only integers? 
 

  13. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Understand: 
 - is the input always sorted for us?
 - are inputs always only integers? - Given {1, 1, 1} ; Return {1}
 - Given {1, 2, 3} ; Return {1, 2, 3}
 - Given {15, 6, 10, 5, 12, 6} ; Return {15, 6, 10, 5, 12}
 

  14. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Understand: 
 - is the input always sorted for us?
 - are inputs always only integers? - Given {1, 1, 1} ; Return {1}
 - Given {1, 2, 3} ; Return {1, 2, 3}
 - Given {15, 6, 10, 5, 12, 6} ; Return {15, 6, 10, 5, 12} Follow up question: does it matter what order our return list is?
 

  15. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Match: 
 
 
 

  16. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Match: 
 - are there any common patterns we can apply here?
 
 
 

  17. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Match: 
 - are there any common patterns we can apply here?
 - coming in future sessions..
 - hash table
 - sort input first?
 
 

  18. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Plan
 
 

  19. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Plan: 
 - possible solutions:
 (1) iterate through array, put values in hash table, if value already exists, don't add to numsToReturn
 
 
 

  20. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Plan: 
 - possible solutions:
 (1) iterate through array, put values in hash table, if value already exists, don't add to numsToReturn
 (2) sort array, add integer to numsToReturn if previous integer is not the same
 
 

  21. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Implement: code up solution in https://codebunk.com/ ! 
 
 

  22. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Review: run one or two inputs through our solution
 
 

  23. Return distinct values from a list including duplicates Given {1,

    2, 6, 6, 6, 10, 14, 14} ; Return -> {1, 2, 6, 10, 14} Evaluate: what’s the space / run time complexity of our solution? what tradeoffs did we have to make?
  24. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE
  25. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE First, introduce yourself to your group!
  26. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE First, introduce yourself to your group! Review UMPIRE together, make sure everybody has a good understanding of what should be done at each step
  27. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE First, introduce yourself to your group! Review UMPIRE together, make sure everybody has a good understanding of what should be done at each step Review a sample problem solved with the UMPIRE method
  28. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE First, introduce yourself to your group! Review UMPIRE together, make sure everybody has a good understanding of what should be done at each step Review a sample problem solved with the UMPIRE method Create a shared document in CodeBunk to solve the problem together with the UMPIRE steps
  29. In Class Exercise - UMPIRE Warmup Work in groups to

    get more comfortable with UMPIRE First, introduce yourself to your group! Review UMPIRE together, make sure everybody has a good understanding of what should be done at each step Review a sample problem solved with the UMPIRE method Create a shared document in CodeBunk to solve the problem together with the UMPIRE steps After 45 minutes, we’ll regroup and review the problem
  30. Before Sunday midnight.. Review UMPIRE 
 guide linked in course

    portal
 lecture slides also linked in course portal
  31. Before Sunday midnight.. Review UMPIRE 
 guide linked in course

    portal
 lecture slides also linked in course portal Review solutions to our in class exercises
  32. Before Sunday midnight.. Review UMPIRE 
 guide linked in course

    portal
 lecture slides also linked in course portal Review solutions to our in class exercises Work on optional practice problems provided in course portal
  33. Before Sunday midnight.. Review UMPIRE 
 guide linked in course

    portal
 lecture slides also linked in course portal Review solutions to our in class exercises Work on optional practice problems provided in course portal Complete HackerRank assessment!