The following debugging information was generated by Atom Beautify
on Tue Jul 17 2018 20:02:09 GMT-0300 (-03)
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First of all, I'd like to thank you for the technical test, it was something I really enjoyed and it refreshed my memory of some architectural things | |
------------------------------------------------- | |
# Staff Engineer coding assignment | |
# Brief | |
Acme Corp. has an API service that allows registered users to fetch any information about the company and its wide array of products. It quickly became a very popular service and, to provide fair service to all users, a 10,000 API requests per-user monthly limit was added. Not long after the change, users started to report that their requests were very slow or not returning at all. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListsController < ApplicationController | |
before_filter :authenticate, :except => :public | |
caches_page :public | |
caches_action :index, :if => proc do | |
!request.format.json? # cache if is not a JSON request | |
end | |
caches_action :show, :cache_path => { :project => 1 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Serializer < Struct.new(:object) | |
#w.association_cache.keys.include? | |
def to_hash | |
@hash ||= hash_object(object) | |
end | |
private | |
def hash_object(object) | |
hash = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $oi = comment_squid_oi(); | |
#my $emb_34 = comment_squid_emb_34(); | |
#my $emb_147 = comment_squid_emb_147(); | |
sub comment_squid_oi { |