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 is used to execute the rescue block again from the beginning after capturing the exception?

retry
raise
ensure
else

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

for i in 1..5 && j in 5..10
puts i+j
end

6 8 10 12 14 16
Syntax Error
6 8 10 12 14
Type Error

3. Which statement is used to Restarts this iteration of the most internal loop, without checking loop condition?

break
next
redo
retry

4. What does end represent?

keyword represents the ending of loop
keyword represents the start of loop
keyword represents the start and ending of loop
keyword represents the infinite loop

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

boolean_var = !true || (true || 36 != 6**2)
puts boolean_var

TRUE
FALSE
Error
None of the above

6. Ruby is ?

procedural language
scripting language
Markup language
Stylesheet language

7. Ruby is designed by?

Yukihiro Matsumoto
Guido van Rossum
Tim Berners-Lee
Brendan Eich

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

num=4>>2
puts num

-2
0
2
1

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

self
current
nil
_FILE_

10. Raise Statement is used for?

statement is used to raise an exception
statement is used to solve an exception
statement is used to raise and solve an exception
None of the above

Results