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

CodePath SE102 - Week 1b

7bf2baf0d8d5d7d96e6b67c5d567e3f9?s=47 Caren
May 13, 2019
250

CodePath SE102 - Week 1b

7bf2baf0d8d5d7d96e6b67c5d567e3f9?s=128

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. Intermediate Software Engineering Week 1: Intro

  3. Common interview mistakes: • not verbalizing thought process • jumping

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

  4. U M P I R E

  5. Understand Match Plan Implement Review Evaluate

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

    Plan Implement Review Evaluate
  7. Understand - Clarify what the interviewer is asking for Match

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

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

    - Identify similar patterns Plan - Come up with algorithm, proof it works Implement - Code Review Evaluate
  10. 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
  11. 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
  12. 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
  13. Return distinct values from a list including duplicates Given {1,

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

  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: 
 
 

  15. 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?
 
 

  16. 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? 
 

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

  18. 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?
 

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

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

  20. 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?
 
 
 

  21. 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?
 
 

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

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

  23. 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
 
 
 

  24. 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
 
 

  25. 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/ ! 
 
 

  26. 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
 
 

  27. 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?
  28. In Class Exercise - UMPIRE Warmup

  29. In Class Exercise - UMPIRE Warmup Work in groups to

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

    get more comfortable with UMPIRE First, introduce yourself to your group!
  31. 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
  32. 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
  33. 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
  34. 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
  35. Questions?

  36. Write a function that reverses a string

  37. Before Sunday midnight..

  38. Before Sunday midnight.. Review UMPIRE 
 guide linked in course

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

    portal
 lecture slides also linked in course portal Review solutions to our in class exercises
  40. 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
  41. 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!