-
What is the difference between a local variable, and an instance variable?
-
What is the datatype of
"DevPoint Labs"
? -
Assign the number
10
to the local variablen
. -
Assign your name to the local variable
name
. -
What is an Array?
-
Give an example of when you’d use an Array.
-
What is a method?
-
Name 3 iterator methods for an Array.
-
Name 3 methods for a String.
-
What datatype does
5 / 2
return? -
What is a Hash?
-
Give an example of when you’d use a Hash.
-
What is a class?
-
True or False; A class is a constant.
-
true
andfalse
are called what? -
Write 4 conditional operators.
-
Create a method called bucket that returns an empty array.
-
Name 6 ruby special keywords. (a keyword is a word that already has a special meaning)
-
How would you convert a number into a string?
-
How would you convert a string into a number?
-
What is class inheritance?
-
What are modules used for?
-
What is a gem?
-
Name 4 gems, and their purposes.
-
What are comments used for in programming?
-
In Ruby, only 2 things evaluate to
false
. What are they? -
Write 2 comparison operators.
-
Write the code for “ if dave’s age is greater than or equal to 21”
-
Instantiate a
Car
class. -
What is a method chain?
-
How would you capitalize and reverse a string then print it out to the console?
-
What is a method to add an object to an array?
-
How would you add an object to a hash?
-
What are 2 valid datatypes of keys for a hash?
-
What is a writer method?
-
What is a reader method?
-
There are 4 types of variables. What are they?
-
What does the question mark at the end of a method in ruby mean?
-
What’s a common way to debug your code?
-
How would you return the string
"two"
from this array?arr = ["one", "two", "three"]
-
How would you return the string
"DevPoint"
from this hash?hsh = {:name => "DevPoint"}
-
What is the datatype for
:age
? -
What is the datatype for
-36.98
? -
What is the datatype for
[1, 2, 3]
? -
What is the datatype for
"BOOM goes the dynamite"
? -
What is the datatype for
123412
? -
What is the datatype for
{:food => "burger"}
? -
What is the datatype for
false
? -
What is the purpose of
nil
? -
How would you print out the current date?
-
How would you print out just the current year without using a Fixnum?
-
What is String interpolation?
-
What is String concatenation?
-
What does OOP stand for?
-
What does instantiation mean?
-
What is the name of the method that is called every time an object is instantiated?
-
What are arguments?
-
How do you pass an argument?
-
Write a method called
eat
that has an argumentfood
with a default value of"cheese"
. -
What is a loop?
-
How long has ruby been around?
-
How are you doing on this quiz so far?
-
Is anyone else hungry?
-
What are the pipe characters used for in a block?
-
What is the difference between single quote strings and double quote strings?
-
Name some rules for naming a method?
-
How can you tell if a method is an instance or class method?
-
In an instance method, what is
self
? -
How do you add a dependency to a file?
-
I have a text file called
names.txt
. Each name is on it's own line. How would you print all the names in the file? -
When a method defines an argument that has a asterisk in front of a variable name, what is that asterisk referred to? e.g.
def thing(*stuff)
-
When a method defines an argument that has an ampersand in front of a variable name, what is that ampersand and variable name collectivly called? e.g.
def thing(&stuff)
-
What is it called when you see the
do
andend
keywords together? -
What does DRY stand for?
-
What does DSL stand for?
-
This question left blank intentionally.
-
What does MRI stand for?
-
What is the difference between JRuby and MRI?
-
What would you use RubyMotion for?
-
Does your head hurt?
-
-
Save jwoertink/b2d9a05d71313f6ccd84 to your computer and use it in GitHub Desktop.
Ruby Quiz I For DevPoint Labs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment