Interesting tasks

  1. If you are given an array of undetermined length with numbers in random order. Please write a method to return the minimum # of elements that add up to a number >= X (where X is an input to the method? (e.g. array = [1,4,3,2], X = 6, answer is 2 elements: 4 + 3)

  2. You have sorted array of numbers ( e.g. [1,4,5,7,8,10,20] ) Please implement a method which will search element in that array and return its index. ( e.g. el = 7, print index => 3 ). Think about the most optimal solution.

  3. Write code to turn the string "Fizz::Buzz::Wizz" into an array ["Fizz::Buzz::Wizz", "Fizz::Buzz","Fizz"]

  4. Write code to sum all of the numbers between 1 and 100 (e.g. 1 + 2 + 3 + ....+ 100)

  5. There are four kinds of brackets '{' '[' '(' '<' Each of them corresponds to the closing brackets '}' ']' ')' '>' Extend the String class with the valid method? for checking a string consisting only of parentheses by validity

"{(})".valid? => false

"{{[]".valid? => false

"{[()]}".valid? => true

  1. Polindrome?

  2. obj => proc

  3. ruby thread unsafe

  4. The first unique letter is not repeating