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. Among the following which operator has highest Precedence?

::
.
[]
**

2. Which of the following Ruby Pseudo Variables is used to return current line number in the source file?

_FILE_
_CURRENT_
_LINE_
None of the above

3. What is the syntax to close file in ruby?

File.close()
close.File
File.close
close.File()

4. On which platform ruby runs on ?

Windows
Mac OS
Unix
All of the above

5. Default value of class variables is?

nil
infinite
-1
error

6. Which operator is used to find exponent in ruby?

*
**
^
%

7. Which statement is used to execute the rescue block again from the beginning after capturing the exception?

retry
raise
ensure
else

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

a=[1,2,3,4,5]
b=[1,2,4,6,8]
if a[3]==b[2]
    print Equal
end

TRUE
FALSE
Equal
error

9. String are?

mutable
unmutable
Both A and B
None of the above

10. what will be output for the following code?

str1 = LFC puts "str1: #{str1}"

str1: LFC
str1: #{str1}
str1: {LFC}
str1: #{LFC}

Results