Just another interview problem ..
Given the following code:
def bst_distance(values, n, node1, node2)
# write you code here
end
## For more details refer to: http://tsamni.com/post/84515089035/sidekiq-performing-background-or-delayed-jobs-with | |
# config/redis.yml | |
# Redis db configuration file | |
# development environment | |
development: | |
host: 'localhost' | |
port: '6379' | |
# local testing environment | |
test: |
## For more details refer to: http://tsamni.com/post/84515089035/sidekiq-performing-background-or-delayed-jobs-with | |
## .ebextensions/sidekiq.config | |
commands: | |
create_post_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq": | |
mode: "000777" | |
content: | |
version: '2.1' | |
services: | |
db: | |
image: bla_bla:1234/mysql:5.6 | |
environment: | |
- MYSQL_ROOT_PASSWORD=XXXX | |
- MYSQL_DATABASE=bla_bla_dev | |
- MYSQL_USER=XXXX | |
- MYSQL_PASSWORD=XXXX | |
ports: |
# Just another easy interview question in Ruby | |
# Description: https://www.hackerrank.com/challenges/balanced-brackets | |
# This solution is also expecting other chars other than the brackets | |
POSSIBLE_BRACKETS = %w({ } [ ] < > \( \)).freeze | |
MATCHING_BRACKETS = { | |
'{' => '}', | |
'[' => ']', | |
'<' => '>', | |
'(' => ')' | |
}.freeze |
Just another interview problem ..
Given the following code:
def bst_distance(values, n, node1, node2)
# write you code here
end
# Input: | |
businesses = [ | |
{ rating: 1, id: 1000 }, | |
{ rating: 4, id: 1020 }, | |
{ rating: 5, id: 1300 }, | |
{ rating: 5, id: 1040 }, | |
{ rating: 9, id: 1005 }, | |
{ rating: 2, id: 1104 }, | |
{ rating: 3, id: 1400 } | |
] |
I hereby claim:
To claim this, I am signing this object: