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 type of number(0b1011 ) is ?

Octal
Hexadecimal
Binary
Decimal

2. Which of the following is not a Reserved Words in Ruby?

begin
ensure
retry
pass

3. What will be output for the following code?

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

t
e
MCQs
Ruby

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

num=(10<11)||(11===11)? (11===11.0): 0
puts num

TRUE
FALSE
1
0

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

for i in 1...3  
  for j in 1..3
  puts j
  end
end

1 2 1 2
0 1 2 0 1 2
1 2 3 1 2 3
1 2 3 1 2

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

arr = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]
print arr

[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]].
[0, 0, 0, 0][0, 0, 0, 0].
[0, 0, 0, 0].
error

7. Reserved word can not be used as?

constant
variable names
Both A and B
None of the above

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

num=4<<2
puts num

4
8
16
32

9. Which of the following command is used to tell the size of array?

arraynames.size
arraynames.length
arraynames.len
Both A and B

10. Which of the following is correct syntax to create an array in ruby?

names = Array.new
names = Array.new(20)
Both A and B
None of the above

Results