Test Your Knowledge: Ruby Programming Language

Test Your Knowledge: Ruby Programming Language

Do you think you know all about Ruby programming language? Take this quiz and find out!

published on February 26
1/11

Who created the Ruby programming language?

Who created the Ruby programming language?
Yukihiro Matsumoto
Matz
Guido van Rossum
Larry Wall
2/11

In which year was Ruby first released?

In which year was Ruby first released?
1995
2000
2005
3/11

What is the default file extension for Ruby files?

What is the default file extension for Ruby files?
.rb
.py
.java
.cpp
4/11

Which of the following is a valid way to define a class in Ruby?

Which of the following is a valid way to define a class in Ruby?
class MyClass { }
class MyClass end
def MyClass: end
MyClass = Class.new
5/11

What does the 'puts' method do in Ruby?

What does the 'puts' method do in Ruby?
Returns the index of an element in an array
Outputs a string to the console with a newline
Performs a mathematical operation
Reads input from the user
6/11

Which of the following is not a valid Ruby variable name?

Which of the following is not a valid Ruby variable name?
my_var
_myVar
2var
myVar
7/11

What does the 'each' method do in Ruby?

What does the 'each' method do in Ruby?
Sorts an array in ascending order
Iterates over each element in an array
Joins two arrays together
Finds the maximum value in an array
8/11

Which operator is used for string concatenation in Ruby?

Which operator is used for string concatenation in Ruby?
&
+=
+
|
9/11

What does the 'self' keyword refer to in Ruby?

The current object or class
The parent object
A reserved keyword for method naming
The global scope
10/11

What type of programming language is Ruby?

What type of programming language is Ruby?
Interpreted
Compiled
Assembly
Machine
11/11

What is the primary use of the 'gem' command in Ruby?

What is the primary use of the 'gem' command in Ruby?
To manage Ruby libraries and dependencies
To run Ruby scripts
To create new Ruby classes
To install Ruby on a system