Skip to content

guyett92/coding-challenges

Repository files navigation

General Assembly Coding Challenges

During the software engineering immersive at General Assembly, we were tasked with completing some coding challenges to supplement our learning. The following coding challenges are described and completed in the linked folder.

sumNumber

  • Write a function called sumNumbers that accepts a single array of numbers and returns the sum of the numbers in the array.
  • If the array is empty, return 0 (zero).
  • sumNumbers

addList

  • Write a function called addList that accepts any quantity of numbers as arguments, adds them together and returns the resulting sum.
  • Assume all parameters will be numbers.
  • If called with no arguments, return 0 (zero).
  • addList

findMax

  • Write a recursive function that returns the max value in an array.
  • findMax

factorial

  • Write a recursive function that returns the factorial of a given number.
  • factorial

fibonacci

computeRemainder

  • Write a function named computeRemainder that accepts two numeric arguments and returns the remainder of the division of those two numbers.
  • The first argument should be the dividend and the second argument should be the divisor.
  • If a 0 is passed in as the second argument you should return JavaScript's special numeric value: Infinity.
  • For extra fun, complete this challenge without using the modulus (%) operator.
  • computeRemainder

range

  • Write a function called range that accepts two integers as arguments and returns an array of integers starting with the first argument up to one less than the second argument.
  • The range function must be called with the first argument less than or equal to the second argument, otherwise return the string "First argument must be less than second".
  • range

reverseUpcaseString

  • Write a function called reverseUpcaseString that accepts a single string argument, then returns the string with its characters in reverse order and converts all characters to uppercase.
  • reverseUpcaseString

charCount

  • Write a function named charCount that accepts a single string argument and returns an object that represents the count of each character in the string.
  • The returned object should have keys that represent the character with its value set to the how many times the character appears in the string argument.
  • Upper and lower case characters should be counted separately.
  • Space characters should be counted too.
  • charCount

About

General Assembly Coding Challenges

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published