Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Hiring test solution #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules

# Serverless directories
.serverless
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# hiring-tests
This repo is designated to our hiring tests.
# Queue Message Array Challenge

## Problem:
John receives a message with 2 arrays in his queue, filled with integer elements.
John needs a function that receives only 2 arrays (arr1, arr2) from queue and returns only the elemens that are in both arrays asc sorted.

Example payload : {[3, 5, 6, 1, 2, 16], [16, 6, 91, 1, 4, 3, 123, 1, 1]}

Example response: 1, 3, 6, 16

## Write rules:
- Javascript, typescript or elixir

## What we are judging:
- Programming Logic
- Unit Tests
- Deploy flow
- Performance
- Organization & Cleanliness
- Documentation

## What can I use:
Serverless Framework with NodeJS, Phoenix with Elixir, Docker for deploy start.
Any framework, libs for unit tests.

## How to submit:
Fork this repo and implement your solution. Then send us a pull request to this branch with your code.
11 changes: 11 additions & 0 deletions handler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict'

const { recursiveIntersect } = require('./src/algorithms/intersection')
const { sortAscending } = require('./src/algorithms/sorting')

module.exports.intersectAndAscending = async event => {
return {
statusCode: 200,
body: sortAscending(recursiveIntersect(...event))
}
}
Loading