Ruby Programming Quiz


Play this quiz that will help you to excel in Ruby certification exams, placements etc. This Ruby programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Ruby programming test enables you to assess your knowledge of Ruby programming.

Take the Free Practice Test



Ruby MCQs

Practice Ruby MCQ Questions, which will help you to understand Ruby Programming related concepts and also helps you to prepare for placements, interviews, competitive exams etc.

Ruby Quiz

Try Free Ruby Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Ruby Quiz

1. Default value of class variables is?

nil
infinite
-1
error

2. Which notation is used for Octal notation?

\s
\xnn
\n
\nn

3. Among the following which operator has lowest Precedence?

.
^
...
>>

4. Which of the following Ruby Pseudo-Variables is used for The receiver object of the current method?

self
current
nil
_FILE_

5. Which statement will execute at the end of the code, whether the exception raise or not?

retry
raise
ensure
else

6. What will be the output of the given code?

i=1
for i in 6..10
puts i**2
end

36 49 64 81
49 64 81 100
49 64 81
36 49 64 81 100

7. What is the output of the given code?

array1 = [[1,2,3,4],[0,0,0,0]]
array2 = [[1,2,3,4],[0,0,0,0]]
print array1-array2

[[1, 2, 3, 4], [0, 0, 0, 0]]
[[1, 2, 3, 4], [0, 0, 0, 0], [1, 2, 3, 4], [0, 0, 0, 0]]
[]
Nil

8. Constants in ruby begin with ?

Lowercase
!
!
Uppercase

9. Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?

Octal
Bignum
Fixnum
Binary

10. In range operator ... is used for ?

Creates a range from start point to end point inclusive.
Creates a range from start point to end point exclusive.
Creates a range from start point inclusive to end point exclusive.
Creates a range from start point exclusive to end point inclusive.

Results