Skip to content

Instantly share code, notes, and snippets.

@aric87
Last active August 16, 2017 21:48
Show Gist options
  • Save aric87/ab54609e5cdecaf215337ce718ce5d4b to your computer and use it in GitHub Desktop.
Save aric87/ab54609e5cdecaf215337ce718ce5d4b to your computer and use it in GitHub Desktop.
Test problems for students

Code challenges adapted from: http://prepwork.appacademy.io/coding-test-1/practice-problems/ http://prepwork.appacademy.io/coding-test-2/practice-problems/

##Contributed by Trevor Nowalk

  • max/min Takes two numbers and returns the max/min.
  • max/min part 2 Takes an array and returns the min/max
  • sum/multiply Sums/Multiplies all the numbers in an array
  • reverse a string Reverse a string
  • average Get the average of the array of numbers, bonus take second param which indicates the num of sig figs
  • length Without using built in .length, write function that gets the length of a string
  • palindrome Is a word the same forwards as it is backwards
  • longest Takes an array of strings and returns the longest
  • removeVowels Takes a string and removes all the vowels in it
  • sumNumber Takes a number as an argument, sums the digits that make up the number. (111 would return 3)
  • sumOfMultiples Takes a number as an argument and returns the sum of all the multiples of 3 and 5
  • frequency Provide a string and it gives you the number of times each character shows up
  • pangram - Check if the passed in string contains all the letters of the alphabet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment