I hereby claim:
- I am masonfmatthews on github.
- I am masonfmatthews (https://keybase.io/masonfmatthews) on keybase.
- I have a public key ASBB1tXT7YpcCYc6IBv8rX_PLRyt6AmLpJO8ZwTtsy7Qvwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Spreedly's main line of business is transacting with stored credit cards at other gateways and endpoints - which are all themselves some sort of remote service. As such, it is important that engineers at Spreedly understand the realities of dealing with remote services and distributed systems, in general. This work sample is designed to understand your comfort dealing with such systems.
We've deployed a server that you can start jobs on. What do the jobs do? Doesn't really matter. What is important is that the jobs will always take ~0.5 seconds to complete. You can queue up a job like this:
$ curl -H "Content-Type: application/json" -d '{
I hereby claim:
To claim this, I am signing this object:
def do_stuff(big_thing, important_name) | |
answer = 0 | |
bottom = 0 | |
big_thing.each do |little_thing| | |
answer += little_thing[important_name] | |
bottom += 1 | |
end | |
answer.to_f / bottom | |
end |
puts "fake code" |
func getCount() -> Int { | |
guard let json = self.json else { return 0 } | |
return json.count | |
} | |
func getAll() -> [Clip] { | |
guard json != nil else { return [] } | |
var clips:[Clip] = [] | |
for result in json! { | |
guard let id = result["id"] as? Int, |
# Optimal Moves Data | |
hard = {8 => {},9 => {}, 10 => {}, 11 => "Double if possible, otherwise Hit", | |
12 => {}, 13 => {}, 14 => {}, 15 => {}, 16 => {}, | |
} | |
(5..7).each {|n| hard[n] = Hash.new("Hit")} | |
((2..4).to_a + (7..11).to_a).each {|n| hard[8][n] = "Hit"} | |
(5..6).each {|n| hard[8][n] = "Double if possible, otherwise Hit"} | |
(2..6).each {|n| hard[9][n] = "Double if possible, otherwise Hit"} | |
(7..11).each {|n| hard[9][n] = "Hit"} |
2+2 | |
gets.chomp |
def time_passed(updated_at) | |
difference = (Time.now - updated_at.to_time) | |
time = (difference / 1.day).round | |
units = "day" | |
if time == 0 | |
time = (difference / 1.hour).round | |
units = "hour" | |
if time == 0 | |
time = (difference / 1.minute).round | |
units = "minute" |
def first_name(name) | |
return "" unless name | |
array = name.split | |
if array.count < 2 | |
"" | |
else | |
array[0..-2].join(" ") | |
end | |
end |