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. Class variables in ruby begin with?

@
#
double @
##

2. Which of the following statement is not a feature of ruby?

Ruby is interpreted programming language.
Ruby can be used to write Common Gateway Interface (CGI) scripts.
Ruby can be embedded into Hypertext Markup Language (HTML).
Ruby can not be connected to Database.

3. what will be output for the following code?

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

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

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

Arithmetic Operators
Comparison Operators
Similar operator
Parallel Assignment

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

arr = [1, 2, 3, 4]
print arr

[1, 2, 3, 4]
1234
error
Infinite Loop

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

num=4<<2
puts num

4
8
16
32

7. Which statement is used to declares code to be called before the program is run?

Start
Begin
Here
End

8. Each element in an array is associated with _______.

Numbers
Index
Integer
None of the above

9. Ruby is ?

procedural language
scripting language
Markup language
Stylesheet language

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

Results