Developed in 1995, Ruby is an object-oriented programming language that is dynamic, reflective and general-purpose. What do you know about the ins and outs of the language? Let’s take a look in this programming-themed quiz!
Left to Right, irrespective of what the operation is
Parenthesis(P) first and then Left to Right, irrespective of what the operation is
PEDMAS
PEMDAS
Rate this question:
Str.chop
Str.chomp
Str.each_line
Str.slice
Rate this question:
Clone
B = a.collect
B = a.copy
Use the each method with a do block to copy each element
Rate this question:
Dir()
Tmpdir()
Tempfile()
Tempdir()
Rate this question:
True
False
Rate this question:
Scope of the instance variable is restricted to the object self refers to
Scope of instance variables is limited to the class in which the variable is instantiated
Instance variables are always public variables
Instance variables can be used as constants in a program
Rate this question:
@
#
~
^
Rate this question:
Uniq
Unique
Distinct
One
Rate this question:
ARGF
ARGV
STDIN
-n flag
Rate this question:
Strip()
Trim()
Chomp()
Chop()
Rate this question:
!
[]
()
?
Rate this question:
Rate this question:
[65]
[65, 65, 65, 65]
[65, nil, 65, nil, nil]
14
Rate this question:
Array.map
Array.select
Array.each
Array.each_with_index
Rate this question:
Rate this question:
Str.upcase
Str.uppercase
Str.upper
Str.UPPER
Rate this question:
Str.downcase
Str.lower
Str.lowercase
Str.lcase
Rate this question:
Test, #{y}
Test, str
Test, y
Test,
Rate this question:
True
False
Nil
0
Rate this question:
True
False
Nil
0
Rate this question:
0
Nil
True
6
Rate this question:
0
Nil
True
1
Rate this question:
0
Nil
True
False
Rate this question:
0
True
Nil
False
Rate this question:
Local(_), Instance($) and Static($$)
Bool, Char & Float
Class (@@), Instance (@) and Global($)
There is no restriction on variable type in ruby
Rate this question:
Quiz Review Timeline (Updated): Mar 18, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.