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

2. Instance variables in ruby begin with?


3. String is a sequence of _________ characters.

Both A and B
None of the above

4. What will be output for the following code?

str = ""Hello Ruby!""
putc str

Hello Ruby!

5. What does the 1..5 indicate?

Exclusive range
Both inclusive and exclusive range
Inclusive range
None of the above

6. What is the sequence of ruby strings?

16-bit bytes
8-bit bytes
4-bit bytes
None of the above

7. Which notation is used for Octal notation?


8. Ruby was written in?

Objective C

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

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

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

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

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