/laughing-waddle

CodePath Intermediate Group 46 Problems

Primary LanguagePython

laughing-waddle

CodePath Intermediate Group 46 Problems

Best practices:

  • Make your own branches from main, and name the branch something sensible and easily identifiable (ie: kevc, tphan, xhuang etc.).
  • Use the pull request feature, someone else from the group will need to merge the changes into the main branch.
  • Solutions will need to include your steps following the UMPIRE problem solving steps.

UMPIRE

  • Understand what the interviewer is asking for by using test cases and questions about the problem.
  • Match what this problem looks like to known categories of problems, e.g. Linked List or Dynamic Programming and strategies or patterns in those categories.
  • Plan the solution with appropriate visualizations and pseudocode.
  • Implement the code to solve the algorithm.
  • Review the code by running specific example(s) and recording values (watchlist) of your code's variables along the way.
  • Evaluate the performance of your algorithm and state any strong/weak or future potential work.
Example:
"""
Prompt - Write a function to determine if a given value is even or odd.  
Understand:   
* Should this problem be solved with math?
* Are the given values only greater than zero?
Match:  
* Math, Binary representation
Plan:  
* Write a function that uses modulo 2 to evaluate value
Implement:  
* Written solution below.
Review:  
* value=2 -> True
* value=3 -> False
Evaluate:  
* Time complexity - O(1) because mathematical operations are done with bitshifting techniques
* Space complexity - O(1) because no additional space is used to evaluate a given value.
"""
<Replace student with your name.>
def <student>_solution(value: int):
   return value % 2 == 0