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 is the output of the given code?

a=[[a,b]]
b=[[e,a]]
print a + b

[["a", "b"], ["e", "a"]].
[["2a", "b"], ["e"]].
TRUE
FALSE

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

array = [100, 200, 300, 400, 500]
print array[4]

[100, 200, 300, 400, 500]
300
400
500

3. Ruby was created in?

1992
1993
1994
1995

4. What will the following expression evaluate to?

!true && !false

TRUE
FALSE
Syntax Error
None of the above

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

boolean_var = 3**2 != 2**3 || true
puts boolean_var

TRUE
FALSE
1
0

6. Ruby arrays are ____________.

unordered
ordered
Both A and B
None of the above

7. String is a sequence of _________ characters.

one
many
Both A and B
None of the above

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

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

counter = true
while counter !=false
  puts counter
end

TRUE
FALSE
Syntax Error
Infinite Loop

10. What is the output of the given code?

array1 = [[1,2,3,4],[0,0,0,0]]
array2 = [[1,2,3,4],[0,0,0,0]]
print array1-array2

[[1, 2, 3, 4], [0, 0, 0, 0]]
[[1, 2, 3, 4], [0, 0, 0, 0], [1, 2, 3, 4], [0, 0, 0, 0]]
[]
Nil

Results