Problem 1
Problem 1
(required for all applicants)
(required for all applicants)
The goal of this problem is to join a string with its reversal.
For example, given the string "Wolfram", the butterfly of that string would be "WolframmarfloW".
Write code that takes the string "Wolfram" and returns the string "WolframmarfloW".
Write code that takes the string "Wolfram" and returns the string "WolframmarfloW".
Problem 2
Problem 2
(required if you have programming experience)
(required if you have programming experience)
The goal of this problem is to replace any number that can be divided by 3 with the word "fizz," any number that can be divided by 5 with "buzz" and any number that can be divided by both 3 and 5 with "fizzbuzz."
For example, given a list of numbers from 1 to 30:
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}
... your code should return:
{1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz"}
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}
... your code should return:
{1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz"}
Write some code that does FizzBuzz to a list of numbers from 1 to 30.
Write some code that does FizzBuzz to a list of numbers from 1 to 30.
Problem 3
Problem 3
(required if you have programming experience)
(required if you have programming experience)
The goal of this problem is to take a list of integers and rearrange them so that all of the odd integers appear before all of the even integers, without otherwise changing the order.
For example, take the following list:
{-1, 2, 8, -9, -2, -3, -6, -10, -8, 5, 7, 9, 7}
Rearranged, it would look like this:
{-1, -9, -3, 5, 7, 9, 7, 2, 8, -2, -6, -10, -8}
Apart from putting the odds in front, the order in which the numbers appear is the same. This is different from sorting the integers, which would look like this:
{-10, -9, -8, -6, -3, -2, -1, 2, 5, 7, 7, 8, 9}
{-1, 2, 8, -9, -2, -3, -6, -10, -8, 5, 7, 9, 7}
Rearranged, it would look like this:
{-1, -9, -3, 5, 7, 9, 7, 2, 8, -2, -6, -10, -8}
Apart from putting the odds in front, the order in which the numbers appear is the same. This is different from sorting the integers, which would look like this:
{-10, -9, -8, -6, -3, -2, -1, 2, 5, 7, 7, 8, 9}
Write some code that sorts a list to put the odd integers before the even integers.
Write some code that sorts a list to put the odd integers before the even integers.