This is our coding challenge, aimed at getting to know you and your code skills a bit better. There's no time limit on the challenge, but we expect you to invest just a couple of hours of your day. Most of all, we hope you have fun working on this, show off your skills!
Choose at least one of the following challenges and using Ruby or Javascript send us the solution to the challenge, ideally hosted on Github or Gitlab.
There is no requirement in using a specific framework or tooling, so it’s up to you to use whatever you find yourself comfortable with. Tests are welcome too.
Please remember to add some documentation explaining how to use your solution.
Given a word, write an algorithm that returns the sequence of a specific character that appears the most in sequence. If there are many of them, return the first character.
Examples
Given the input "Pressuuuuuure"
the output is "uuuuuu"
Given the input "Boat"
the output is "B"
Given the input "A hot dog"
the output is " "
(2 spaces!)
Given a set of numbers, find the subset in which the sum of the elements is the maximum sum.
Example
Given the set of elements
[2, -4, 6, 8, -10, 100, -6, 5]
The maximum sum subset is:
[2, -4,
6, 8, -10, 100
, -6, 5]
Thus, the program must return the position of the first and last element of the subset. In this example, the positions 2 and 5, considering the first position with index 0.
Given two arrays of integers (lengths n and m), find the symmetric difference between them.
Exemple 1
Given the set
[1, 2, 3]
and the set [3, 4]
the output would be [1, 2, 4]
Constraints
n, m <= 100
Given a string s
, you need to reverse the order of the words.
Exemple 1
Given the string s = 'Hello World'
The output would be s= 'World Hello'
Example 2
Given the string s = 'I love to code very much'
The output would be s= 'much very code to love I'