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. What will be the output of the given code?

i = 4
while i > 0 do
  print i
  i -= 1
end

321
3210
4321
43210

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

for num in 1...4

   puts num*num

end

0 1 4 9
1 4 9 16
0 1 2 3
1 2 3

3. What is the sequence of ruby strings?

16-bit bytes
8-bit bytes
4-bit bytes
None of the above

4. Which notation is used for Octal notation?

\s
\xnn
\n
\nn

5. Which method is used to write content in the file ?

systemwrite
sysputs
syswrite
systemputs

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

arr = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]
print arr

[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]].
[0, 0, 0, 0][0, 0, 0, 0].
[0, 0, 0, 0].
error

7. Ruby 2.7.1 version release date?

31-03-2019
31-01-2020
31-03-2020
31-04-2019

8. What is the extension used for saving the ruby file?

.rb extension
.ruby extension
.rrb extension
.rbb extension

9. Each element in an array is associated with _______.

Numbers
Index
Integer
None of the above

10. single-quoted strings don`t allow ?

substitution
backslash notation
single-quoted strings allow substitution and backslash notation.
single-quoted strings don`t allow substitution and allow backslash notation.

Results