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 output for the following code?

 begin
         
    puts 'no Exception raise' 
  
    rescue    
        puts 'Finally Saved!'
  
   else
        puts 'Else block execute because of no exception raise'
       
   ensure
      puts 'ensure block execute'
end

no Exception raise Else block execute because of no exception raise ensure block execute
no Exception raise Else block execute because of no exception raise
Finally Saved! Else block execute because of no exception raise ensure block execute
None of the above

2. Why can not we use quotation marks ("or") with boolean?

It indicates that we are talking about a string
It indicates that we are assining a value
It indicates that that we are replacing boolean data type with string data type
None of the above

3. What will be output for the following code?

str = "LetsFindCourse Ruby MCQs" puts str[-2]

Q
t
C
Error

4. Which statement is used to declares code to be called before the program is run?

Start
Begin
Here
End

5. Which statement is used to Jumps to the next iteration of the most internal loop?

break
next
redo
retry

6. What will be output for the following code?

val1 = ""This is variable one""
puts ""val1""

This is variable one
VAL1
This is variable one val1
val1

7. Which of the following is not a type of Bitwise Operators?

<<
^
~
None of the above

8. Which of the following is not type of operator in ruby?

Arithmetic Operators
Comparison Operators
Similar operator
Parallel Assignment

9. What will be output for the following code?

str2 = String.new ""LetsFindCourse""

puts str2 

LETSFINDCOURSE
letsfindcourse
Error
LetsFindCourse

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

Results