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. Which statement will execute at the end of the code, whether the exception raise or not?

retry
raise
ensure
else

2. What will be output for the following code?

str2 = String.new ""LetsFindCourse""

puts str2 

LETSFINDCOURSE
letsfindcourse
Error
LetsFindCourse

3. 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

4. Ruby arrays are ____________.

unordered
ordered
Both A and B
None of the above

5. Which character is used to give comment in ruby?

!
@
#
$

6. Among the following which operator has lowest Precedence?

.
^
...
>>

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

Octal
Bignum
Fixnum
Binary

8. Which statement can be used to take any input from the user from standard screen?

gets
puts
read
write

9. Double quotes and single quotes will interpolates ?

TRUE
FALSE
double quotes will interpolates
Single quotes will interpolates

10. Default value of class variables is?

nil
infinite
-1
error

Results