This file contains hidden or 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
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 | |
# WRITE YOUR CODE HERE. | |
def palindrome?(string) | |
s = string.downcase.delete('^a-z ') |
This file contains hidden or 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
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write two methods: | |
# | |
# * `first_name`: given a name in string, return the first name. | |
# * `last_name`: given a name in string, return the last name. | |
# WRITE YOUR CODE HERE. | |
def first_name(name) |
This file contains hidden or 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
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. | |
# WRITE YOUR CODE HERE. Name your method `names`. | |
def names( array ) | |
hash = {} |
This file contains hidden or 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
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. | |
# WRITE YOUR CODE HERE. Name your method `complements?`. | |
def complements?(number, sum) | |
return false if array == nil || array.length < 2 |
This file contains hidden or 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
def complements?(number) | |
array = [] | |
array.each do |n| | |
assert n + n = | |
else | |
false | |
end | |
I *never* finish these things. Are they hard or am I just dumb? |
This file contains hidden or 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
Second, write SQL statements (in your gist) and model methods (in your model files) to accomplish the following: | |
1. Find all authors with an email address of "[email protected]" | |
SELECT name | |
FROM authors | |
WHERE email = "[email protected]" | |
2. Find the author who was created most recently | |
SELECT name, created_at |
This file contains hidden or 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
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. | |
# WRITE YOUR CODE HERE. Name your method `names`. | |
def names(name) | |
array = [first_name, last_name] |
This file contains hidden or 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
def palindrome?(str) | |
str = str.downcase | |
str == str.reverse | |
end | |
#there's a gets.chomp in here somewhere, I'm sure of it |
This file contains hidden or 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
# Technical interview: | |
-take your laptop | |
##Questions the interviewer might ask you: | |
1. Describe the project you are most proud of | |
* get technical, describe the tech you used | |
* if you go more than five minutes, you're not doing it right | |
* if you have your laptop, offer to show interviewer your app/site/etc (may or may not take you up on it) | |
* distinguish between exciting tech (stripe) and not (rails gems) | |
2. Testing |
This file contains hidden or 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
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write two methods: | |
# | |
# * `first_name`: given a name in string, return the first name. | |
# * `last_name`: given a name in string, return the last name. | |
# WRITE YOUR CODE HERE. | |
def names |