Interview questions

  1. Given a whole number, n return the sum of all the numbers from 1 to n inclusive
  2. Given a dictionary in the form {'year': '2016', 'month': '01', 'day': '27'} (noting the values are strings, return a datetime.date representation of the dict
  3. Count the number of troughs and peaks in a list eg.
    ol = [2, 2, 5, 4, 1, 2, 1, 2, 2] (answer: 5, 1, 2, 1 = 4)

Leave a Reply

Your email address will not be published. Required fields are marked *