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 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 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) | |
array.any? {|i| i.even?} |
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 class which has an initialize method, a reader method, a private | |
# method, and a class method. | |
# WRITE YOUR CODE HERE. | |
class Goat | |
def initialize(name) | |
@goat = Goat.new |
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 class which wraps around an array, but only allows odd numbers | |
# to be stored in the array. | |
class OddArray | |
def initialize(array) | |
end |
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 classes which inherit from the Vehicle class below. You will also | |
# need to add a method to the Vehicle class during this challenge. | |
class Vehicle | |
def initialize(make, model) | |
@make = make | |
@model = model |
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
Detailed Ruby Questions | |
What is the difference between a hash and an array? | |
A hash is an unordered collection of key/value pairs. | |
Arrays are ordered, integer-indexed collections of any object | |
Both are enumerables | |
No .first on a hash | |
No .keys on an array | |
What is the difference between a string and a symbol? |
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
Detailed Rails Questions | |
What is the difference between form_for and form_tag? | |
Form_for is required for nested attributes, and is for a specific object. Form_tag can be used generally on the page and doesn't have to target a specific object. form_for @user do | |
When you submit a form_tag it posts and goes to the same page by default | |
Form_for goes to create/update by default | |
-create if the object it's targeting have never been saved, update if it has | |
What is the difference between render and redirect_to? | |
Render will render the form or whatever on your web page so you can see it. Redirect will send the user to another page on your site. |
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
Detailed Supporting Technology Questions | |
Why would you use SCSS instead of CSS? | |
SCSS is cleaner, you can specify elements very specifically and whether they're contained in other elements | |
Easier to make a more uniform styling for an app | |
Nesting | |
SCSS is a bonus, css still works | |
You can assign variables and use those throughout your style | |
You can import files and make a mixin to make groups of CSS declarations that you want to reuse throughout your site |
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
Intellectual property | |
4 types of protection | |
1. patent -compositions of matter, devices | |
2. copyright - original expression (including software) | |
3. trademark - source id/consumer goodwill | |
4. trade secret - valuable, secret business | |
What is copyrightable? | |
-original works, including software | |
-default rule is authorship = ownership (unless it's a work made for hire for your employer) |