Skip to content

Instantly share code, notes, and snippets.

@gEndelf
Last active August 27, 2018 13:29
Show Gist options
  • Save gEndelf/f26d74851c6b5f6e942a51cdf7567814 to your computer and use it in GitHub Desktop.
Save gEndelf/f26d74851c6b5f6e942a51cdf7567814 to your computer and use it in GitHub Desktop.
- Imagine that you are writing a Ruby/Rails application that must consume a third party RESTful API.
If the API is receiving too many requests from the application then it will return HTTP status code 429.
In this case the Rails application should wait 15 seconds and then re-submit the same request to the API.
Please demonstrate how you would test this behavior using RSpec. The test should be as simple as possible.
- You have an array of ints. Integers from 1 to j successively. 2 elements are missing.
Create an algorithm to find this numbers.
- You have an array of ints. Create function which groups numbers by sum of pairs
pairAmount = 5
[-5, 33, 2, 2, 3, 5, 0, 10, 3]
//result: [[-5, 10], [2, 3], [2, 3], [5, 0]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment