Skip to content

Instantly share code, notes, and snippets.

@zourdyzou
Last active January 2, 2023 08:22
Show Gist options
  • Select an option

  • Save zourdyzou/3f8e1fcebcfc665468319c0772284f06 to your computer and use it in GitHub Desktop.

Select an option

Save zourdyzou/3f8e1fcebcfc665468319c0772284f06 to your computer and use it in GitHub Desktop.
Screening Test – Bereyziat Development

Instructions

  1. Write a solutions of the task/problem thoroughly using any approach you comfortable with (readability, queality, efficiency matter ☺️ ).
  2. Every task should have some explanation or step process of how you solved the problem/task.
  3. After you finish, create a Gist file in your own Github account and put your solution in that file.
  4. Send your solutions (link to the Gist file) to [email protected] with "Recruitment Process - Technical Screening [SRD-2023]" as a subject field

⚠️ Use typescript as the primary language for the solutions! https://www.typescriptlang.org/play

Task

  1. Create a function that takes multiple functions as an arguments (function composition) by returning a function that accepts one argument (see example below)

    const square = v => v * v
    const double = v => v * 2
    const addOne = v => v + 1
    const res = pipey(square, double, addOne)
    res(3) // 19; addOne(double(square(3)))
  2. Find the intersection of two arrays, the intersection would be the common elements that exists within both arrays. For this case, these elements should be unique!

    const firstArray = [2, 2, 4, 1];
    const secondArray = [1, 2, 0, 2];
    intersection(firstArray, secondArray); // [2, 1]
  3. Given a string an angle brackets, such as '<><<><>>', write a function that makes a angle brackets string match (balanced the structure)

     // '><<><' => '<><<><>>'
     
     const resultBracket = processAngleBrackets('><<><');
     
     console.log(`Output 1: ${resultBracket}`);
     console.log(`Expected ouput 1: <><<><>>`);
  4. Write a function that takes the Object of number with nested item as an argument, and then returns the array of unique number from that Object.

    getUniqueSortedNumbers({
      a: {
        x: 3,
        y: {
          d: 2,
          e: 2,
          f: {
            g: 4
          },
          z: 8
        }
      }
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment