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 operator is used to find exponent in ruby?

*
**
^
%

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 of the following is not a type of Bitwise Operators?

<<
^
~
None of the above

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

5. What will be output for the following code?

str = ""Hello Ruby!""
putc str

Hello Ruby!
H
R
Hello

6. Reserved word can not be used as?

constant
variable names
Both A and B
None of the above

7. Ruby was written in?

C
C++
Java
Objective C

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

a=1
b=1
while a&&b
puts a+b
end

2
2 2 2 2 2
Infinite Loop
Syntax Error

9. When Whitespace characters such as spaces and tabs can not ignored in Ruby code?

While using strings
While using integer
while using float value
All of the above

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

Arithmetic Operators
Comparison Operators
Similar operator
Parallel Assignment

Results