Skip to content

Instantly share code, notes, and snippets.

@carolineartz
carolineartz / password_validator.rb
Last active August 29, 2015 13:57 — forked from dbc-challenges/phase0_template_gist.rb
password validator method
# PSEUDOCODE
# Please write your pseudocode here and keep it commented
# INPUT: string
# OUTPUT: message indicating valid else failed password and violations
# What are the steps to solve the problem? Write them out in plain english as best you can.
# make sure passed argument is a string
# test the password against validity rules
# return or print appropriate valid/invalid + error message
# NOTE: my assumption is that the invalid message should always indicate ALL violated requirements
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@carolineartz
carolineartz / vote_count.js
Created March 14, 2014 02:48 — forked from dbc-challenges/vote_count.js
Tally votes and determine an election winner. Involves looping through nested objects and their properties.
//In this challenge you will work with the following JavaScript objects.
//Do not alter these objects here.
// These are the votes cast by each student.
var votes = {
"Alex": { president: "Bob", vicePresident: "Devin", secretary: "Gail", treasurer: "Kerry" },
"Bob": { president: "Mary", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" },
"Cindy": { president: "Cindy", vicePresident: "Hermann", secretary: "Bob", treasurer: "Bob" },
"Devin": { president: "Louise", vicePresident: "John", secretary: "Bob", treasurer: "Fred" },
"Ernest": { president: "Fred", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" },
@carolineartz
carolineartz / calculations.js
Last active May 24, 2023 00:03 — forked from dbc-challenges/calculations.js
Calculate the sum, mean, and median of an array in JavaScript
/*
Write THREE functions: sum, mean, and median. Each accepts an array
and returns its respective calculation.
Below you will find driver code. Run the code in this file either from the command line
using Node.js or by pasting the code of this entire file into your
browser console. All tests will log 'true' in the console when
they pass--false, otherwise.
/*
You will work with the following two variables. The first, students, holds the names of four students.
The second, scores, holds groups of test scores. The relative positions of elements within the two
variables match (i.e., 'Joseph' is the first element in students; his scores are the first value in scores.).
Do not alter the students and scores code.
*/
# YOUR NAMES: Caroline Artz (Went solo, didn't have an opportunity for a GPS for this)
require_relative 'state_data' #requires (links) the content of the file state_data (here its in the same directory)
class VirusPredictor
attr_reader :population #for bonus
def self.state_report(data)
data.each do |state, state_data|
VirusPredictor.new(state, state_data).virus_effects
@carolineartz
carolineartz / gist:9061501
Last active September 25, 2015 13:29 — forked from AMHOL/tricks.md
#####################################################
### USEFUL TRICKS ###################################
#####################################################
# Array.reduce will inject and initial value into a block and pass in each value in turn
# until all values in the array has been iterated i.e
([1] * 10).reduce(0) { |total, current_value| total + current_value } #= 10
# Inject does the same
([1] * 10).inject(0) { |total, current_value| total + current_value } #= 10

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.