Skip to content

Instantly share code, notes, and snippets.

View aellispierce's full-sized avatar

Ashley Ellis Pierce aellispierce

View GitHub Profile

##Jquery Screening Questions

  • Advantages/disadvantages of JSON vs XML? (not really a jquery specific question)
  • Has the candidate chained Jquery commands?
  • Explain the .EACH Jquery command?
  • Have they ever written a plug in for Jquery?
  • What is the most efficient way to get to the Dom Element? NOTE: Lots of people hated this question and thought it was very vague. The usual answer was along the lines of "You could just query for the ID."

##Javascript Screening Questions

require 'minitest/autorun'
require 'minitest/pride'
# Write a class which has an initialize method, a reader method, a private
# method, and a class method.
class Goat
attr_reader :name
def initialize(name)
@aellispierce
aellispierce / gist:1b5a21e279b621f6fb40
Created February 26, 2015 14:23
Optional Parameters
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts an array and returns a sum of the elements in the
# array. Specifying a second parameter (e.g. 3) will allow you to sum all the
# items starting from index 3. Specifying three parameters will allow you to sum
# between two indices (e.g. everything between 3 and 6, inclusive).
#This solution looks crazy but it works!
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts one parameter. The method should return true if
# the string passed to it is a palindrome. It should return false if the string
# is not a palindrome
def palindrome?(word)
new_word= word.downcase.gsub(" ", "").gsub(/[^[:alnum:]]/, "")
if new_word.reverse == new_word
@aellispierce
aellispierce / gist:00a624b84a47efd60b7e
Created February 24, 2015 16:28
Array and Hash Challenge
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts an array and returns a hash. Each item in the
# array will be a string, and the returned hash should have last names as keys
# and first names as values.
#
def names(array)
hash= {}
return hash if array == nil
@aellispierce
aellispierce / gist:9c6cd5c5d4e1512def38
Created February 23, 2015 14:16
Double loop challenge
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts an array as the first paramater and a number
# as the second parameter. Return true if two of the numbers in the array sum
# to the second parameter.
def complements?(array, sum)
return false if array == nil || array.length < 2
array.each_with_index do |num1, index1|
@aellispierce
aellispierce / gist:cfab9d71740fcc9bd695
Created February 18, 2015 14:23
Double loop challenge
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which accepts an array as the first paramater and a number
# as the second parameter. Return true if two of the numbers in the array sum
# to the second parameter.
def complements?(array, num)
#array.reduce(:+) == num
@aellispierce
aellispierce / gist:0dcec7392c8a3ea6cb1a
Created February 17, 2015 14:15
Enumerable Challenge
require 'minitest/autorun'
require 'minitest/pride'
# Write a series of methods which use the .any, .all, .map, .select, .reject, and
# .reduce methods in Enumerable. Each of your methods should be one line.
# WRITE YOUR CODE HERE. In this challenge, names longer than 5 characters are
# considered long.
def has_even?(array)
Find all authors with an email address of "shakespeare@example.com"
SELECT *
FROM authors
WHERE email= "shakespeare@example.com";
Find the author who was created most recently
SELECT *
require 'minitest/autorun'
require 'minitest/pride'
# Write a method which returns a hash.
def get_hash
{"Pizza"=>"Unhealthy", "French Fries" => "Okay", "Broccoli" => "Healthy", "Chocolate" => "Healthy"}
end