Skip to content

Instantly share code, notes, and snippets.

@jwoertink
Last active October 2, 2015 21:58
Show Gist options
  • Save jwoertink/b2d9a05d71313f6ccd84 to your computer and use it in GitHub Desktop.
Save jwoertink/b2d9a05d71313f6ccd84 to your computer and use it in GitHub Desktop.
Ruby Quiz I For DevPoint Labs
  1. What is the difference between a local variable, and an instance variable?

  2. What is the datatype of "DevPoint Labs"?

  3. Assign the number 10 to the local variable n.

  4. Assign your name to the local variable name.

  5. What is an Array?

  6. Give an example of when you’d use an Array.

  7. What is a method?

  8. Name 3 iterator methods for an Array.

  9. Name 3 methods for a String.

  10. What datatype does 5 / 2 return?

  11. What is a Hash?

  12. Give an example of when you’d use a Hash.

  13. What is a class?

  14. True or False; A class is a constant.

  15. true and false are called what?

  16. Write 4 conditional operators.

  17. Create a method called bucket that returns an empty array.

  18. Name 6 ruby special keywords. (a keyword is a word that already has a special meaning)

  19. How would you convert a number into a string?

  20. How would you convert a string into a number?

  21. What is class inheritance?

  22. What are modules used for?

  23. What is a gem?

  24. Name 4 gems, and their purposes.

  25. What are comments used for in programming?

  26. In Ruby, only 2 things evaluate to false. What are they?

  27. Write 2 comparison operators.

  28. Write the code for “ if dave’s age is greater than or equal to 21”

  29. Instantiate a Car class.

  30. What is a method chain?

  31. How would you capitalize and reverse a string then print it out to the console?

  32. What is a method to add an object to an array?

  33. How would you add an object to a hash?

  34. What are 2 valid datatypes of keys for a hash?

  35. What is a writer method?

  36. What is a reader method?

  37. There are 4 types of variables. What are they?

  38. What does the question mark at the end of a method in ruby mean?

  39. What’s a common way to debug your code?

  40. How would you return the string "two" from this array? arr = ["one", "two", "three"]

  41. How would you return the string "DevPoint" from this hash? hsh = {:name => "DevPoint"}

  42. What is the datatype for :age?

  43. What is the datatype for -36.98?

  44. What is the datatype for [1, 2, 3]?

  45. What is the datatype for "BOOM goes the dynamite"?

  46. What is the datatype for 123412?

  47. What is the datatype for {:food => "burger"}?

  48. What is the datatype for false?

  49. What is the purpose of nil?

  50. How would you print out the current date?

  51. How would you print out just the current year without using a Fixnum?

  52. What is String interpolation?

  53. What is String concatenation?

  54. What does OOP stand for?

  55. What does instantiation mean?

  56. What is the name of the method that is called every time an object is instantiated?

  57. What are arguments?

  58. How do you pass an argument?

  59. Write a method called eat that has an argument food with a default value of "cheese".

  60. What is a loop?

  61. How long has ruby been around?

  62. How are you doing on this quiz so far?

  63. Is anyone else hungry?

  64. What are the pipe characters used for in a block?

  65. What is the difference between single quote strings and double quote strings?

  66. Name some rules for naming a method?

  67. How can you tell if a method is an instance or class method?

  68. In an instance method, what is self?

  69. How do you add a dependency to a file?

  70. 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?

  71. 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)

  72. 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)

  73. What is it called when you see the do and end keywords together?

  74. What does DRY stand for?

  75. What does DSL stand for?

  76. This question left blank intentionally.

  77. What does MRI stand for?

  78. What is the difference between JRuby and MRI?

  79. What would you use RubyMotion for?

  80. Does your head hurt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment